FitStateUndo.mesa
Maureen Stone June 22, 1984 9:58:05 am PDT
DIRECTORY
Cubic USING [Bezier],
Complex USING [Vec],
Seq USING [ComplexSequence,NatSequence],
FitBasic USING [Handle, SampleHandle];
FitStateUndo: CEDAR DEFINITIONS =
BEGIN
Undo: PROC[handle: Handle]; --reverses the last operation
DataType: TYPE = {samples, links, nodes, cusps, contour}
RestoreData: PROC[handle: Handle, type: DataType, all: BOOLEAN]; --copies old data from undo
Note special case of 0 or nearly 0, (ImagerTransform.CloseEnough)
InvertTransform: PROC [handle: Handle]; --xform and all flag off of undo
ResetData: PROC[handle: Handle, type: DataType];
StartSamples: PROC[handle: Handle, x,y: REAL]; --RestoreData[handle, samples, FALSE]
ScaleData: PROC[handle: Handle, scale: REAL, type: DataType];
TranslateData: PROC[handle: Handle, trans: Complex.Vec, type: DataType];
above with all flag=TRUE
ResetAllData: PROC[handle: Handle, type: DataType];
ScaleAllData: PROC[handle: Handle, scale: REAL, type: DataType];
TranslateAllData: PROC[handle: Handle, trans: Complex.Vec, type: DataType];
these need no special procs to provide function, only to narrow the undo data
RemoveLast: PROC [handle: Handle, type: DataType]; --narrow, then call corresponding routine
RestoreLast: PROC [handle: Handle, type: DataType]; --narrow, then call corresponding routine
AddSample: PROC[handle: Handle, x,y: REAL];
InsertBefore: PROC[handle: Handle, x,y: REAL, s: FitBasic.SampleHandle];
RemoveSample: PROC[handle: Handle, s: FitBasic.SampleHandle];
AddLink: PROC[handle: Handle, b: Cubic.Bezier];
InsertBefore: PROC[handle: Handle, x,y: REAL, link: FitBasic.LinkHandle];
RemoveLink: PROC[handle: Handle, link: FitBasic.LinkHandle];
AddNode: PROC[handle: Handle, index: NAT, tan: Complex.Vec ← [0,0]];
DeleteNode: PROC[handle: Handle, index: NAT];
AddCusp: PROC[handle: Handle, index: NAT, tan: Complex.Vec ← [0,0]];
DeleteCusp: PROC[handle: Handle, index: NAT];
RestoreCurrentContour: PROC[handle: Handle]; --keeps a ref to the last contour on the undo
AddContour: PROC[handle: Handle]; -- Makes a new contour and selects it
NextContour: PROC[handle: Handle]; -- Moves to the next contour.
RestoreClosed: PROC[handle: Handle];
RestoreMinDist: PROC[handle: Handle];
Closed: PROC [handle: Handle, closed: BOOLEANTRUE] RETURNS [was: BOOLEAN];
MinDist: PROC [handle: Handle, minDist: REAL ← 0] RETURNS [was: REAL];
END.