DIRECTORY Imager USING [Rectangle, VEC, Transformation], ImagerPath USING [MoveToProc, CurveToProc], CubicSplines USING [CoeffsSequence], Cubic2 USING [Bezier]; CubicPaths: CEDAR DEFINITIONS ~ BEGIN VEC: TYPE = Imager.VEC; Path: TYPE = REF PathRec; PathRec: TYPE = RECORD[bounds: Imager.Rectangle, cubics: REF PathSequence]; PathSequence: TYPE = RECORD[bezier: SEQUENCE length: NAT OF Cubic2.Bezier]; PathFromCubic: PROC [coeffs: CubicSplines.CoeffsSequence, newBounds: BOOL _ TRUE] RETURNS [Path]; EnumeratePath: PROC [path: Path, moveTo: ImagerPath.MoveToProc, curveTo: ImagerPath.CurveToProc]; PointProc: TYPE = PROC [p: VEC] RETURNS [stop: BOOLEAN _ FALSE]; WalkPath: PROC [path: Path, tol: REAL, proc: PointProc]; PointOnPath: PROC [pt: VEC, path: Path, tol: REAL] RETURNS [BOOLEAN]; TranslatePath: PROC [path: Path, offset: VEC]; TransformPath: PROC [path: Path, tranformation: Imager.Transformation, newBounds: BOOL _ TRUE]; UpdateBounds: PROC [path: Path]; --updates the bounding rectangle ClosestPoint: PROC [pt: VEC, path: Path] RETURNS[VEC]; CopyPath: PROC [path: Path] RETURNS[Path]; ReversePath: PROC [path: Path]; --reverses it in place END. κCubicPaths.mesa Copyright Σ 1985, 1987 by Xerox Corporation. All rights reserved. Written by: Maureen Stone August 5, 1985 8:39:13 pm PDT Russ Atkinson (RRA) February 2, 1987 10:43:11 pm PST Pier, August 5, 1987 3:50:29 pm PDT Call this inside of an Imager.PathProc to display the path. ie: pathProc: ImagerPath.PathProc = {EnumeratePath[path, moveTo, curveTo]}; Enumerates all the points on the curve. Uses subdivision. tol is for the flatness test Formerly in CubicPathsExtras Κς˜codešœ Οkœ™KšœB™BKšœ8™8K™4K™#K˜š ˜ Kšœœ œ˜.Kšœ œ˜+Kšœ œ˜$Kšœœ ˜——K˜šΟn œœ œ˜%K˜Kšœœ œ˜Kšœœœ ˜Kšœ œœ#œ˜LKš œœœ œ œœ˜LKš ž œœ2œœœ˜ašž œœN˜aK™;K™K—K˜Kšž œœœœœœœ˜@šžœœœ˜9K™X—Kš ž œœœœœœ˜FK˜Kšž œœœ˜.Kšž œœ?œœ˜`K˜—šœ™K˜Kšž œœΟc ˜AKš ž œœœœœ˜6Kšžœœœ˜*Kšž œœŸ˜6K™—Kšœ˜—…—’n