-- File: Preprocess3d.mesa
-- Last edited by Bier on December 18, 1982 1:24 am
-- Author: Eric Bier before December 7, 1982 9:34 pm
-- Contents: File CSGImpl.mesa overflowed storage so I will put the preprocessing phases of ray casting in this interface. Preprocessing may include calculation transforms and their inverses, bounding boxes, unit rays in each instance coordinate system, and so forth.

DIRECTORY
 CoordSys,
CSG,
 CSGGraphics,
 Map,
 SVBoundBox;

Preprocess3d: DEFINITIONS =
BEGIN

BoundBox: TYPE = SVBoundBox.BoundBox;
Camera: TYPE = CSGGraphics.Camera;
CoordSystem: TYPE = CoordSys.CoordSystem;
CSGTree: TYPE = REF CSGTreeObj;
CSGTreeObj: TYPE = CSG.CSGTreeObj;

Preprocess: PROC [tree: CSGTree, camera: Camera] RETURNS [bb: BoundBox];
-- before doing anything with a CSG tree, do this. This calculates all of the bounding boxes and opens all of the artworks in preparation for ray tracing.
SetCurrentRayInPrimitives: PROC [node: REF ANY];
-- do this before each row of ray casting
FindRayStepXInPrimitives: PROC [node: REF ANY];
-- do this before casting any rays so that we only have to do it once. Sets up the csg structure so you can cast rays at them.

GetGlobalTable: PROC RETURNS [Map.ColorTable];
SetUpColorMap: PROC;

END.