<<>> <> <> <> <> DIRECTORY Args, Atom, Commander, G3dBasic, G3dMatrix, G3dQuaternion, G3dRender, G3dShape, G3dSpline, G3dTimeTrees, IO, Random, Rope, ViewerClasses, ViewerTools; G3dScene: CEDAR DEFINITIONS ~ BEGIN <> Arg: TYPE ~ Args.Arg; PropList: TYPE ~ Atom.PropList; Handle: TYPE ~ Commander.Handle; Pair: TYPE ~ G3dBasic.Pair; Triple: TYPE ~ G3dBasic.Triple; Matrix: TYPE ~ G3dMatrix.Matrix; MatrixSequence: TYPE ~ G3dMatrix.MatrixSequence; SplineSequence: TYPE ~ G3dSpline.SplineSequence; Quaternion: TYPE ~ G3dQuaternion.Quaternion; Context3d: TYPE ~ G3dRender.Context3d; RenderStyle: TYPE ~ G3dRender.RenderStyle; Shape: TYPE ~ G3dShape.Shape; ShapeSequence: TYPE ~ G3dShape.ShapeSequence; TimeTree: TYPE ~ G3dTimeTrees.TimeTree; STREAM: TYPE ~ IO.STREAM; RandomStream: TYPE ~ Random.RandomStream; ROPE: TYPE ~ Rope.ROPE; Viewer: TYPE ~ ViewerClasses.Viewer; <> WriteCameraParameters: PROC [context3d: Context3d]; <> <<>> WriteParameters: PROC [context3d: Context3d, fileName: ROPE ¬ NIL]; <> <> <> <<>> WriteParametersToStream: PROC [context3d: Context3d, out: STREAM]; <> <> MakeFrameFromFile: PROC [context3d: Context3d, fileName: ROPE]; <> <<>> ReadParameters: PROC [context3d: Context3d, fileName: ROPE ¬ NIL, cmdOut: STREAM ¬ NIL] RETURNS [shouldRepaint: BOOL]; <> <> <> <> LogProc: TYPE ~ PROC [rope: ROPE, clientData: REF ANY]; WriteLog: PROC [ps: ParseState, msg: ROPE]; <> <<>> Parse: PROC [ context3d: Context3d, operation: ROPE, cmdOut: STREAM ¬ NIL, logProc: LogProc ¬ NIL, logErrors: BOOL ¬ TRUE, fileName: ROPE ¬ NIL, clientData: REF ANY ¬ NIL, parseState: ParseState ¬ NIL] RETURNS [ParseState]; <> <> <> <> <> <> <> <> <> <> InheritMaterial: PROC [ps: ParseState]; <> SaveCurrentShapeInTree: PROC [ps: ParseState]; <> <> SceneProc: TYPE ~ PROC [ps: ParseState, args: ROPE, data: REF ANY]; Registry: TYPE ~ LIST OF RECORD [key: ROPE, proc: SceneProc, data: REF ANY]; SourceText: TYPE ~ REF SourceTextRep; SourceTextRep: TYPE ~ RECORD [ fileName: ROPE ¬ NIL, position: INT ¬ 0 ]; ParseState: TYPE ~ REF ParseStateRep; ParseStateRep: TYPE ~ RECORD [ <> fileName: ROPE ¬ NIL, -- originating scene file (if any) index: INT ¬ 0, -- character position within scene file errorMessage: ROPE ¬ NIL, -- if any errors encountered errorViewer: Viewer ¬ NIL, -- viewer for displaying parse errors cmdHandle: Handle ¬ NIL, -- for Cedar command execution nesting: NAT ¬ 0, -- nesting of parse calls directory: ROPE ¬ NIL, -- working directory shouldRepaint: BOOL ¬ FALSE, -- operations necessitated a repaint? logProc: LogProc ¬ NIL, -- for logging operations clientData: REF ANY ¬ NIL, -- passed to registered procs <<3d context3d:>> context3d: Context3d ¬ NIL, -- rendering information <> command: ROPE ¬ NIL, -- currently executing command (key) currentShape: Shape ¬ NIL, -- currently active shape currentMaterial: Material ¬ [], -- currently active surface attributes ctm: Matrix ¬ NIL, -- current transformation matrix <> buildData: REF ANY ¬ NIL, -- state data for G3dBuild routines <> timeTree: TimeTree ¬ NIL, -- hiearchy with animation info changes: PropList ¬ NIL, -- what's changed in this key inKey: BOOL ¬ FALSE, -- TRUE when we're creating keys <> matrixStack: LIST OF Matrix ¬ NIL, -- matrix stack for pusing/popping randomStream: RandomStream ¬ NIL, -- for pseudo-variables materials: MaterialSequence ¬ NIL, -- accumulated surface attributes variables: VariableSequence ¬ NIL -- accumulated key-substitute pairs ]; Material: TYPE ~ RECORD [ name: ROPE ¬ NIL, backFaces: BOOL ¬ FALSE, renderStyle: RenderStyle ¬ smooth, color: Triple ¬ [0.7, 0.7, 0.7], diffuseReflectivity: REAL ¬ 1.0, specularReflectivity: REAL ¬ 1.0, metallicity: REAL ¬ 1.0, shininess: REAL ¬ 50.0, transmittance: REAL ¬ 0.0, visible: BOOL ¬ TRUE, textureOffset: Pair ¬ [0.0, 0.0], textureScale: Pair ¬ [1.0, 1.0], bumpScale: REAL ¬ 1.0, textureFiltering: BOOL ¬ FALSE, textureIntensityName: ROPE ¬ NIL, textureColorName: ROPE ¬ NIL, textureBumpName: ROPE ¬ NIL ]; MaterialSequence: TYPE ~ REF MaterialSequenceRep; MaterialSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Material ]; Variable: TYPE ~ RECORD [name, value: ROPE ¬ NIL]; VariableSequence: TYPE ~ REF VariableSequenceRep; VariableSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Variable ]; ParseError: ERROR [explanation: ROPE]; <> RegisterProc: PROC [key: ROPE, proc: SceneProc, data: REF ANY ¬ NIL]; <> <> <> <<>> UnregisterProc: PROC [key: ROPE]; <> GetRegistry: PROC RETURNS [Registry]; <> <<>> ResetRegistry: PROC; <> <<>> <> MakeTransformNode: PROC [ps: ParseState]; <> <<>> MakeKeysNode: PROC [ps: ParseState]; <> <<>> MakeShapeNode: PROC [ps: ParseState]; <> <<>> <> AssignCtmToShape: PROC [ps: ParseState, shape: Shape]; <> GetArgs: PROC [ps: ParseState, input, format: ROPE] RETURNS [Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg,Arg]; <> <> SubstituteVariables: PROC [ variables: VariableSequence, input: ROPE, rs: RandomStream ¬ NIL] RETURNS [out: ROPE]; <> <<>> LookupVariable: PROC [variables: VariableSequence, name: ROPE] RETURNS [ROPE]; <> <> END.