<> <> <> <> DIRECTORY AtomButtonsTypes, Imager, IO, Rope, SV2d, SV3d, SVBasicTypes, SVModelTypes, SVRayTypes, SVSceneTypes, ViewerClasses; CastRays: CEDAR DEFINITIONS = BEGIN Assembly: TYPE = SVSceneTypes.Assembly; BoundBox: TYPE = SVBasicTypes.BoundBox; Camera: TYPE = SVModelTypes.Camera; Classification: TYPE = SVRayTypes.Classification; Color: TYPE = Imager.Color; Composite: TYPE = SVRayTypes.Composite; CoordSystem: TYPE = SVModelTypes.CoordSystem; FeedbackData: TYPE = AtomButtonsTypes.FeedbackData; LightSourceList: TYPE = SVModelTypes.LightSourceList; Matrix4by4: TYPE = SV3d.Matrix4by4; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = SV3d.Point3d; Primitive: TYPE = SVRayTypes.Primitive; Ray: TYPE = SVRayTypes.Ray; Vector3d: TYPE = SV3d.Vector3d; Viewer: TYPE = ViewerClasses.Viewer; Surface: TYPE = SVRayTypes.Surface; -- REF ANY; CSGTree: TYPE = SVRayTypes.CSGTree; <> PointSetOp: TYPE = SVRayTypes.PointSetOp; <<{union, intersection, difference}>> ParameterArray: TYPE = SVRayTypes.ParameterArray; SurfaceArray: TYPE = SVRayTypes.SurfaceArray; InOutArray: TYPE = SVRayTypes.InOutArray; NormalArray: TYPE = SVRayTypes.NormalArray; PrimitiveArray: TYPE = SVRayTypes.PrimitiveArray; <> <> DrawTree: PROC [tree: CSGTree, lightSources: LightSourceList, camera: Camera, aisRope: Rope.ROPE, bAndWOnly: BOOL, notify: NotifyOfProgressProc _ NoOpNotifyOfProgress, clientData: REF ANY _ NIL, feedback: FeedbackData] RETURNS [success: BOOL, maxRed, maxGreen, maxBlue, maxBlack: NAT]; <> DrawTreeWithStartLine: PROC [startLine: REAL, tree: CSGTree, lightSources: LightSourceList, camera: Camera, aisRope: Rope.ROPE, bAndWOnly: BOOL, notify: NotifyOfProgressProc _ NoOpNotifyOfProgress, clientData: REF ANY _ NIL, feedback: FeedbackData] RETURNS [success: BOOL, maxRed, maxGreen, maxBlue, maxBlack: NAT]; <startLine are traced. (Useful mostly for debugging when starting the ray trace from the beginning would be too expensive).>> NotifyOfProgressProc: TYPE = PROC [currentY, minX, minY, maxX, maxY: REAL, clientData: REF ANY _ NIL]; NoOpNotifyOfProgress: NotifyOfProgressProc; <> <<>> SingleRay: PROC [cameraPoint: Point2d, tree: CSGTree, lightSources: LightSourceList, camera: Camera, feedback: FeedbackData, makeStream: BOOL _ FALSE] RETURNS [color: Color]; <> SingleRay2: PROC [cameraPoint: Point2d, tree: CSGTree, camera: Camera, consolidate: BOOL _ TRUE, feedback: FeedbackData, makeStream: BOOL _ FALSE] RETURNS [class: Classification, rayWorld: Ray]; <> <> <<>> <> <<>> <> SortClassByPrimitive: PROC [class: Classification]; <> <<>> NthSurfacePointAndNormal: PROC [class: Classification, rayWorld: Ray, n: NAT] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector3d]; <> LastOfFirstPointAndNormal: PROC [class: Classification, rayWorld: Ray] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector3d]; <> LastTopLevelPointAndNormal: PROC [class: Classification, rayWorld: Ray, root: Assembly] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector3d]; <> NthAssemblyAndPrimitive: PROC [class: Classification, n: NAT] RETURNS [assembly: Assembly, primitive: Primitive]; <> LastTopLevelAssemAndPrim: PROC [class: Classification, root: Assembly] RETURNS [assembly: Assembly, primitive: Primitive]; <> <> <> RayMeetsPlaneOfCoordSystem: PROC [coordSys: CoordSystem, rayWorld: Ray, whichPlane: NAT, depth: REAL _ 0] RETURNS [pointWorld: Point3d, parallel: BOOL]; <> NthHitData: PROC [class: Classification, n: NAT] RETURNS [hitData: REF ANY]; LastOfFirstHitData: PROC [class: Classification] RETURNS [hitData: REF ANY]; LastTopLevelHitData: PROC [class: Classification, root: Assembly] RETURNS [hitData: REF ANY]; <> <<>> RayCast: PROC [cameraPoint: Point2d, worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, feedback: FeedbackData _ NIL, makeStream: BOOL _ FALSE, indent: NAT _ 0] RETURNS [class: Classification]; <> RayCastBoundingSpheres: PROC [worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, feedback: FeedbackData _ NIL, makeStream: BOOL _ FALSE, indent: NAT _ 0] RETURNS [class: Classification]; RayCastNoBBoxes: PROC [worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, feedback: FeedbackData _ NIL, makeStream: BOOL _ FALSE, indent: NAT _ 0] RETURNS [class: Classification]; <> HitsTree: PROC [worldRay: Ray, tree: CSGTree] RETURNS [BOOL]; <> <<>> FirstHit: PROC [worldRay: Ray, tree: CSGTree, useBoundSpheres: BOOL, feedback: FeedbackData, makeStream: BOOL _ FALSE, indent: NAT _ 0] RETURNS [hits: BOOL, t: REAL]; <> <<>> <> GetClassFromPool: PROC RETURNS [class: Classification]; ReturnClassToPool: PROC [class: Classification]; MakeClassAMiss: PROC [class: Classification]; <> <> <<>> EmptyClass: PROC RETURNS [class: Classification]; WriteStreamComp: PROC [comp: Composite, class: Classification, feedback: FeedbackData, makeStream: BOOL, indent: NAT]; WriteStreamPrim: PROC [prim: Primitive, class: Classification, feedback: FeedbackData, makeStream: BOOL, indent: NAT]; UnionCombine: PROC [leftClass, rightClass: Classification, consolidate: BOOL] RETURNS [combinedClass: Classification]; IntersectionCombine: PROC [leftClass, rightClass: Classification, consolidate: BOOL] RETURNS [combinedClass: Classification]; DifferenceCombine: PROC [leftClass, rightClass: Classification, consolidate: BOOL] RETURNS [combinedClass: Classification]; END.