File: TFI3d.mesa (text file in for 3d)
Last edited by Bier on July 17, 1987 12:46:42 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: convenience functions for parsing low-level parts of a 3d fileout produced by fileout3d.mesa
DIRECTORY
AtomButtonsTypes, Imager, IO, Rope, SV2d, SV3d, SVModelTypes, SVSceneTypes, ViewerClasses;
TFI3d: CEDAR DEFINITIONS =
BEGIN
Color: TYPE = Imager.Color;
Artwork: TYPE = SVModelTypes.Artwork;
CoordSysList: TYPE = SVModelTypes.CoordSysList;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
DrawStyle: TYPE = SVModelTypes.DrawStyle;
FeedbackData: TYPE = AtomButtonsTypes.FeedbackData;
FileCamera: TYPE = SVSceneTypes.FileCamera;
FrameBox: TYPE = SVModelTypes.FrameBox;
Material: TYPE = SVModelTypes.Material;
Matrix3by3: TYPE = SV2d.Matrix3by3;
Matrix4by4: TYPE = SV3d.Matrix4by4;
OMap: TYPE = SVModelTypes.OMap;
Plane: TYPE = SV3d.Plane;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Scene: TYPE = SVSceneTypes.Scene;
Slice: TYPE = SVSceneTypes.Slice;
SMap: TYPE = SVModelTypes.SMap;
Viewer: TYPE = ViewerClasses.Viewer;
FileinMatrix: PROC [f: IO.STREAM] RETURNS [mat: Matrix4by4];
FileinMatrix3by3: PROC [f: IO.STREAM] RETURNS [mat: Matrix3by3];
RopeNotOnTop: SIGNAL [position: NAT, wasThere: Rope.ROPE, notThere: Rope.ROPE];
Reads in one character from f. Complains if it is not c.
Signals RopeNotOnTop if some other char is on top.
ReadReturn: PROC [f: IO.STREAM];
Convenience function. Equivalent to ReadChar[f, IO.CR];
ReadKeyWord: PROC [f: IO.STREAM] RETURNS [keyWord: Rope.ROPE, good: BOOL];
Reads a rope until a ':' or <CR> are encountered. If CR is encountered first, then good is FALSE since ":" is expected after a keyword.
Reads a rope UNTIL <CR> is encountered. Used to read Solidviews version rope.
The <CR> character is tossed out.
A convenience function. Equivalent to ReadBlank[f]; n ← ReadNAT[f];
ReadPoint3d: PROC [f: IO.STREAM] RETURNS [point3d: Point3d];
Assumes the next rope on the stream will be of the form "[<real1>,<real2>,<real3>]".
ReadPoint2d: PROC [f: IO.STREAM] RETURNS [point2d: Point2d];
ReadPoint2dAsPoint3d: PROC [f: IO.STREAM] RETURNS [point3d: Point3d];
Assumes the next rope on the stream will be of the form "[<real1>,<real2>]". Fills in point3d[3] with zero.
ReadPlane: PROC [f: IO.STREAM] RETURNS [plane: Plane];
ReadColor: PROC [f: IO.STREAM] RETURNS [color: Color];
ReadSurface: PROC [f: IO.STREAM] RETURNS [surface: REF ANY];
ReadMaterial: PROC [f: IO.STREAM] RETURNS [material: Material];
ReadSMap: PROC [f: IO.STREAM] RETURNS [sMap: SMap];
ReadOMap: PROC [f: IO.STREAM] RETURNS [oMap: OMap];
ReadCamera: PROC [f: IO.STREAM, worldCS: CoordSystem, scene: Scene, version: REAL] RETURNS [fileCamera: FileCamera];
ReadFrame: PROC [f: IO.STREAM, version: REAL] RETURNS [frame: FrameBox];
ReadClippingPlanes: PROC [f: IO.STREAM] RETURNS [clippingPlanes: LIST OF Plane];
ReadVisibleAssemblies: PROC [f: IO.STREAM, scene: Scene, feedback: FeedbackData] RETURNS [assemblyList: LIST OF Slice];
ReadStyle: PROC [f: IO.STREAM] RETURNS [style: DrawStyle];
ReadArtwork: PROC [f: IO.STREAM, csList: CoordSysList, defaultCS: CoordSystem, wdir: Rope.ROPE, version: REAL, feedback: FeedbackData] RETURNS [artwork: Artwork];
ReadListOfRope: PROC [f: IO.STREAM] RETURNS [ropeList: LIST OF Rope.ROPE];
END.