File: SVSceneToTree.mesa
Created July 17, 1984 10:26:46 am PDT
Last edited by Eric Bier on June 1, 1987 1:28:01 pm PDT
DIRECTORY
IO, SVModelTypes, SVSceneTypes;
SVSceneToTree: CEDAR DEFINITIONS =
BEGIN
Slice: TYPE = SVSceneTypes.Slice;
Camera: TYPE = SVModelTypes.Camera;
CoordSysList: TYPE = SVModelTypes.CoordSysList;
CSGTree: TYPE = SVSceneTypes.CSGTree;
Primitive: TYPE = SVSceneTypes.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 select slice parts, nor parts that are immediately connected to them.
PrimitiveFromAssembly: PROC [slice: Slice, scene: Scene, inverted, ignoreMoving: 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.