File: DisplayListToTree.mesa
Created July 17, 1984 10:26:46 am PDT
Last edited by Eric Bier on April 17, 1987 10:52:26 pm PDT
DIRECTORY
IO, SVModelTypes, SVRayTypes, SVSceneTypes;
DisplayListToTree: CEDAR DEFINITIONS =
BEGIN
Slice: TYPE = SVSceneTypes.Slice;
Camera: TYPE = SVModelTypes.Camera;
CoordSysList: TYPE = SVModelTypes.CoordSysList;
CSGTree: TYPE = SVRayTypes.CSGTree;
Primitive: TYPE = SVRayTypes.Primitive;
Scene: TYPE = SVSceneTypes.Scene;
CreateEmptyTree: PROC [] RETURNS [tree: CSGTree];
AssemblyToTree: PROC [assembly: Slice, scene: Scene, camera: Camera, oldTree: CSGTree ← NIL, ignoreMoving: BOOLFALSE] RETURNS [tree: CSGTree];
Computes bounding spheres and bounding boxes as needed. Opens AIS files for use with texture mapping. Reuses oldTree if it is provided. If ignoreMoving then the tree will not include assemblies that are selected.
PrimitiveFromAssembly: PROC [assem: Slice, inverted: BOOL] RETURNS [prim: Primitive];
PrimitiveAssemblyWithoutMO: ERROR;
CoordSysListFromScene: PROC [scene: Scene] RETURNS [csl: CoordSysList];
Returns a list of all of the assembly coordinate systems (not including the scalars-only shape coordinate systems). The list is in breadth-first order.
ListTree: PROC [outHandle: IO.STREAM, tree: CSGTree];
Prints a representation of the entire CSGTree onto the given stream.
CommonAncestor: PROC [red: Slice, blue: Slice, root: Slice] RETURNS [gramps: Slice];
red and blue must both be in the same tree. gramps will be the deepest node which contains both red and blue.
IsSuccessorOf: PROC [testChild: Slice, testAncestor: Slice] RETURNS [BOOL];
Returns TRUE if testChild is in the tree rooted at testAncestor, FALSE otherwise.
AncestorAtLevel: PROC [child: Slice, root: Slice, level: NAT] RETURNS [gramps: Slice];
Returns the ancestor of child which is level levels below root. If level is 0, should return root. If level = 1, an immediate child of root and so on.
END.