DIRECTORY Imager, G3dRender; G3dSortandDisplay: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ G3dRender.Context; ContextProc: TYPE ~ G3dRender.ContextProc; Triple: TYPE ~ G3dRender.Triple; Patch: TYPE ~ G3dRender.Patch; PatchProc: TYPE ~ G3dRender.PatchProc; Shape: TYPE ~ G3dRender.Shape; ShapeProc: TYPE ~ G3dRender.ShapeProc; ShapeSequence: TYPE ~ G3dRender.ShapeSequence; FacingDir: TYPE ~ G3dRender.FacingDir; SortRecord: TYPE ~ RECORD [ patch: REF Patch, -- ref to patch description next, prev: INT, -- forward and backward links in bucket chain dir: FacingDir -- patch backfacing? ]; SortSequence: TYPE ~ REF SortSequenceRep; SortSequenceRep: TYPE ~ RECORD [SEQUENCE length: CARDINAL OF REF SortRecord]; LORA: TYPE ~ LIST OF REF ANY; FlushLog: PROC [context: Context]; GetPtrPatchClipState: PROC [shape: Shape, patch: REF Patch]; ValidateContext: PROC [context: Context]; ValidateDisplay: PROC [context: Context]; ValidateView: PROC [context: Context]; ValidateShape: ShapeProc; ValidatePolyhedron: ShapeProc; DummyValidate: ShapeProc; SetEyeSpace: PROC [context: Context]; WindowFromViewPort: PROC [context: Context] RETURNS [REF Imager.Rectangle]; LoadPrioritySequence: PROC [context: Context, sortOrder: LORA _ NIL] RETURNS [LORA, CARDINAL]; LoadDepthSequence: PROC [context: Context, sortOrder: LORA _ NIL] RETURNS [LORA, CARDINAL]; DoBackToFront: PROC [context: Context, sortInfo: LORA, action: PROC [REF Patch]]; DoFrontToBack: PROC [context: Context, sortInfo: LORA, action: PROC [REF Patch]]; DoForPatches: PROC [ context: Context, set: ShapeSequence, patchAction: PROC [REF Patch], shapeAction: PROC [Shape]]; CombineBoxes: PROC [context: Context]; ShowObjects: PROC [context: Context, frontToBack: BOOL _ FALSE]; OutputPolygon: PatchProc; RopeDisplay: PatchProc; MakeFrame: ContextProc; ShowShapes: ContextProc; END. *G3dSortandDisplay.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, July 17, 1989 1:44:03 pm PDT Definitions Utility Procedures Flush log buffers for safety (in case of crashes, etc.). Procedures for Updating Context Updates all aspects of context (seen individually below), incorporates changes since last call. Updates display to react to changes to viewer or initialize new display. Makes new matrices for initialization or changed viewing parameters, etc. Check that position and other info up to date. Calls type-specific routine such as following. Returns FALSE if clipped out or otherwise not displayable. Builds new matrices, color values, etc. reflecting changes or for initialization. Builds new eyespace matrix. Fits window to shape of viewport. Procedures for Sorting and Display This builds a priority-ordered sequence of patch references, splitting polygons where needed. This builds a depth-ordered sequence of patch references. Does action for each patch in sorted sequence running through sequence backward. Does action for each patch in order in sorted sequence. Does action for each patch in order encountered in context. finds bounding box for all object's bounding boxes in scene (for speedups in matting). Displays entire context. Displays a single polygon, handling differing rendering modes, backfacing cull, clipping. Frame Generation and Animation Makes new image from context, clears frame first, adds background, etc. Makes image without clearing frame, for compositing contexts, etc. Κ―˜™Jšœ Οmœ1™