CDCSUtil.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Jacobi, December 12, 1985 2:19:57 pm PST
Jacobi, December 17, 1985 5:07:31 pm PST
DIRECTORY
CD,
CDBasics,
CornerStitching,
D2Basic,
Rope;
CDCSUtil: CEDAR DEFINITIONS =
BEGIN
Plane: TYPE = REF CornerStitching.Tesselation;
CDWorld: TYPE = REF CDWorldRec;
CDWorldRec: TYPE = RECORD [
design: CD.Design←NIL,
ob: CD.Object ← NIL,
clip: CD.Rect ← CDBasics.universe,
minGrowClip: CD.Number ← 0,
off: CD.Position ← [0, 0], -- scaling: csNumber ← (cdNumber+off)*scaleNum/scaleDenom
scaleNum: INT ← 1,
scaleDenom: INT ← 1,
drawChild: CD.DrawProc ← NIL,
drawContext: CD.DrawContextProc ← NIL,
stopFlag: REF BOOLNIL,
propRef: CD.PropRef --used by client only
];
Layers: TYPE = LIST OF LayerDesc;
LayerDesc: TYPE = REF LayerDescRec ← NIL;
LayerDescRec: TYPE = RECORD [
source: CD.Layer,
deltaDiameter: INT ← 0, -- + means cs feature is bigger than cd feature, in scaled numbers
growClip: CD.Number ← 0,
plane: Plane←NIL --NIL: use output tesselation; #NIL use this tesselation
];
New: PROC [filledWith: REFNIL, data: REFNIL, stopFlag: REF BOOLNIL] RETURNS [plane: Plane];
Dispose: PROC [basis: Plane];
Make: PROC [what: CDWorld, layers: Layers, into: Plane←NIL] RETURNS [Plane];
ExtractErrors: PROC [what: CDWorld, x: Plane, msg: Rope.ROPE, owner: ATOMNIL, dispose: BOOLTRUE, remFirst: BOOLTRUE, except: REFNIL] RETURNS [num: INT𡤀];
--basic operations
Fill: PROC [x: Plane, into: Plane←NIL, except: REFNIL, dispose: BOOLFALSE] RETURNS [Plane];
--fills "into" with $covered except where "x" has "except"
--NIL "into" creates new tesselation filled with NIL
Rem: PROC [x: Plane, into: Plane←NIL, except: REFNIL, dispose: BOOLFALSE] RETURNS [Plane];
--fills "into" with NIL except where "x" has "except"
--NIL "into" creates new tesselation filled with $covered
FillGrow: PROC [x: Plane, grow: INT𡤀, into: Plane←NIL, except: REFNIL, use: REF←$covered, dispose: BOOLFALSE] RETURNS [Plane];
--fills "into" with "use" except where "x" has "except"
--NIL "into" creates new tesselation filled with NIL
Copy: PROC [x: Plane, into: Plane←NIL, dispose: BOOLFALSE] RETURNS [Plane];
--simple copy operation
--fills "into" with "x" except where "x" is NIL
--NIL "into" creates new tesselation filled with NIL
--simple operators; use only $covered and NIL
Not: PROC [x: Plane, dispose: BOOLFALSE] RETURNS [Plane];
AndIn: PROC [x: Plane, into: Plane, dispose: BOOLFALSE] RETURNS [Plane];
OrIn: PROC [x: Plane, into: Plane, dispose: BOOLFALSE] RETURNS [Plane];
AndNotIn: PROC [x, into: Plane, dispose: BOOLFALSE] RETURNS [Plane];
--into ← into AND (~x)
And: PROC [t1, t2, t3, t4: Plane←NIL] RETURNS [Plane];
Or: PROC [t1, t2, t3, t4: Plane←NIL] RETURNS [Plane];
AndNot: PROC [a, n: Plane] RETURNS [Plane];
--a AND (~n)
Grow: PROC [x: Plane, amount: INT𡤀, dispose: BOOLFALSE] RETURNS [Plane];
--grows if amount>0
--shrinks if amount<0; (Not per tile! grows background)
END.