<<>> <> <> <> <> DIRECTORY Atom, G2dBasic, G3dBasic, G3dMatrix, G3dQuaternion, IO, Rope; G3dShape: CEDAR DEFINITIONS ~ BEGIN <> Error: SIGNAL [code: ATOM, reason: ROPE]; <> PropList: TYPE ~ Atom.PropList; Box2d: TYPE ~ G2dBasic.Box; IntegerPair: TYPE ~ G2dBasic.IntegerPair; Box3d: TYPE ~ G3dBasic.Box; NatSequence: TYPE ~ G3dBasic.NatSequence; Pair: TYPE ~ G3dBasic.Pair; PairSequence: TYPE ~ G3dBasic.PairSequence; Quad: TYPE ~ G3dBasic.Quad; Ray: TYPE ~ G3dBasic.Ray; RealSequence: TYPE ~ G3dBasic.RealSequence; Screen: TYPE ~ G3dBasic.Screen; Sphere: TYPE ~ G3dBasic.Sphere; SurfaceSequence: TYPE ~ G3dBasic.SurfaceSequence; Triple: TYPE ~ G3dBasic.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; Matrix: TYPE ~ G3dMatrix.Matrix; Viewport: TYPE ~ G3dMatrix.Viewport; Quaternion: TYPE ~ G3dQuaternion.Quaternion; STREAM: TYPE ~ IO.STREAM; ROPE: TYPE ~ Rope.ROPE; zAxis: Ray ~ [[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]]; <> Shape: TYPE ~ REF ShapeRep; ShapeRep: TYPE ~ RECORD [ <> renderData: REF ¬ NIL, -- rendering params/procs, (see G3dRender) modelData: REF ¬ NIL, -- modeling parameters (see G3dModel) hierarchyData: REF ¬ NIL, -- node within hierarchy (see G3dTimeTrees) clientData: REF ¬ NIL, -- data for a client <> name: ROPE ¬ NIL, -- local shape name (allows instancing) fileName: ROPE ¬ NIL, -- file name props: PropList ¬ NIL, -- for extensibility <> centroid: Triple ¬ [], -- vertex average scale: REAL ¬ 1.0, -- scale of the object translation: Triple ¬ [], -- within a scene orientation: Quaternion ¬ [], -- rotation (degrees) about an axis rotationBase: Triple ¬ [], -- origin point of axis of rotation matrix: Matrix ¬ NIL, -- within world space; presumed always valid <> visible: BOOL ¬ TRUE, -- display shape or not? centroidValid: BOOL ¬ FALSE, -- centroid computed? renderValid: BOOL ¬ FALSE, -- are vertex normals, etc. valid? showBackfaces: BOOL ¬ FALSE, -- if back facing polygons to be displayed triangulated: BOOL ¬ FALSE, -- all surfaces are three-sided normalsNegated: BOOL ¬ FALSE, -- if file vertex normals negated surfacesReversed: BOOL ¬ FALSE, -- if file surfaces order reversed verticesIsolated: BOOL ¬ FALSE, -- if vertices have been isolated <> selected: BOOL ¬ FALSE, -- true if chosen <> sphereExtent: Sphere ¬ [], -- center and radius of bounding sphere objectExtent: Box3d ¬ [], -- 3d bounds <> vertices: VertexSequence ¬ NIL, -- vertices used by the renderer <> type: ATOM ¬ $ConvexPolygon, -- patches, polygons, or other faces: FaceSequence ¬ NIL, -- polygon normals, colors, and transmittances surfaces: SurfaceSequence ¬ NIL, -- vertex connectivity (polygons or patches) <> edges: EdgeSequence ¬ NIL -- for fast line drawing and other operations ]; <<>> Validity: TYPE ~ {normal, color, texture, transmit, center}; ShapeSequence: TYPE ~ REF ShapeSequenceRep; ShapeSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Shape ]; ShapeProc: TYPE ~ PROC [shape: Shape] RETURNS [continue: BOOL ¬ TRUE]; SurfaceProc: TYPE ~ PROC [surface: NatSequence, index: INTEGER] RETURNS [continue: BOOL ¬ TRUE]; <> Vertex: TYPE ~ REF VertexRep; VertexRep: TYPE ~ RECORD [ -- 31 words point: Triple ¬ [], -- 6 words: location of vertex normal: Triple ¬ [], -- 6 words: surface normal color: Triple ¬ [1, 1, 1], -- 6 words: color of surface texture: Pair ¬ [0.0, 0.0], -- 4 words: texture coordinates transmittance: REAL ¬ 1.0, -- 2 words: transmittance of surface ref: REF ¬ NIL -- 2 words: client data ]; <> <> VertexSequence: TYPE ~ REF VertexSequenceRep; VertexSequenceRep: TYPE ~ RECORD [ valid: ARRAY Validity OF BOOL ¬ ALL[FALSE], length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Vertex ]; VertexProc: TYPE ~ PROC [vertex: Vertex, index: INTEGER] RETURNS [continue: BOOL ¬ TRUE]; <> ScreenSequence: TYPE ~ REF ScreenSequenceRep; ScreenSequenceRep: TYPE ~ RECORD [ screensValid: BOOL ¬ FALSE, extentValid: BOOL ¬ FALSE, extent: Box2d ¬ [[0, 0], [0, 0]], -- 2d bounds (depends on view, device) length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Screen ]; <> Face: TYPE ~ REF FaceRep; FaceRep: TYPE ~ RECORD [ -- 22 words normal: Triple ¬ [], -- 6 words: surface normal center: Triple ¬ [], -- 6 words: center of surface color: Triple ¬ [1, 1, 1], -- 6 words: color of surface transmittance: REAL ¬ 1.0, -- 2 words: transmittance of surface fwdFacing: BOOL ¬ FALSE, -- 1 bit: is this face forward facing? ref: REF ¬ NIL -- 2 words: client data ]; FaceSequence: TYPE ~ REF FaceSequenceRep; FaceSequenceRep: TYPE ~ RECORD [ valid: ARRAY Validity OF BOOL ¬ ALL[FALSE], length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Face ]; <> Edge: TYPE ~ REF EdgeRep; EdgeRep: TYPE ~ RECORD [ v0, v1: INTEGER ¬ -1, -- vertex indices, v0 < v1 p0, p1: INTEGER ¬ -1 -- polygon indices ]; <<>> EdgeSequence: TYPE ~ REF EdgeSequenceRep; EdgeSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Edge ]; <> <> ShapeFromFile: PROC [fileName: ROPE] RETURNS [Shape]; <> <<>> ShapeFromStream: PUBLIC PROC [stream: STREAM] RETURNS [Shape]; <> ShapeToFile: PROC [ fileName: ROPE, shape: Shape, index: BOOL ¬ FALSE, tallyOnPolys: BOOL ¬ FALSE, comment: ROPE ¬ NIL]; <> <> <> <<>> ShapeToStream: PROC [ shape: Shape, out: STREAM, index: BOOL ¬ FALSE, tallyOnPolys: BOOL ¬ FALSE]; <> <> <<>> ShapeToStreamPerFormat: PROC [shape: Shape, out: STREAM, format: ATOM] RETURNS [success: BOOL]; <> <> <> ShapeFromData: PROC [ name: ROPE ¬ NIL, surfaces: SurfaceSequence, vertices: TripleSequence, normals: TripleSequence ¬ NIL, colors: TripleSequence ¬ NIL, transmittances: RealSequence ¬ NIL, textures: PairSequence ¬ NIL, showBackfaces: BOOL ¬ TRUE, faceted: BOOL ¬ FALSE, type: ATOM ¬ $ConvexPolygon] RETURNS [Shape]; <> <> <> CopyShape: PROC [shape: Shape] RETURNS [Shape]; <> <<>> CombineShapes: PROC [shape1, shape2: Shape] RETURNS [Shape]; <> <> <> ComputeMatrix: PROC [shape: Shape]; <> <<>> SetMatrix: PROC [shape: Shape, matrix: Matrix]; <> <<>> TransformShape: PROC [ shape: Shape, translate: Triple ¬ [], axis: Ray ¬ zAxis, rotation: REAL ¬ 0, scale: REAL ¬ 1.0, concat: BOOL ¬ FALSE]; <> <> <> <> <> <<>> TransformVertices: PROC [shape: Shape, matrix: Matrix]; <> <<>> ApplyTransformsToShape: PUBLIC PROC [shape: Shape]; <> <> <> DoWithVertices: PROC [shape: Shape, vertexProc: VertexProc]; <> <<>> VertexValid: PROC [shape: Shape, test: Validity] RETURNS [BOOL]; <> <<>> SetVertexNormals: PROC [shape: Shape]; <> <> SetFwdFacingVertices: PROC [shape: Shape, view: Matrix, screens: ScreenSequence]; <> <> <<>> UnitizeVertexNormals: PROC [shape: Shape]; <> <<>> NegateVertexNormals: PROC [shape: Shape]; <> <<>> NumberOfVertices: PROC [shapes: ShapeSequence] RETURNS [INTEGER]; <> <<>> SetExtent: PROC [screens: ScreenSequence]; <> <<>> InterpolateVertex: PROC [t: REAL, v0, v1: Vertex] RETURNS [v: Vertex]; <> <> <> DoWithAllPolygons: PROC [shape: Shape, action: SurfaceProc]; <> <<>> DoWithFacingPolygons: PROC [ shape: Shape, view: Matrix, frontFacingAction, backFacingAction: SurfaceProc ¬ NIL]; <> <> <<>> FaceValid: PROC [shape: Shape, test: Validity] RETURNS [BOOL]; <> <<>> SetFwdFacingFaces: PROC [shape: Shape, view: Matrix]; <> <<>> GetPolygonPoints: PROC [shape: Shape, nPoly: INTEGER, points: TripleSequence ¬ NIL] RETURNS [TripleSequence]; <> <<>> SetFaceNormals: PROC [shape: Shape, complyWithVertices: BOOL ¬ TRUE]; <> <> <> <<>> SetFaceCenters: PROC [shape: Shape]; <> <<>> UnitizeFaceNormals: PROC [shape: Shape]; <> <<>> ReversePolygons: PROC [shape: Shape]; <> <<>> NegateFaceNormals: PROC [shape: Shape]; <> <<>> Triangulate: PROC [shape: Shape]; <> <<>> NumberOfPolygons: PROC [shapes: ShapeSequence] RETURNS [INTEGER]; <> <> MakeEdges: PROC [shape: Shape] RETURNS [EdgeSequence]; <> <<>> FindEdge: PROC [edges: EdgeSequence, v0, v1: INTEGER] RETURNS [index: INT]; <> <> <> ObjectScale: PROC [shape: Shape] RETURNS [REAL]; <> <<>> PointsFromShape: PROC [shape: Shape, points: TripleSequence ¬ NIL] RETURNS [TripleSequence]; <> FindShape: PROC [shapes: ShapeSequence, shapeName: ROPE] RETURNS [Shape]; <> <<>> SetTextureCoords: PROC [shape: Shape, textures: PairSequence]; <> <> BoundingBox: PROC [shape: Shape] RETURNS [Box3d]; <> <<>> BoundingSphere: PROC [shape: Shape] RETURNS [Sphere]; <> <> CopyShapeSequence: PROC [shapes: ShapeSequence] RETURNS [ShapeSequence]; <> <<>> AddToShapeSequence: PROC [shapes: ShapeSequence, shape: Shape] RETURNS [ShapeSequence]; <> <<>> LengthenShapeSequence: PROC [shapes: ShapeSequence, amount: REAL ¬ 1.3] RETURNS [ShapeSequence]; <> CopyVertexSequence: PROC [vertices: VertexSequence] RETURNS [VertexSequence]; <> <<>> AddToVertexSequence: PROC [vertices: VertexSequence, vertex: Vertex] RETURNS [VertexSequence]; <> <<>> LengthenVertexSequence: PROC [vertices: VertexSequence, amount: REAL ¬ 1.3] RETURNS [VertexSequence]; <> <<>> CopyFaceSequence: PROC [faces: FaceSequence] RETURNS [FaceSequence]; <> AddToFaceSequence: PROC [faces: FaceSequence, face: Face] RETURNS [FaceSequence]; <> <<>> LengthenFaceSequence: PROC [faces: FaceSequence, amount: REAL ¬ 1.3] RETURNS [FaceSequence]; <> END.