DIRECTORY Draw2d, G3dMatrix, Imager, G3dOctree; G3dCubeDraw: CEDAR DEFINITIONS ~ BEGIN DrawType: TYPE ~ Draw2d.DrawType; Matrix: TYPE ~ G3dMatrix.Matrix; Viewport: TYPE ~ G3dMatrix.Viewport; Cube: TYPE ~ G3dOctree.Cube; Direction: TYPE ~ G3dOctree.Direction; DirectionPairs: TYPE ~ G3dOctree.DirectionPairs; Face: TYPE ~ G3dOctree.Face; Neighborhood: TYPE ~ G3dOctree.Neighborhood; OctantPairs: TYPE ~ G3dOctree.OctantPairs; Context: TYPE ~ Imager.Context; TransformDirections: PROC [cube: Cube, view: Matrix, viewport: Viewport ¬ []] RETURNS [DirectionPairs]; TransformOctants: PROC [cube: Cube, view: Matrix, viewport: Viewport ¬ []] RETURNS [OctantPairs]; TerminalCubes: PROC [ context: Context, cube: Cube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ dashed]; RecursiveCubes: PROC [ context: Context, cube: Cube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ dashed, terminalCenters: BOOL ¬ TRUE]; SimpleCube: PROC [ context: Context, cube: Cube, view: Matrix, viewport: Viewport ¬ [], optimize: BOOL ¬ FALSE, drawType: DrawType ¬ dashed]; SimpleCubeFromPairs: PROC [ context: Context, pairs: OctantPairs, cube: Cube ¬ NIL, drawType: DrawType ¬ dashed]; FaceOnly: PROC [ context: Context, cube: Cube, face: Face, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ dashed]; FancyCube: PROC [ context: Context, cube: Cube, view: Matrix, viewport: Viewport ¬ [], label: BOOL ¬ TRUE, markKids: BOOL ¬ FALSE]; FancyCubeFromPairs: PROC [ context: Context, pairs: DirectionPairs, cornerConnect: DrawType ¬ solid, edgeConnect: DrawType ¬ dashed, faceConnect: DrawType ¬ dotted, label: BOOL ¬ TRUE]; Neighbors: PROC [ context: Context, neighborhood: Neighborhood, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ dashed]; HLEOctree: PROC [context: Context, root: Cube, view: Matrix, viewport: Viewport ¬ []]; LabelCube: PROC [ context: Context, cube: Cube, direction: Direction, view: Matrix, viewport: Viewport ¬ []]; LabelDirections: PROC [context: Context, pairs: DirectionPairs]; LabelOctants: PROC [context: Context, pairs: OctantPairs]; CubeCenter: PROC [context: Context, cube: Cube, view: Matrix, viewport: Viewport ¬ []]; END. r G3dCubeDraw.mesa Copyright Σ 1985, 1992 by Xerox Corporation. All rights reserved. Bloomenthal, July 15, 1992 11:07 pm PDT Transforming Points Transform the cube center and its 26 surrounding points. Transform the eight cube corners. Drawing Face/Cube/Neighborhood Draw all terminal cubes descended from cube. Draw cube and all its defined subcubes; if edges, draw edges as solid lines, if terminalCenters, mark centers of the terminal cubes. Draw the edges of cube; if optimize, don't draw those edges normally drawn by neighbors. Draw the edges of cube given its transformed corners; if cube is non-NIL, optimizes drawing by not drawing edges normally drawn by neighbors. Draw the specified face of the cube. Draw the edges of cube with solid lines and the edges of its octants with dashed lines. If markKids, then place a mark at the center of each of the non-nil kid octants. Draw the edges of cube with solid lines and the edges of its octants with dashed lines. Draw the neighborhood, using a primitive (inaccurate) form of hidden line removal. Drawing Surfaces with Hidden Lines Eliminated Draw the octree with hidden faces removed, the implicit . Labelling Label the center of cube according to direction. Label the pairs (8 corners, 6 faces, 1 center, and 12 edges). Label the pairs at the octant corners. Marking Mark the center of a cube with a pixel-sized dot. ΚU•NewlineDelimiter –"cedarcode" style™™Jšœ Οeœ6™BJ™'J˜JšΟk œ&˜/J˜—šΠbl œžœž ˜J˜—šœž˜J˜Jšœ žœ˜"Jšœžœ˜"Jšœ žœ˜&Jšœžœ˜Jšœ žœ˜(Jšœžœ˜0Jšœžœ˜Jšœžœ˜,Jšœ žœ˜+Jšœ žœ˜!—headšΟl™šΟnœžœ4˜NJšžœ˜J™8J™—š‘œžœ4˜KJšžœ˜J™!——š ™š‘ œžœ˜J˜J˜ J˜ J˜J˜J™,J™—š‘œžœ˜J˜J˜ J˜ J˜J˜Jšœžœžœ˜J™'J™\J™—š‘ œžœ˜J˜J˜ J˜ J˜Jšœ žœžœ˜J˜J™XJ™—š‘œžœ˜J˜J˜Jšœ žœ˜J˜J™5J™WJ™—š‘œžœ˜J˜J˜ J˜ J˜ J˜J˜J™$J™—š‘ œžœ˜J˜J˜ J˜ J˜Jšœžœžœ˜Jšœ žœžœ˜J™WJ™PJ™—š‘œžœ˜J˜J˜J˜ J˜J˜Jšœžœžœ˜J™WJ™—š‘ œžœ˜J˜J˜J˜ J˜J˜J™R——š -™-š‘ œžœG˜VJ™9——š  ™ š‘ œžœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ ˜ J˜J™0J™—š‘œžœ+˜AJ™=J™—š‘ œžœ(˜;J™&——š ™š‘ œžœG˜XJ™1—J™—šžœ˜J˜—J˜—…—€k