DIRECTORY Imager USING [ Rectangle], ShapeUtilities USING [ ShapePatch ], G3dRender USING [ Context, ContextProc, Patch, PatchProc, PtrPatch, ShapeInstance, ShapeProc, ShapeSequence, Triple ]; SurfaceRender: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ G3dRender.Context; ContextProc: TYPE ~ G3dRender.ContextProc; Triple: TYPE ~ G3dRender.Triple; Patch: TYPE ~ G3dRender.Patch; PtrPatch: TYPE ~ G3dRender.PtrPatch; PatchProc: TYPE ~ G3dRender.PatchProc; ShapePatch: TYPE ~ ShapeUtilities.ShapePatch; ShapeInstance: TYPE ~ G3dRender.ShapeInstance; ShapeProc: TYPE ~ G3dRender.ShapeProc; ShapeSequence: TYPE ~ G3dRender.ShapeSequence; FlushLog: PROC [context: REF Context]; GetPtrPatchClipState: PROC[ shape: REF ShapeInstance, patch: REF PtrPatch]; ValidateContext: PROC[ context: REF Context ]; ValidateDisplay: PROC[ context: REF Context ]; ValidateView: PROC[ context: REF Context ]; ValidateShape: ShapeProc; ValidatePolyhedron: ShapeProc; ValidateRopeShape: ShapeProc; GetBoundingSphere: PROC[shape: REF ShapeInstance]; SetView: PROC[context: REF Context, eyePoint, ptOfInterest: Triple, fieldOfView: REAL _40.0, rollAngle: REAL _ 0.0, upDirection: Triple _ [ 0., 0., 1.], hitherLimit: REAL _ .01, yonLimit: REAL _ 1000.0]; SetEyeSpace: PROC[ context: REF Context ]; WindowFromViewPort: PROC[context: REF Context] RETURNS[REF Imager.Rectangle]; LoadPrioritySequence: PROC[context: REF Context, sortOrder: LIST OF REF ANY _ NIL] RETURNS[LIST OF REF ANY, CARDINAL]; LoadDepthSequence: PROC[context: REF Context, sortOrder: LIST OF REF ANY _ NIL] RETURNS[LIST OF REF ANY, CARDINAL]; DoBackToFront: PROC[ context: REF Context, sortInfo: LIST OF REF ANY, action: PROC[REF ShapePatch]]; DoFrontToBack: PROC[ context: REF Context, sortInfo: LIST OF REF ANY, action: PROC[REF ShapePatch]]; DoForPatches: PROC[context: REF Context, set: REF ShapeSequence, patchAction: PROC[REF ShapePatch], shapeAction: PROC[REF ShapeInstance]]; CombineBoxes: PROC[context: REF Context]; ShowObjects: PROC[ context: REF Context, frontToBack: BOOLEAN _ FALSE ]; OutputPolygon: PatchProc; RopeDisplay: PatchProc; MakeFrame: ContextProc; ShowShapes: ContextProc; END. VSurfaceRender.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, April 11, 1989 11:28:54 am 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 the following. Returns FALSE if clipped out or otherwise not displayable Builds new matrices, color values, etc. reflecting changes or for initialization. Sets view parameters and builds new eyespace matrix 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. Κ˜Iheadšœ™šœ Οmœ1™