<> <> <> <> <<>> DIRECTORY AtomButtonsTypes, FunctionCache, Imager, IO, Rope, SV2d, SV3d, SVBasicTypes, SVModelTypes; SVSceneTypes: CEDAR DEFINITIONS = BEGIN <<>> Artwork: TYPE = SVModelTypes.Artwork; BoundHedron: TYPE = SVBasicTypes.BoundHedron; BoundBox: TYPE = SVBasicTypes.BoundBox; BoundBlock: TYPE = SVBasicTypes.BoundBlock; Camera: TYPE = SVModelTypes.Camera; Color: TYPE = Imager.Color; CoordSysList: TYPE = SVModelTypes.CoordSysList; CoordSystem: TYPE = SVModelTypes.CoordSystem; FeedbackData: TYPE = AtomButtonsTypes.FeedbackData; 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; Poly3d: TYPE = SV3d.Poly3d; Projection: TYPE = SVModelTypes.Projection; Sphere: TYPE = SV3d.Sphere; Vector3d: TYPE = SV3d.Vector3d; <> AlignmentObject: TYPE = REF ANY; -- types: AlignmentLine, AlignmentCircle, AlignmentPoint, SliceDescriptor FeatureData: TYPE = REF FeatureDataObj; FeatureDataObj: TYPE = RECORD [ type: FeatureType, shape: AlignmentObject ]; FeatureType: TYPE = {slice, distanceLine, slopeLine, angleLine, symmetryLine, sphere, intersectionPoint, midpoint, anchor}; <> 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: AlignmentObject, -- SliceDescriptor, AlignmentLine, AlignmentPoint, etc. 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, prim: Primitive, -- a cached version of the ray-tracing primitive 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: Sphere, 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: Sphere]; 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 SVRayImpl for the real 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, centroids: BOOL, 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, plane: Plane, poly: Poly3d, depth, frontDepth, backDepth: 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, <> isEmptyParts: IsEmptyPartsProc, isCompleteParts: IsCompletePartsProc, 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, <> withinBoundBlock: WithinBoundBlockProc, <> update: UpdateProc, -- change some aspect of the master object, such as how it draws itself <