<> <> <> DIRECTORY Atom USING [PropList], Rope USING [ROPE], IO USING [STREAM], Vector2 USING [VEC], ScanConvert USING [RealSequence], Linear3d USING [Triple, Quad], ThreeDScenes USING [AllOut, ClipState, Context, NoneOut, OutCode, ShapeInstance, ShapeSequence, Vertex, VertexInfo]; ThreeDPolygons: CEDAR DEFINITIONS ~ BEGIN <> ThreeDPolygonsError: SIGNAL [reason: ATOM]; Pair: TYPE ~ Vector2.VEC; -- [ x, y: REAL]; Triple: TYPE ~ Linear3d.Triple; -- [ x, y, z: REAL]; Quad: TYPE ~ Linear3d.Quad; -- [ x, y, z, w: REAL]; RealSequence: TYPE ~ ScanConvert.RealSequence; OutCode: TYPE ~ ThreeDScenes.OutCode; NoneOut: OutCode ~ ThreeDScenes.NoneOut; AllOut: OutCode ~ ThreeDScenes.AllOut; <> Vertex: TYPE ~ ThreeDScenes.Vertex; VertexInfo: TYPE ~ ThreeDScenes.VertexInfo; <> Polygon: TYPE ~ RECORD[nVtces: NAT, clipState: ClipState, props: Atom.PropList, vtx: SEQUENCE length: NAT OF VertexInfo]; PolygonSequence: TYPE ~ RECORD [SEQUENCE length: NAT OF REF Polygon]; PtrPoly: TYPE ~ RECORD[nVtces: NAT, clipState: ClipState, props: Atom.PropList, vtxPtr: SEQUENCE length: NAT OF NAT]; PtrPolySequence: TYPE ~ RECORD[SEQUENCE length: NAT OF REF PtrPoly]; ShapePolygon: TYPE ~ RECORD[shape: REF ShapeInstance, polygon, next: NAT]; SortSequence: TYPE ~ RECORD[SEQUENCE length: NAT OF ShapePolygon]; <> ClipState: TYPE ~ ThreeDScenes.ClipState; ShapeInstance: TYPE ~ ThreeDScenes.ShapeInstance; <> EnableDisplay: PROC []; StopDisplay: PROC []; <> LoadShape: PROC[shape: REF ShapeInstance, fileName: Rope.ROPE, type: ATOM _ $Polyhedron]; ReadPolygons: PROC[shape: REF ShapeInstance, in: IO.STREAM, nPolys: NAT]; GetPolygonColors: PROC[shape: REF ShapeInstance, fileName: Rope.ROPE]; <> ClipPoly: PROC[ context: REF ThreeDScenes.Context, shape: REF ShapeInstance, poly, poly2: REF Polygon] RETURNS [REF Polygon, REF Polygon]; <> BackFacing: PROC[ poly: REF Polygon] RETURNS [BOOLEAN]; ShadePoly: PROC[ context: REF ThreeDScenes.Context, poly: REF Polygon]; GetShades: PROC[context: REF ThreeDScenes.Context, shape: REF ShapeInstance]; GetPolyNormals: PROC[shape: REF ShapeInstance]; GetVtxNormals: PROC[shape: REF ShapeInstance]; <> << This builds a back-to-front ordered sequence of polygon references>> LoadSortSequence: PROC[ context: REF ThreeDScenes.Context, buckets: REF ThreeDPolygons.SortSequence _ NIL ] RETURNS[REF SortSequence]; <> DoBackToFront: PROC[ context: REF ThreeDScenes.Context, sortSeq: REF SortSequence, action: PROC[ShapePolygon]]; DoFrontToBack: PROC[ context: REF ThreeDScenes.Context, sortSeq: REF SortSequence, action: PROC[ShapePolygon]]; DoForPolygons: PROC[set: REF ThreeDScenes.ShapeSequence, action1: PROC[ShapePolygon], action2: PROC[REF ThreeDScenes.ShapeInstance]]; ShowObjects: PROC[ context: REF ThreeDScenes.Context, frontToBack: BOOLEAN _ FALSE ]; ShowWireFrameObjects: PROC[context: REF ThreeDScenes.Context]; <> OutputLines: PROC[context: REF ThreeDScenes.Context, p: ShapePolygon]; OutputPoly: PROC[context: REF ThreeDScenes.Context, p: ShapePolygon]; END.