<> <> <> <> DIRECTORY Graphics, GraphicsColor, IO, Rope, SV2d, SV3d, SVModelTypes, SVRayTypes, SVSceneTypes; CastRays: DEFINITIONS = BEGIN Assembly: TYPE = SVSceneTypes.Assembly; BoundBox: TYPE = SVModelTypes.BoundBox; Camera: TYPE = SVModelTypes.Camera; Classification: TYPE = SVRayTypes.Classification; Color: TYPE = GraphicsColor.Color; Composite: TYPE = SVRayTypes.Composite; CoordSystem: TYPE = SVModelTypes.CoordSystem; LightSourceList: TYPE = SVModelTypes.LightSourceList; Matrix4by4: TYPE = SV3d.Matrix4by4; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = SV3d.Point3d; Primitive: TYPE = SVRayTypes.Primitive; Ray: TYPE = SVRayTypes.Ray; Vector: TYPE = SV3d.Vector; 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, outStream: IO.STREAM] RETURNS [success: BOOL]; <> DrawTreeWithStartLine: PROC [startLine: REAL, tree: CSGTree, lightSources: LightSourceList, camera: Camera, aisRope: Rope.ROPE, bAndWOnly: BOOL, notify: NotifyOfProgressProc _ NoOpNotifyOfProgress, clientData: REF ANY _ NIL, outStream: IO.STREAM] RETURNS [success: BOOL]; <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 [x, y: INTEGER, tree: CSGTree, lightSources: LightSourceList, camera: Camera, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL] RETURNS [color: Color]; <> SingleRay2: PROC [cameraPoint: Point2d, tree: CSGTree, camera: Camera, consolidate: BOOL _ TRUE, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL] RETURNS [class: Classification, rayWorld: Ray]; <> <> <<>> <> <<>> <> SortClassByPrimitive: PROC [class: Classification]; <> <<>> NthSurfacePointAndNormal: PROC [class: Classification, rayWorld: Ray, n: NAT] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector]; <> LastOfFirstPointAndNormal: PROC [class: Classification, rayWorld: Ray] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector]; <> LastTopLevelPointAndNormal: PROC [class: Classification, rayWorld: Ray, root: Assembly] RETURNS [surfacePtWorld: Point3d, normalWorld: Vector]; <> 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]; <> <> <<>> RayCast: PROC [cameraPoint: Point2d, worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL, indent: NAT _ 0] RETURNS [class: Classification]; <> RayCastBoundingSpheres: PROC [worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL, indent: NAT _ 0] RETURNS [class: Classification]; RayCastNoBBoxes: PROC [worldRay: Ray, node: REF ANY, consolidate: BOOL _ TRUE, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL, indent: NAT _ 0] RETURNS [class: Classification]; <> HitsTree: PROC [worldRay: Ray, tree: CSGTree] RETURNS [BOOL]; <> <<>> FirstHit: PROC [worldRay: Ray, tree: CSGTree, useBoundSpheres: BOOL, makeStream: BOOL _ FALSE, f: IO.STREAM _ NIL, 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, makeStream: BOOL, f: IO.STREAM, indent: NAT]; WriteStreamPrim: PROC [prim: Primitive, class: Classification, makeStream: BOOL, f: IO.STREAM, 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.