CDCurves.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, June 18, 1986 3:52:20 pm PDT
Last edited by: Christian Jacobi, September 18, 1986 5:57:48 pm PDT
DIRECTORY
CD,
Imager;
CDCurves: CEDAR DEFINITIONS =
BEGIN
Curve objects are lines, splines, polygons or filled curves.
The points in the CurveRec describe the center line of line or spline objects or the border points of polygons or filled curves.
Uses Bezier splines for filled curves and splines.
Restrictions:
The width w is supposed to be even.
The objects must be treated readonly.
The object size must not exceed LAST[NAT].
Usage must not depend on how clipping on edges is performed.
CurveSpecific: TYPE = REF CurveRec;
CurveRec: TYPE = RECORD [points: LIST OF CD.Position, w: CD.Number𡤀, path: Imager.Trajectory];
splineClass: PRIVATE CD.ObjectClass;
lineClass: PRIVATE CD.ObjectClass;
polygonClass: PRIVATE CD.ObjectClass;
filledCurveClass: PRIVATE CD.ObjectClass;
IsLine: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class = lineClass]
};
IsSpline: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class = splineClass]
};
IsPolygon: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class = polygonClass]
};
IsFilledCurve: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class = filledCurveClass]
};
CreateLine: PROC [points: LIST OF CD.Position, w: CD.Number, layer: CD.Layer] RETURNS [ob: CD.Object, offset: CD.Position];
--Creates a line object of width "w" (even) connecting the points "points".
CreateSpline: PROC [points: LIST OF CD.Position, w: CD.Number, layer: CD.Layer] RETURNS [ob: CD.Object, offset: CD.Position];
--Creates a spline object of width "w" (even) connecting the points "points".
CreatePolygon: PROC [points: LIST OF CD.Position, layer: CD.Layer] RETURNS [ob: CD.Object, offset: CD.Position];
--Creates a polygon object using the "points" as border line.
CreateFilledCurve: PROC [points: LIST OF CD.Position, layer: CD.Layer] RETURNS [ob: CD.Object, offset: CD.Position];
--Creates a filled curve object using the "points" as border line.
--All the create procs may return NIL or call CD.Error if restrictions are violated.
--offset: If applied as position to the curve object, it would go through its defining "points".
--[the coordinates of the points in the CurveRec are the original coordinates minus "offset"]
END.