CDPolygons.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, March 30, 1985 11:58:01 am PST
last edited by Christian Jacobi, March 25, 1986 1:16:14 pm PST
DIRECTORY
CD,
Imager;
CDPolygons: CEDAR DEFINITIONS =
BEGIN
PolygonPtr: TYPE = REF PolygonRec;
PolygonRec: TYPE = RECORD [points: LIST OF CD.Position, path: Imager.Trajectory];
polygonClass: PRIVATE CD.ObjectClass;
IsPolygon: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class = polygonClass]
};
CreatePolygon: PROC [points: LIST OF CD.Position, lev: CD.Layer] RETURNS [ob: CD.Object, offset: CD.Position];
--Creates a polygon object "ob: using "points" as a path. The path is translated such that
--the rect [0, 0, ob.size.x ob.size.y] is its bounding rect. "offset" is the translation vector
--to be applied for placing ob.
--Some restrictions on possible paths exist
--NIL or CD.Error if restrictions violated
END.