<> <> <> <> <<>> DIRECTORY FunctionCache, Imager, IO, Rope, SV2d, SV3d, SVBasicTypes, SVModelTypes; SVSceneTypes: CEDAR DEFINITIONS = BEGIN <<>> Artwork: TYPE = SVModelTypes.Artwork; BoundHedron: TYPE = SVBasicTypes.BoundHedron; BoundBox: TYPE = SVBasicTypes.BoundBox; BoundSphere: TYPE = SVBasicTypes.BoundSphere; Camera: TYPE = SVModelTypes.Camera; Color: TYPE = Imager.Color; CoordSystem: TYPE = SVModelTypes.CoordSystem; FrameBox: TYPE = SVModelTypes.FrameBox; LightSourceList: TYPE = SVModelTypes.LightSourceList; Line3d: TYPE = SV3d.Line3d; Matrix4by4: TYPE = SV3d.Matrix4by4; Plane: TYPE = SV3d.Plane; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = SV3d.Point3d; PolyDatabase: TYPE = SV3d.PolyDatabase; Projection: TYPE = SVModelTypes.Projection; Vector3d: TYPE = SV3d.Vector3d; <> Database: TYPE = REF DatabaseObj; DatabaseObj: TYPE = RECORD [ scenes: LIST OF Scene]; Skitter: TYPE = REF SkitterObj; SkitterObj: TYPE = RECORD [ alive: BOOL, cameraPt: Point2d, skitterWorld: Matrix4by4, attractor: SliceDescriptor, primitive: Primitive, -- the CSG primitive corresponding to attractor <> chair: SliceDescriptor, svData: REF ANY, mode: SkitterMode ]; SkitterMode: TYPE = {surface, tightrope, coordframe}; Scene: TYPE = REF SceneObj; SceneObj: TYPE = RECORD [ name: Rope.ROPE, coordSysRoot: CoordSystem, -- WORLD coordinates lightSources: LightSourceList, masterObjects: MasterObjectList, assembly: Slice, selected: SelectedData, savedSelected: SelectedData, -- for Abort and Extend Select tree: CSGTree, cameras: FileCameraList, anchor: Skitter, cameraOrder: LIST OF Rope.ROPE, backgroundColor: Color, shadows: BOOL, dirty: BOOL]; SelectedData: TYPE = RECORD [ normal: LIST OF SliceDescriptor _ NIL, -- a list of selected SliceDescriptors normalPtr: LIST OF SliceDescriptor _ NIL, -- finger pointer to end of normal normalPtrValid: BOOL _ FALSE, -- TRUE when normalPtr accurately points to end of normal hot: LIST OF SliceDescriptor _ NIL, -- a list of hot SliceDescriptors hotPtr: LIST OF SliceDescriptor _ NIL, -- finger pointer to end of hot hotPtrValid: BOOL _ FALSE, -- TRUE when hotPtr accurately points to end of normal active: LIST OF SliceDescriptor _ NIL, -- a list of active SliceDescriptors activePtr: LIST OF SliceDescriptor _ NIL, -- finger pointer to end of active activePtrValid: BOOL _ FALSE -- TRUE when activePtr accurately points to end of normal ]; FrameBlock: TYPE = REF FrameBlockObj; FrameBlockObj: TYPE = RECORD [ loX, hiX, loY, hiY, loZ, hiZ: REAL]; FileCamera: TYPE = REF FileCameraObj; FileCameraObj: TYPE = RECORD [ name: Rope.ROPE, origin: Point3d, focusPoint: Point3d, slant: REAL, -- the slant of the camera counter-clockwise from horizontal in degrees. resolution: REAL, focalLength: REAL, projection: Projection, frame: FrameBox, clippingPlanes: LIST OF Plane, visibleAssemblies: LIST OF Rope.ROPE]; FileCameraList: TYPE = LIST OF FileCamera; SelectionClass: TYPE = {normal, hot, active}; <> SliceGenerator: TYPE = REF SliceGeneratorObj; SliceGeneratorObj: TYPE = RECORD [ list: LIST OF Slice ]; SliceDescriptorGenerator: TYPE = REF SliceDescriptorGeneratorObj; SliceDescriptorGeneratorObj: TYPE = RECORD [ list: LIST OF SliceDescriptor ]; SliceDescriptor: TYPE = REF SliceDescriptorObj; SliceDescriptorObj: TYPE = RECORD [ slice: Slice, parts: SliceParts ]; SliceParts: TYPE = REF ANY; Slice: TYPE = REF SliceObj; SliceObj: TYPE = RECORD [ name: Rope.ROPE, coordSys: CoordSystem, shape: REF ANY, -- a Shape or an assembly list <> normalSelectedParts: SliceDescriptor, hotSelectedParts: SliceDescriptor, activeSelectedParts: SliceDescriptor, <> bBoxCache: FunctionCache.Cache, <> onOverlay: BOOL _ FALSE, mark: BOOL _ FALSE, -- for sweeping thru scenes by Undelete mechanism <> artwork: Artwork, showAs: ShowAsType _ normal, isTool: BOOL _ FALSE, toolMasterObject: MasterObject _ NIL, sittingOn: Rope.ROPE _ NIL -- the assembly whose surface it is sitting on. ]; ShowAsType: TYPE = {invisible, normal, tool, both}; Shape: TYPE = REF ShapeObj; ShapeObj: TYPE = RECORD [ coordSys: CoordSystem, mo: MasterObject]; ToolData: TYPE = REF ToolDataObj; ToolDataObj: TYPE = RECORD [ block: FrameBlock, infinite: BOOL, plane: NAT, clientData: REF ANY -- currently used for Slice objects ]; SliceList: TYPE = REF SliceListObj; SliceListObj: TYPE = RECORD [ list: LIST OF Slice, pointSetOp: PointSetOp]; <> <> Primitive: TYPE = REF PrimitiveObj; PrimitiveObj: TYPE = RECORD [ name: Rope.ROPE, artwork: Artwork, ignoreMe: BOOL _ FALSE, featureData: REF ANY, assembly: Slice, mo: MasterObject, sliceD: SliceDescriptor, rayCast: RayCastProc, rayCastNoBBoxes: RayCastNoBBoxesProc, rayCastBoundingSpheres: RayCastBoundingSpheresProc, localCS: CoordSystem, scalars: Vector3d, worldWRTPrim: Matrix4by4, primWRTWorld: Matrix4by4, hints: REF ANY, -- each object type may wish to store helpful information here boundBox: BoundBox, boundSphere: BoundSphere, boundHedron: BoundHedron, inverted: BOOL, -- is this shape to be subtracted? currentRay: Ray, rayStepX: Ray]; 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, boundSphere: BoundSphere]; CSGTree: TYPE = REF CSGTreeObj; CSGTreeObj: TYPE = RECORD [ name: Rope.ROPE, outOfDate: BOOL _ TRUE, son: REF ANY, backgroundColor: Color, shadows: BOOL]; <> Surface: TYPE = REF ANY; -- may be RectSurface, TubeSurface, DiskSurface, ShellSurface... Classification: TYPE = REF ClassificationObj; ClassificationObj: TYPE = RECORD [ count: NAT, params: ParameterArray, surfaces: SurfaceArray, stills: InOutArray, 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 Vector3d; SurfaceArray: TYPE = REF SurfaceArrayObj; SurfaceArrayObj: TYPE = ARRAY [1..maxSceneDepth] OF Surface; PrimitiveArray: TYPE = ARRAY [1..maxSceneDepth] OF Primitive; Ray: TYPE = REF RayObj; RayObj: TYPE; -- see CSGImpl for the read record SearchDepth: TYPE = {first, lastOfFirst, last, lastOfLevel1}; <> MasterObject: TYPE = REF MasterObjectRec; MasterObjectRec: TYPE = RECORD [ name: Rope.ROPE, class: MasterObjectClass, mainBody: REF ANY _ NIL, -- information independent of imaging style lineBody: REF ANY, shadeBody: REF ANY, rayCastBody: REF ANY ]; MasterObjectList: TYPE = LIST OF MasterObject; PointAndDone: TYPE = RECORD [point: Point3d, done: BOOL]; PointPairAndDone: TYPE = RECORD [lo, hi: Point3d, done: BOOL]; PointGenerator: TYPE = REF PointGeneratorObj; PointGeneratorObj: TYPE = RECORD [ sliceD: SliceDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; PointPairGenerator: TYPE = REF PointPairGeneratorObj; PointPairGeneratorObj: TYPE = RECORD [ sliceD: SliceDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; <<>> SelectMode: TYPE = {literal, joint, controlPoint, segment, segmentRange, traj, slice, topLevel, none}; ExtendMode: TYPE = SelectMode; PlanarSurface: TYPE = REF PlanarSurfaceObj; PlanarSurfaceObj: TYPE = RECORD [ whichSurface: REF ANY, <> assembly: Slice, mo: MasterObject, normal: Vector3d, depth: REAL]; -- in camera coords which the master object calculates (for now) <> PlanarSurfaceList: TYPE = LIST OF PlanarSurface; <> MasterObjectClass: TYPE = REF MasterObjectClassObj; MasterObjectClassObj: TYPE = RECORD [ name: Rope.ROPE, <> copy: CopyProc, getHedron: GetHedronProc, -- a polyhedron the bounds the object <> lineDraw: LineDrawProc, lineDrawTransform: LineDrawTransformProc, countSurf: CountSurfProc, getSurf: GetSurfProc, getSurfTransform: GetSurfTransformProc, normalsDraw: NormalsDrawProc, preprocess: PreprocessProc, rayCast: RayCastProc, rayCastNoBBoxes: RayCastNoBBoxesProc, rayCastBoundingSpheres: RayCastBoundingSpheresProc, drawSurf: DrawPlanarSurfaceProc, drawSubBoxes: DrawSubBoxesProc, drawSubSpheres: DrawSubSpheresProc, drawSelectionFeedback: DrawSelectionFeedbackProc, drawAttractorFeedback: DrawAttractorFeedbackProc, <> transform: TransformProc, <> describe: DescribeProc, describeHit: DescribeHitProc, filein: FileinProc, fileout: FileoutProc, fileoutPoly: FileoutPolyProc, <> emptyParts: EmptyPartsProc, newParts: NewPartsProc, unionParts: UnionPartsProc, differenceParts: DifferencePartsProc, movingParts: MovingPartsProc, augmentParts: AugmentPartsProc, <> pointsInDescriptor: PointsInDescriptorProc, nextPoint: NextPointProc, pointPairsInDescriptor: PointPairsInDescriptorProc, nextPointPair: NextPointPairProc, <> closestPointToPoint: ClosestPointToPointProc, closestPointToLine: ClosestPointToLineProc, closestSegmentToPoint: ClosestSegmentToPointProc, closestSegmentToLine: ClosestSegmentToLineProc, <> <> update: UpdateProc -- change some aspect of the master object, such as how it draws itself ]; MasterObjectClassList: TYPE = LIST OF MasterObjectClass; CopyProc: TYPE = PROC [mo: MasterObject, newName: Rope.ROPE] RETURNS [newMO: MasterObject]; GetHedronProc: TYPE = PROC [mo: MasterObject] RETURNS [hedron: BoundHedron]; DescribeProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [rope: Rope.ROPE]; DescribeHitProc: TYPE = PROC [mo: MasterObject, hitData: REF ANY] RETURNS [rope: Rope.ROPE]; FileinProc: TYPE = PROC [f: IO.STREAM, name: Rope.ROPE, version: REAL] RETURNS [mo: MasterObject]; FileoutProc: TYPE = PROC [f: IO.STREAM, mo: MasterObject]; FileoutPolyProc: TYPE = PROC [f: IO.STREAM, mo: MasterObject]; PreprocessProc: TYPE = PROC [prim: Primitive, camera: Camera]; <> RayCastProc: TYPE = PROC [cameraPoint: Point2d, localRay: Ray, sliceD: SliceDescriptor, prim: Primitive] RETURNS [class: Classification]; RayCastNoBBoxesProc: TYPE = PROC [localRay: Ray, sliceD: SliceDescriptor, prim: Primitive] RETURNS [class: Classification]; RayCastBoundingSpheresProc: TYPE = PROC [localRay: Ray, sliceD: SliceDescriptor, prim: Primitive] RETURNS [class: Classification]; LineDrawProc: TYPE = PROC[slice: Slice, dc: Imager.Context, camera: Camera]; LineDrawTransformProc: TYPE = PROC[sliceD: SliceDescriptor, dc: Imager.Context, camera: Camera, transform: Matrix4by4]; CountSurfProc: TYPE = PROC [masterObject: MasterObject] RETURNS [len: NAT]; GetSurfProc: TYPE = PROC [slice: Slice, camera: CoordSystem] RETURNS [PlanarSurfaceList]; GetSurfTransformProc: TYPE = PROC [sliceD: SliceDescriptor, camera: CoordSystem, transform: Matrix4by4] RETURNS [PlanarSurfaceList]; NormalsDrawProc: TYPE = PROC[dc: Imager.Context, data: REF ANY, camera: Camera, localCS: CoordSystem]; EmptyPartsProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [BOOL]; NewPartsProc: TYPE = PROC [slice: Slice, hitData: REF ANY, hitPoint: Point3d, mode: SelectMode] RETURNS [sliceD: SliceDescriptor]; UnionPartsProc: TYPE = PROC [partsA: SliceDescriptor, partsB: SliceDescriptor] RETURNS [aPlusB: SliceDescriptor]; DifferencePartsProc: TYPE = PROC [partsA: SliceDescriptor, partsB: SliceDescriptor] RETURNS [aMinusB: SliceDescriptor]; MovingPartsProc: TYPE = PROC [slice: Slice, selectedParts: SliceParts] RETURNS [background, overlay, rubber, drag: SliceDescriptor]; AugmentPartsProc: TYPE = PROC [sliceD: SliceDescriptor, selectClass: SelectionClass] RETURNS [more: SliceDescriptor]; ClosestPointToPointProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point3d, t: REAL] RETURNS [bestDist: REAL, pointWorld: Point3d, normalWorld: Vector3d, hitData: REF ANY, success: BOOL]; ClosestPointToLineProc: TYPE = PROC [sliceD: SliceDescriptor, cameraPoint: Point2d, line3d: Line3d, t: REAL, camera: Camera] RETURNS [bestDist: REAL, pointWorld: Point3d, normalWorld: Vector3d, hitData: REF ANY, success: BOOL]; ClosestSegmentToPointProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point3d, t: REAL] RETURNS [bestDist: REAL, pointWorld: Point3d, normalWorld: Vector3d, hitData: REF ANY, success: BOOL]; ClosestSegmentToLineProc: TYPE = PROC [sliceD: SliceDescriptor, cameraPoint: Point2d, line3d: Line3d, t: REAL, camera: Camera] RETURNS [bestDist: REAL, pointWorld: Point3d, normalWorld: Vector3d, hitData: REF ANY, success: BOOL]; PointsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [PointGenerator]; NextPointProc: TYPE = PROC [pointGen: PointGenerator] RETURNS [pointAndDone: PointAndDone]; PointPairsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [PointPairGenerator]; NextPointPairProc: TYPE = PROC [pointPairGen: PointPairGenerator] RETURNS [pointPairAndDone: PointPairAndDone]; DrawPlanarSurfaceProc: TYPE = PROC [dc: Imager.Context, ps: PlanarSurface, lightSources: LightSourceList, camera: Camera]; DrawSubBoxesProc: TYPE = PROC [dc: Imager.Context, prim: Primitive, screenCS: CoordSystem]; DrawSubSpheresProc: TYPE = PROC [dc: Imager.Context, prim: Primitive, camera: Camera]; DrawSelectionFeedbackProc: TYPE = PROC [slice: Slice, selectedParts: SliceParts, hotParts: SliceParts, dc: Imager.Context, camera: Camera, dragInProgress, caretIsMoving, hideHot, quick: BOOL]; DrawAttractorFeedbackProc: TYPE = PROC [sliceD: SliceDescriptor, selectedParts: SliceParts, dragInProgress: BOOL, dc: Imager.Context, camera: Camera]; TransformProc: TYPE = PROC [sliceD: SliceDescriptor, scene: Scene, transform: Matrix4by4]; UpdateProc: TYPE = PROC [mo: MasterObject, updateData: REF ANY]; END.