--communication between contour and knotfit
--m. stone February 25, 1981 10:00 PM
DIRECTORY
Cubic,
Vector;
ContourDefs: DEFINITIONS =
BEGIN
--initialized by contour.mesa
cZone: PUBLIC UNCOUNTED ZONE;

ArraySeq
: TYPE = RECORD [s: SEQUENCE l:INTEGER OF REAL];
Array: TYPE = LONG POINTER TO ArraySeq;
KnotHandle: TYPE = LONG POINTER TO Knot;
Knot: TYPE = RECORD
[next: KnotHandle ← NIL,
prev: KnotHandle ← NIL,
index: INTEGER ← 0,
value: Vector.Vec ← [0,0],
slope: Vector.Vec ← [0,0]
];
LinkType: TYPE = {line,cubic};
Link: TYPE = RECORD
[next: LinkHandle ← NIL,
p0: Vector.Vec ← [0,0],
value: SELECT linkType: LinkType FROM
line => [p1: Vector.Vec ← [0,0]],
cubic => [coeffs: Cubic.Coeffs],
ENDCASE
];
Sample: TYPE = RECORD
[next: SampleHandle ← NIL,
prev: SampleHandle ← NIL,
value: Vector.Vec ← [0,0],
step: REAL ← 0,
index,nEntries: INTEGER ← 0
];
Contour: TYPE = RECORD
[next: ContourHandle ← NIL,
links: LineLinkHandle ← NIL,
lastLink: LineLinkHandle ← NIL];
Path: TYPE = RECORD
[next: PathHandle ← NIL,
links: LinkHandle ← NIL,
lastLink: LinkHandle ← NIL];
ContourHandle: TYPE = LONG POINTER TO Contour;
PathHandle: TYPE = LONG POINTER TO Path;
LinkHandle: TYPE = LONG POINTER TO Link;
LineLinkHandle: TYPE = LONG POINTER TO line Link;
SampleHandle: TYPE = LONG POINTER TO Sample;
Fit: PROCEDURE[points: LinkHandle] RETURNS[PathHandle];
GetSDContours: PROC[char: CHARACTER] RETURNS[ContourHandle];
Analyze: PROCEDURE[points: LinkHandle];
FreePath: PROCEDURE[path: PathHandle];

ContourMain: PROGRAM;
KnotFit: PROGRAM;
SDPath: PROGRAM;
END.