<> <> <> <> DIRECTORY CoordSys, GraphicsColor, Matrix3d, Rope, Shading, SVBoundBox, SV2d, SVArtwork, SVVector3d; CSG: DEFINITIONS = BEGIN Artwork: TYPE = REF ArtworkObj; ArtworkObj: TYPE = SVArtwork.ArtworkObj; BoundBox: TYPE = SVBoundBox.BoundBox; BoundHedron: TYPE = SVBoundBox.BoundHedron; Color: TYPE = GraphicsColor.Color; CoordSystem: TYPE = CoordSys.CoordSystem; Matrix4by4: TYPE = Matrix3d.Matrix4by4; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = Matrix3d.Point3d; Vector: TYPE = SVVector3d.Vector; Surface: TYPE = REF ANY;-- may be RectSurface, TubeSurface, DiskSurface, ShellSurface... LightSourceList: TYPE = Shading.LightSourceList; RayCastProc: TYPE = PROC [cameraPoint: Point2d, localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification]; RayCastNoBBoxesProc: TYPE = PROC [localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification]; Classification: TYPE = REF ClassificationObj; ClassificationObj: TYPE = RECORD [ count: NAT, params: ParameterArray, surfaces: SurfaceArray, primitives: PrimitiveArray,-- the primitive from which each surface came classifs: InOutArray, normals: NormalArray]; maxSceneDepth: NAT = 40; ParameterArray: TYPE = ARRAY [1..maxSceneDepth] OF REAL; InOutArray: TYPE = ARRAY [1..maxSceneDepth] OF BOOL; NormalArray: TYPE = ARRAY [1..maxSceneDepth] OF Vector; SurfaceArray: TYPE = REF SurfaceArrayObj; SurfaceArrayObj: TYPE = ARRAY [1..maxSceneDepth] OF Surface; PrimitiveArray: TYPE = ARRAY [1..maxSceneDepth] OF Primitive; Primitive: TYPE = REF PrimitiveObj; PrimitiveObj: TYPE = RECORD [ name: Rope.ROPE, artwork: Artwork, assembly: REF ANY, -- a DisplayList3d.Assembly. REF ANY avoids compilation dependencies. mo: REF ANY, -- should be MasterObject but oh the compilation dependencies! rayCast: RayCastProc, rayCastNoBBoxes: RayCastNoBBoxesProc, primWRTAssembly: CoordSystem, scalars: Vector, worldWRTPrim: Matrix4by4, primWRTWorld: Matrix4by4, hints: REF ANY, -- each object type may wish to store helpful information here boundBox: BoundBox, boundHedron: BoundHedron, inverted: BOOL, -- is this shape to be subtracted? currentRay: Ray, rayStepX: Ray]; Ray: TYPE = REF RayObj; RayObj: TYPE = RECORD [ basePt: Point3d, direction: Vector]; <> <> PointSetOp: TYPE = {union, intersection, difference}; Composite: TYPE = REF CompositeObj; CompositeObj: TYPE = RECORD [ name: Rope.ROPE, operation: PointSetOp, leftSolid: REF ANY, rightSolid: REF ANY, boundBox: BoundBox]; CSGTree: TYPE = REF CSGTreeObj; CSGTreeObj: TYPE = RECORD [ name: Rope.ROPE, son: REF ANY, backgroundColor: Color, shadows: BOOL]; CopyClass: PROC [class: Classification] RETURNS [copy: Classification]; MakeCompositeCell: PROC [name: Rope.ROPE, operation: PointSetOp, LeftSolidPtr: REF ANY, RightSolidPtr: REF ANY] RETURNS [c: Composite]; MakeCSGTree: PROC [son: REF ANY, backgroundColor: Color, shadows: BOOL] RETURNS [tree: CSGTree]; CombineBoundBoxes: PROC [bb1, bb2: BoundBox, op: PointSetOp] RETURNS [newBB: BoundBox]; END.