G3dInterpret.mesa
Copyright Ó 1988, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 19, 1992 11:20 am PDT
DIRECTORY FileInterpreter, G3dTool, G3dScene, Rope, ViewerClasses;
G3dInterpret: CEDAR DEFINITIONS
~ BEGIN
Type Declarations
RenderTool:   TYPE ~ G3dTool.Tool;
ParseState:   TYPE ~ G3dScene.ParseState;
ROPE:     TYPE ~ Rope.ROPE;
Column:    TYPE ~ ViewerClasses.Column;
InterpretTool:  TYPE ~ REF InterpretToolRep;
InterpretToolRep: TYPE ~ RECORD [
fileTool:      FileInterpreter.Tool ¬ NIL, -- the File Interpreter tool
renderTool:     RenderTool ¬ NIL,   -- where the action is
parseState:     ParseState ¬ NIL    -- provide continuity between parse
];
Creating and Using the Interpret Tool
Error: SIGNAL [reason: ROPE];
MakeInterpretTool: PROC [
fileName: ROPE,
column: Column ¬ left,
log: BOOL ¬ TRUE,
renderTool: RenderTool ¬ NIL]
RETURNS [InterpretTool];
Create a file interpreter tool to read the file.
log creates a typescript within the tool; fork causes execution of the script without a tool.
Use renderTool if non-NIL, otherwise creates an invisible one.
! Error.
Parse: PROC [operation: ROPE];
Perform the given operation on the 3d scene.
See the graphics 3d documentation for a list of valid operations and their arguments.
ParseReals: PROC [key: ROPE, values: LIST OF REAL];
A convenience routine for operations with real arguments.
ParseInts: PROC [key: ROPE, values: LIST OF INT];
A convenience routine for operations with int arguments.
GetInterpretTool: PROC RETURNS [InterpretTool];
Return the animation data associated with the current animation process.
This is useful only when called from within an anim file.
END.