This interface provides operations on objects of type Path.T and of type R2Path.T. A Path.T is the path represented on an integer grid, a R2Path.T is a path represented by coordinates which are reals.
INTERFACER2PathExtra ; IMPORT Point, MG, Path, R2Path, Rect, Matrix2D; PROCEDURE TranslatePath (READONLY path: Path.T; READONLY delta: Point.T): Path.T;
Returnpath
translated bydelta
.
PROCEDURE R2PathToPath ( v : MG.V; READONLY R2Path: R2Path.T; READONLY matrix := Matrix2D.Identity): Path.T;
ConvertR2Path
to the equivalentPath.T
on an integer grid transformed bymatrix
.
TYPE Element = RECORD pt: Point.T; steps: INTEGER; END; SubPath = RECORD start: Point.T; elems: REF ARRAY OF Element := NIL; closed: BOOLEAN; END; Segments <: PublicSegments; PublicSegments = OBJECT subPaths: REF ARRAY OF SubPath := NIL; END; PROCEDURE PathToSegments (v: MG.V; READONLY path: Path.T): Segments;
Convertpath
to the correspondingSegment
structure.
PROCEDURE PathBounds (READONLY path: Path.T): Rect.T;
Return the integer bounds of path
.
END R2PathExtra.