DIRECTORY Cubic USING [Bezier], Complex USING [Vec], Seq USING [ComplexSequence,NatSequence], FitBasic USING [Handle]; FitState: CEDAR DEFINITIONS = BEGIN Handle: TYPE = FitBasic.Handle; Create: PROC RETURNS [handle: Handle]; Undo: PROC[handle: Handle]; --reverses the last operation Closed: PROC [handle: Handle, closed: BOOLEAN _ TRUE] RETURNS [was: BOOLEAN]; MinDist: PROC [handle: Handle, minDist: REAL _ 0] RETURNS [was: REAL]; DataType: TYPE = {samples, links, nodes, cusps, contour}; ResetData: PROC[handle: Handle, type: DataType, all: BOOLEAN _ FALSE]; ScaleData: PROC[handle: Handle, scale: REAL, type: DataType, all: BOOLEAN _ FALSE]; TranslateData: PROC[handle: Handle, trans: Complex.Vec, type: DataType, all: BOOLEAN _ FALSE]; StartSamples: PROC[handle: Handle, x,y: REAL]; --starts a new sList, resets current one AddSample: PROC[handle: Handle, x,y: REAL]; --adds to the end of the current list RemoveSample: PROC[handle: Handle]; --unlinks the selected sample InsertBeforeSample: PROC[handle: Handle, x,y: REAL]; --inserts before the selected sample AddLink: PROC[handle: Handle, b: Cubic.Bezier]; AddNode: PROC[handle: Handle, index: NAT, tan: Complex.Vec _ [0,0]]; DeleteNode: PROC[handle: Handle, index: NAT]; AddCusp: PROC[handle: Handle, index: NAT, tanIn,tanOut: Complex.Vec _ [0,0]]; DeleteCusp: PROC[handle: Handle, index: NAT]; NewContour: PROC[handle: Handle]; -- Makes an empty contour and selects it NextContour: PROC[handle: Handle]; -- Moves to the next contour. CurrentNodes: PROC[handle: Handle] RETURNS[nodes: Seq.NatSequence, tangents: Seq.ComplexSequence]; CurrentSamples: PROC[handle: Handle] RETURNS[Seq.ComplexSequence]; CurrentCusps: PROC[handle: Handle] RETURNS[cusps: Seq.NatSequence, tangents: Seq.ComplexSequence]; EnumerateLinks: PROC[handle: Handle, newContour: PROC[x,y: REAL], newCubic: PROC[c: Cubic.Bezier]]; EnumerateSamples: PROC[handle: Handle, newContour: PROC[x,y: REAL], newSample: PROC[x,y: REAL]]; CountContours: PROC[handle: Handle] RETURNS [INT]; END. ÞFitState.mesa Maureen Stone June 25, 1984 7:53:01 pm PDT Michael Plass August 13, 1982 9:50 am A contour is a list of samples and a list of cubic links. The cubic links are usually the result of the last fitting operation. The handle keeps a list of contours with one marked as "current". Operations that apply to one contour act on the current contour. The current sample list keeps a reference to a selected sample. Operations that take a sample use the current sample. The selected is initialized to the list head. InsertBefore the list head adds the sample to the end of the list. AddSample and InsertBeforeSample change the selected sample to be the last sample added. contours is samples plus links. nodes and cusps are subsets of samples Links are not edited (yet) so only AddLink and Reset are necessary these set flags. No allocation necessary Change the definition of current contour For interface to fitting routines points and links independent of structures ʯ˜Jšœ ™ Jšœ*™*Jšœ&™&šÏk ˜ Jšœœ ˜Jšœœ˜Jšœœ˜(Jšœ œ ˜J˜—Jšœ œ˜Jš˜J˜Jšœœ˜J˜J™…J™ÃJ˜JšÏnœœœ˜&JšžœœÏc˜9Jš žœœœœœœ˜MJš žœœœœœ˜FJ˜J™HJšœ œ,˜:Jšž œœ&œœ˜FJš ž œœœœœ˜SJšž œœ:œœ˜^J˜Jšž œœœŸ(˜WJšž œœœŸ%˜QJšž œœŸ˜AJšžœœœŸ$˜ZJ™BJšžœœ"˜/J˜Jšœ)™)Jšžœœœ˜DJšž œœœ˜-Jšžœœœ%˜MJšž œœœ˜-J˜J™(Jšž œœŸ(˜JJšž œœŸ˜@J™J˜J™J™!Jšž œœœ8˜bJšžœœœ˜BJšž œœœ8˜bJ˜J™*Jš žœœœœ œ˜cJš žœœœœœœ˜`Jšž œœœœ˜2J˜J˜Jšœ˜J˜—…—ìy