<> <> <> <> 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_0]; <<--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_0, 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_0, dispose: BOOL_FALSE] RETURNS [Tesselation]; <<--grows if amount>0>> <<--shrinks if amount<0; (Not per tile! grows background)>> END.