Curve.mesa
Maureen Stone May 16, 1984 10:34:17 am PDT
Michael Plass August 13, 1982 9:50 am
DIRECTORY
Cubic USING [Bezier],
Imager USING [Context],
Complex USING [Vec],
Seq USING [ComplexSequence,NatSequence],
IO USING [STREAM];
Curve: CEDAR DEFINITIONS =
BEGIN
Handle: TYPE = REF Rec;
Rec: TYPE;
Create: PUBLIC PROC RETURNS [handle: Handle];
Visible: PUBLIC PROC [handle: Handle, visible: BOOLEAN ← TRUE] RETURNS [was: BOOLEAN];
SetClosed: PROC [handle: Handle, closed: BOOLEAN ← TRUE] RETURNS [was: BOOLEAN];
GetClosed: PROC [handle: Handle] RETURNS [closed: BOOLEAN];
defaultHandle: Handle;
ResetSamples: PUBLIC PROC[handle: Handle];
AddSample: PUBLIC PROC[handle: Handle, x,y: REAL];
StartSamples: PUBLIC PROC[handle: Handle, x,y: REAL];
ResetContours: PUBLIC PROC[handle: Handle]; -- yields one empty sample set
CountContours: PUBLIC PROC[handle: Handle] RETURNS [INT];
AddContour: PUBLIC PROC[handle: Handle]; -- Makes a new sample set and selects it
NextContour: PUBLIC PROC[handle: Handle]; -- Moves to the next contour.
EnumerateContours: PROC[handle: Handle, newContour: PROC, newCubic: PROC[c: Cubic.Bezier]];
ResetLinks: PUBLIC PROC[handle: Handle];
AddLink: PUBLIC PROC[handle: Handle, b: Cubic.Bezier];
ResetNodes: PUBLIC PROC[handle: Handle];
AddNode: PUBLIC PROC[handle: Handle, index: NAT, tan: Complex.Vec ← [0,0]];
DeleteNode: PUBLIC PROC[handle: Handle, index: NAT];
ResetCusps: PUBLIC PROC[handle: Handle];
AddCusp: PUBLIC PROC[handle: Handle, index: NAT, tanIn,tanOut: Complex.Vec ← [0,0]];
DeleteCusp: PUBLIC PROC[handle: Handle, index: NAT];
CurrentNodes: PUBLIC PROC[handle: Handle] RETURNS[nodes: Seq.NatSequence, tangents: Seq.ComplexSequence];
CurrentSamples: PUBLIC PROC[handle: Handle] RETURNS[Seq.ComplexSequence];
CurrentCusps: PUBLIC PROC[handle: Handle] RETURNS[cusps: Seq.NatSequence, tangents: Seq.ComplexSequence];
DrawLine: PUBLIC PROC[from, to: Complex.Vec];
MoveTo: PUBLIC PROC[dc: Imager.Context, p: Complex.Vec];
DrawTo: PUBLIC PROC[dc: Imager.Context, p: Complex.Vec];
TTY: PUBLIC PROC RETURNS[IO.STREAM];
END.