GriffinEncoding.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Written by: Maureen Stone, July 17, 1985 7:06:48 pm PDT
DIRECTORY
PointDefs USING [ScrPt, ScrRealPt, ObjPtSequence],
ImagerPath USING [MoveToProc, LineToProc, CurveToProc],
CubicSplines USING [SplineType],
Cubic2 USING [Bezier];
GriffinEncoding: CEDAR DEFINITIONS
~ BEGIN
ScrRealPt: TYPE = PointDefs.ScrRealPt;
ScrPt: TYPE = PointDefs.ScrPt;
EdgeEncoding: TYPE = REF EdgeEncodingRec;
EdgeEncodingRec: TYPE = RECORD [tl, br: ScrRealPt, links: LIST OF Link];
Link: TYPE = RECORD[tl, br: ScrRealPt, isLine: BOOLEANFALSE, bezier: REF LinkSequence];
LinkSequence: TYPE = RECORD[bezier: SEQUENCE length: NAT OF Cubic2.Bezier];
AreaEncoding: TYPE = REF AreaEncodingRec;
AreaEncodingRec: TYPE = RECORD [tl, br: ScrRealPt, isRectangle: BOOLEANFALSE, runs: SEQUENCE length: NAT OF Run];
Run: TYPE = RECORD[x, y: INTEGER, w: NAT];
EncodeLinearLink: PROC[endpoints: PointDefs.ObjPtSequence] RETURNS[Link];
EncodeCubicLink: PROC[knots: PointDefs.ObjPtSequence, splineType: CubicSplines.SplineType] RETURNS[Link];
EncodeEdge: PROC[links: LIST OF Link] RETURNS[EdgeEncoding];
AppendLink: PROC[edge: EdgeEncoding, link: Link] RETURNS[EdgeEncoding];
RemoveLastLink: PROC[edge: EdgeEncoding] RETURNS[Link];
returns the removed link so it can be erased
EncodeArea: PROC[edge: EdgeEncoding] RETURNS[AreaEncoding];
WalkEdge: PROC [edge: EdgeEncoding, moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc];
TranslateEdge: PROC[edge: EdgeEncoding, offset: ScrRealPt];
TranslateArea: PROC[area: AreaEncoding, offset: ScrRealPt];
PointOnEdge: PROC[pt: ScrPt, edge: EdgeEncoding, tol: REAL] RETURNS[BOOLEAN];
PointInArea: PROC[pt: ScrPt, area: AreaEncoding, tol: REAL] RETURNS[BOOLEAN];
PointForSelectToken: PROC[edge: EdgeEncoding] RETURNS[ScrPt];
END.