--m.stone June 10, 1980  3:20 PM
DIRECTORY
	PointDefs: FROM "PointDefs" USING[ObjPt,ScrPt,NDIM];

SplineDefs: DEFINITIONS =
BEGIN
FPCoords: TYPE = PointDefs.ObjPt;
NDIM: INTEGER = PointDefs.NDIM;
Coeffs: TYPE = RECORD
	[t3: FPCoords,
	 t2: FPCoords,
	 t1: FPCoords,
	 t0: FPCoords];

SplineType: TYPE = 
--global splines
	{naturalUM,cyclicUM,naturalAL,cyclicAL,
--special case cubic curves
	bezier,bsplineInterp,
--local splines
	bspline,crspline};	

DisplayFnc: TYPE = {write,erase};
TooFewKnots: SIGNAL[numknots: INTEGER] ;
UnknownSpline: SIGNAL[splineType: SplineType] ;
UnmatchedEnds: SIGNAL ;
NoInitSplines: SIGNAL ;

InitSplines: PROCEDURE[
	alloc: PROCEDURE[nwords: CARDINAL] RETURNS[POINTER],
	free: PROCEDURE[POINTER TO UNSPECIFIED]];

FreeCoeffs: PROCEDURE[coeffs: DESCRIPTOR FOR ARRAY OF Coeffs];

MakeSpline: PROCEDURE
	[knots: DESCRIPTOR FOR ARRAY OF FPCoords, splineType: SplineType]
	RETURNS [DESCRIPTOR FOR ARRAY OF Coeffs]; 

DisplayCubic: PROCEDURE
	[coeffs: POINTER TO Coeffs, 
	MoveTo: PROCEDURE[PointDefs.ScrPt], 
	DrawTo: PROCEDURE[PointDefs.ScrPt]];

END.