File: SVRayTypes.mesa
Created July 29, 1984 3:16:53 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Bier on March 26, 1987 3:37:44 pm PST
DIRECTORY
Imager, Rope, SV2d, SV3d, SVBasicTypes, SVModelTypes;
SVRayTypes: CEDAR DEFINITIONS =
BEGIN
Artwork: TYPE = SVModelTypes.Artwork;
BoundBox: TYPE = SVBasicTypes.BoundBox;
BoundHedron: TYPE = SVBasicTypes.BoundHedron;
BoundSphere: TYPE = SVBasicTypes.BoundSphere;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Point2d: TYPE = SV2d.Point2d;
Vector3d: TYPE = SV3d.Vector3d;
Types of Ray casting procedures.
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];
RayCastBoundingSpheresProc: TYPE = PROC [localRay: Ray, masterObject: REF ANY, prim: Primitive] RETURNS [class: Classification];
Surface: TYPE = REF ANY; -- may be RectSurface, TubeSurface, DiskSurface, ShellSurface...
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 Vector3d;
SurfaceArray: TYPE = REF SurfaceArrayObj;
SurfaceArrayObj: TYPE = ARRAY [1..maxSceneDepth] OF Surface;
PrimitiveArray: TYPE = ARRAY [1..maxSceneDepth] OF Primitive;
Remember to update DisplayListToTree.PrimitiveFromAssembly if this definition changes.
Primitive: TYPE = REF PrimitiveObj;
PrimitiveObj:
TYPE =
RECORD [
name: Rope.ROPE,
artwork: Artwork,
ignoreMe: BOOL ← FALSE,
featureData: REF ANY,
assembly: REF ANY, -- a DisplayList3d.Slice. REF ANY avoids compilation dependencies.
mo: REF ANY, -- should be MasterObject but oh the compilation dependencies!
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,
Ray: TYPE = REF RayObj;
RayObj: TYPE; -- see CSGImpl for the read record
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];
SearchDepth: TYPE = {first, lastOfFirst, last, lastOfLevel1};