CDCSUtil.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Jacobi, December 12, 1985 2:19:57 pm PST
Jacobi, March 19, 1986 10:15:14 am PST
DIRECTORY
CD,
CDBasics,
CStitching,
D2Basic,
Rope;
CDCSUtil: CEDAR DEFINITIONS =
BEGIN
Tesselation: TYPE = CStitching.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 BOOL ← NIL,
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: Tesselation←NIL --NIL: use output tesselation; #NIL use this tesselation
];
New: PROC [filledWith: REF←NIL, data: REF ← NIL, stopFlag: REF BOOL ← NIL] RETURNS [plane: Tesselation];
Dispose: PROC [basis: Tesselation];
Make: PROC [what: CDWorld, layers: Layers, into: Tesselation←NIL] RETURNS [Tesselation];
ExtractErrors: PROC [what: CDWorld, x: Tesselation, msg: Rope.ROPE, owner: ATOM←NIL, dispose: BOOL←TRUE, remFirst: BOOL←TRUE, except: REF←NIL] RETURNS [num: INT𡤀];
--basic operations
Fill:
PROC [x: Tesselation, into: Tesselation←
NIL, except:
REF←
NIL, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--fills "into" with $covered except where "x" has "except"
--NIL "into" creates new tesselation filled with NIL
Rem:
PROC [x: Tesselation, into: Tesselation←
NIL, except:
REF←
NIL, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--fills "into" with NIL except where "x" has "except"
--NIL "into" creates new tesselation filled with $covered
FillGrow:
PROC [x: Tesselation, grow:
INT𡤀, into: Tesselation←
NIL, except:
REF←
NIL, use:
REF←$covered, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--fills "into" with "use" except where "x" has "except"
--NIL "into" creates new tesselation filled with NIL
Copy:
PROC [x: Tesselation, into: Tesselation←
NIL, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--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: Tesselation, dispose: BOOL←FALSE] RETURNS [Tesselation];
AndIn: PROC [x: Tesselation, into: Tesselation, dispose: BOOL←FALSE] RETURNS [Tesselation];
OrIn: PROC [x: Tesselation, into: Tesselation, dispose: BOOL←FALSE] RETURNS [Tesselation];
AndNotIn:
PROC [x, into: Tesselation, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--into ← into AND (~x)
And: PROC [t1, t2, t3, t4: Tesselation←NIL] RETURNS [Tesselation];
Or: PROC [t1, t2, t3, t4: Tesselation←NIL] RETURNS [Tesselation];
AndNot:
PROC [a, n: Tesselation]
RETURNS [Tesselation];
--a AND (~n)
Grow:
PROC [x: Tesselation, amount:
INT𡤀, dispose:
BOOL←
FALSE]
RETURNS [Tesselation];
--grows if amount>0
--shrinks if amount<0; (Not per tile! grows background)
END.