DIRECTORY CADTypes USING [Scad, VariableRec, VisibleMask], Rope USING [ROPE], ThreeDBasics USING [Context, RGB]; SurfaceViewer: CEDAR DEFINITIONS ~ BEGIN SurfaceRec: TYPE ~ RECORD [ scad: CADTypes.Scad, id: NAT, mask: REF CADTypes.VisibleMask]; SurfaceSeq: TYPE ~ RECORD [ surfaces: SEQUENCE length: NAT OF SurfaceRec]; SurfaceViewer: TYPE ~ RECORD [ context3d: REF ThreeDBasics.Context, surfaces: REF SurfaceSeq, numberOfSurfaces: NAT, nextID: NAT]; Error: ERROR[why: ATOM]; CreateSurfaceViewer: PROC[] RETURNS[sviewer: REF SurfaceViewer]; GetThreeDContext: PROC[sviewer: REF SurfaceViewer] RETURNS[context3d: REF ThreeDBasics.Context]; LoadSurface: PROC[surface: CADTypes.Scad, sviewer: REF SurfaceViewer] RETURNS[id: NAT]; MaskSurface: PROC[id: NAT, mask: REF CADTypes.VisibleMask, sviewer: REF SurfaceViewer]; HideSurface: PROC[id: NAT, sviewer: REF SurfaceViewer]; UnHideSurface: PROC[id: NAT, sviewer: REF SurfaceViewer]; DeleteSurface: PROC[id: NAT, sviewer: REF SurfaceViewer]; SetSurfaceRenderingMode: PROC[id: NAT, mode: ATOM, sviewer: REF SurfaceViewer, twoCellsOnly: BOOL _ TRUE]; SetSurfaceColor: PROC[id: NAT, color: ThreeDBasics.RGB, sviewer: REF SurfaceViewer, twoCellsOnly: BOOL _ TRUE]; FlushSurfaces: PROC[sviewer: REF SurfaceViewer]; DrawFrame: PROC [sviewer: REF SurfaceViewer]; InvokeRayTracer: PROC[variables: CADTypes.VariableRec, filename: Rope.ROPE, pixelsU, pixelsV: NAT, sviewer: REF SurfaceViewer]; END. ΒSurfaceViewer.mesa James Rauen, August 20, 1986 6:00:37 pm PDT Last edited by: James Rauen January 13, 1988 4:15:12 pm PST Geometry3dVector USING [Triple], Type declarations Raised when something goes wrong. Possibilities are $AllFilledUp (tried to load too many surfaces), or $InvalidID (referred to a surface that doesn't exist). Opens a color viewer and instantiates its 3D context. Position, orientation, and scope will default. Draws a frame. Returns sviewer's ThreeDWorld context. This context is needed for all ThreeDWorld operations involving the sviewer. Among other things, it has a slot containing the sviewer's actual color viewer. Loads a surface into the SurfaceViewer context and draws a new frame. Returns an ID number for the surface, which is used to refer to the surface after it has been added. If there is no more room, raises Error[$AllFilledUp]. Masks cells in the surface indicated by id. The mask specifies which cells in the CAD should be displayed and which shouldn't. If id does not refer to a surface, raises Error[$InvalidID]. Hides the surface indicated by id and draws a new frame. If id does not refer to a surface, raises Error[$InvalidID]. Unhides the surface indicated by id and draws a new frame. If id does not refer to a surface, raises Error[$InvalidID]. Removes a surface from the SurfaceViewer context and draws a new frame. If id does not refer to a surface, raises Error[$InvalidID]. Sets the rendering mode of the surface indicated by id and draws a new frame. Mode is one of $Lines, $Faceted, $Smooth, $HiddenLines, $NormaledLines, $ShadedLines. If id does not refer to a surface, raises Error[$InvalidID]. If mode is not a valid mode, raises Error[$InvalidRenderingMode]. If twoCellsOnly is true, then only 2-cells are affected. Sets the color of the surface indicated by id and draws a new frame. If id does not refer to a surface, raises Error[$InvalidID] Removes all surfaces from the SurfaceViewer context and draws a new (blank) frame. Moves the light source to the eyepoint and redraws in the color viewer.. Calls SurfaceTracer to generate a ray-traced image of the current view in the SurfaceViewer context. The image is written as three AIS files. ΚΦ˜™>Icode™;—J˜šΟk ˜ Kšœ œ"˜0Kšœœ ™ Kšœœœ˜Kšœ œ œ˜"K˜—K˜šΠln œœ œ˜(K™™šœ œœ˜K˜Kšœœ˜Kšœœ˜ —šœ œœ˜Kšœ œ œœ ˜.—šœœœ˜Kšœ œ˜$Kšœ œ ˜Kšœœ˜Kšœœ˜ ——K˜šΟnœœœ˜Kšœž™ž—K˜šŸœœœ œ˜@K™uK™—š Ÿœœ œœ œ˜`K™ΕK™—š Ÿ œœ"œœœ˜WK™γK™—š Ÿ œœœœ œ˜WKšœ½™½K™—šŸ œœœ œ˜7Kšœv™vK™—šŸ œœœ œ˜9Kšœx™xK™—šŸ œœœ œ˜9Kšœ…™…K™—šŸœœœœ œœœ˜jKšœί™ίK™—šŸœœœœ œœœ˜oKšœ™K™—šŸ œœ œ˜0K™RK™—šŸ œœ œ˜-K™IK™—š Ÿœœ1œœ œ˜KšœŽ™ŽK˜K˜——Kšœ˜—…—’: