<<>> <> <> <> <> DIRECTORY G2dSpline, G3dBasic, G3dMatrix, G3dQuaternion, G3dSpline, LinearSystem, Rope; G3dTimeTrees: CEDAR DEFINITIONS ~ BEGIN <> Spline1dSequence: TYPE ~ G2dSpline.Spline1dSequence; Pair: TYPE ~ G3dBasic.Pair; PairSequence: TYPE ~ G3dBasic.PairSequence; RealSequence: TYPE ~ G3dBasic.RealSequence; Matrix: TYPE ~ G3dMatrix.Matrix; Triple: TYPE ~ G3dMatrix.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; Quaternion: TYPE ~ G3dQuaternion.Quaternion; QuaternionSequence: TYPE ~ G3dQuaternion.QuaternionSequence; QuaternionSequenceRep: TYPE ~ G3dQuaternion.QuaternionSequenceRep; SplineSequence: TYPE ~ G3dSpline.SplineSequence; ColumnN: TYPE ~ LinearSystem.ColumnN; MatrixN: TYPE ~ LinearSystem.MatrixN; RowN: TYPE ~ LinearSystem.RowN; ROPE: TYPE ~ Rope.ROPE; TransformOrder: TYPE ~ G3dMatrix.TransformOrder; <> TTInterpolateProc: TYPE ~ PROC [time: REAL, keys: KeySequence, object: REF, clientData: REF] RETURNS [REF]; <<-- evaluate a key sequence at a given time>> TTReportProc: TYPE ~ PROC [strobe: REF, object: REF, clientData: REF]; <<-- respond to the new strobe value>> <<>> TTNodeActionProc: TYPE ~ PROC [node: Node] RETURNS [continue: BOOL ¬ TRUE]; <<-- callback proc to process a node>> KeyType: TYPE ~ { matrix, triple, real, unknown }; -- key types (use triple for colors) InterpolationType: TYPE ~ { constant, linear, smooth }; -- forms of interpolation Key: TYPE ~ REF KeyRep; KeyRep: TYPE ~ RECORD [ time: REAL ¬ 1.0, -- time of this key data: REF ¬ NIL -- data for this key ]; Node: TYPE ~ REF NodeRep; NodeRep: TYPE ~ RECORD [ name: ROPE ¬ NIL, -- name of this node object: REF ¬ NIL, -- object associated with this node locked: BOOL ¬ FALSE, -- if false, node data may be changed clientData: REF ¬ NIL, -- client data for this node clientBackup: REF ¬ NIL, -- backup field for client use timeTree: TimeTree ¬ NIL, -- the TimeTree supporting this node children: NodeSequence ¬ NIL, -- children nodes parent: Node ¬ NIL, -- parent node (NIL iff root) transformKeyHead: KeyHead ¬ NIL, -- propagated xform localTransform: Matrix ¬ NIL, -- local xform (can be keys) globalTransform: Matrix ¬ NIL, -- global (inherited) xform at a time keyHeads: LIST OF KeyHead ¬ NIL -- key sets for this node ]; FlavorInfo: TYPE ~ REF FlavorInfoRep; FlavorInfoRep: TYPE ~ RECORD [ type: KeyType ¬ matrix, -- type of key name: ROPE ¬ NIL, -- name for this type of key interpolationType: InterpolationType ¬ smooth, -- kind of interpolation gotInterpProc: BOOL ¬ FALSE, -- flag for cached interpProc interpProc: TTInterpolateProc ¬ NIL, -- interpolate key sequence gotReportProc: BOOL ¬ FALSE, -- flag for cached reportProc reportProc: TTReportProc ¬ NIL -- report proc after strobing ]; KeyHead: TYPE ~ REF KeyHeadRep; KeyHeadRep: TYPE ~ RECORD [ flavorInfo: FlavorInfo ¬ NIL, acceleratorsValid: BOOL ¬ FALSE, -- recompute accelerators accelerators: REF ¬ NIL, -- help for evaluation strobe: REF ¬ NIL, -- strobed value dirty: BOOL ¬ FALSE, -- TRUE if strobe was set externally backup: REF ¬ NIL, -- for backup/restore operations keys: KeySequence ¬ NIL -- the time/data pairs ]; TimeTree: TYPE ~ REF TimeTreeRep; TimeTreeRep: TYPE ~ RECORD [ bufferNode: Node ¬ NIL, -- where nodes are built up activeNode: Node ¬ NIL, -- focus when building tree flavorList: LIST OF FlavorInfo ¬ NIL, -- default return procs transformFlavor: FlavorInfo ¬ NIL, -- propagated transforms control root: Node ¬ NIL -- root of tree ]; KeySequence: TYPE ~ REF KeySequenceRep; -- generic sequence for keys KeySequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Key ]; NodeSequence: TYPE ~ REF NodeSequenceRep; -- generic sequence for nodes NodeSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Node ]; <> <<-- data structure for holding Rrsrtp decomposition of an arbitrary 4-by-3 matrix>> RrsrtpNode: TYPE ~ REF RrsrtpNodeRep; RrsrtpNodeRep: TYPE ~ RECORD [ matrix: Matrix ¬ NIL, -- input matrix (superfluous?) decomposed: BOOL ¬ FALSE, -- has matrix been turned into rrsrtp? q1: Quaternion ¬ [], -- first rotation qc: Quaternion ¬ [], -- conformance rotation scale: Triple ¬ [], -- data for scale spline q2: Quaternion ¬ [], -- second rotation translate: Triple ¬ [], -- data for translate spline perspective: Triple ¬ [] -- data for perspective spline ]; RealRef: TYPE ~ REF REAL; TripleRef: TYPE ~ REF Triple; MatrixRef: TYPE ~ Matrix; MatrixAccelerators: TYPE ~ REF MatrixAcceleratorsRep; -- holds rrsrtp decomposition MatrixAcceleratorsRep: TYPE ~ RECORD [ q1: QuaternionSequence ¬ NIL, -- rotation 1 scaleSpline: SplineSequence ¬ NIL, -- 3d scale spline qc: QuaternionSequence ¬ NIL, -- conformance rotation q2: QuaternionSequence ¬ NIL, -- rotation 2 transSpline: SplineSequence ¬ NIL, -- 3d translation spline perspSpline: SplineSequence ¬ NIL -- 3d perspective spline ]; TripleAccelerators: TYPE ~ REF TripleAcceleratorsRep; TripleAcceleratorsRep: TYPE ~ RECORD [ tSpline: SplineSequence ¬ NIL -- 3d spline for triples ]; RealAccelerators: TYPE ~ REF RealAcceleratorsRep; RealAcceleratorsRep: TYPE ~ RECORD [ vSpline: Spline1dSequence ¬ NIL -- 1d spline for reals ]; <> <= 0.>> <> <> <> <> <> <> <> <> <> <> <> <<>> <> <<>> CreateTimeTree: PUBLIC PROC RETURNS [timeTree: TimeTree]; <> PushTimeTree: PUBLIC PROC [timeTree: TimeTree]; <> PopTimeTree: PUBLIC PROC [timeTree: TimeTree]; <> RegisterKeyType: PUBLIC PROC [timeTree: TimeTree, name: ROPE, type: KeyType, report: TTReportProc ¬ NIL, interp: TTInterpolateProc ¬ NIL, interpType: InterpolationType ¬ smooth]; <> <> <<>> SetNodeObject: PUBLIC PROC [ timeTree: TimeTree, object: REF ¬ NIL, clientData: REF ¬ NIL] RETURNS [Node]; <> NodeFromName: PUBLIC PROC [timeTree: TimeTree, name: ROPE] RETURNS [Node]; <> RenameNode: PUBLIC PROC [timeTree: TimeTree, oldName, newName: ROPE]; <> PruneNode: PUBLIC PROC [node: Node]; <> GraftNode: PUBLIC PROC [orphan, newParent: Node]; <> MoveNode: PUBLIC PROC [moveNode: Node, newParent: Node]; <> ClearNodeObject: PUBLIC PROC [node: REF ANY]; <> SetLocalTransform: PUBLIC PROC [tt: TimeTree, m: Matrix]; <> GetActiveNode: PUBLIC PROC [tt: TimeTree] RETURNS [REF ANY]; <> SetActiveNode: PUBLIC PROC [tt: TimeTree, n: REF ANY]; <> GetRoot: PUBLIC PROC [node: Node] RETURNS [TimeTree]; <> EnumerateNodes: PUBLIC PROC [tt: TimeTree, action: TTNodeActionProc]; <> <> <> <<>> InsertKey: PUBLIC PROC [ timeTree: TimeTree, time: REAL, data: REF, name: ROPE ¬ NIL, keyHead: KeyHead ¬ NIL ]; <> InsertDirtyKeys: PUBLIC PROC [timeTree: TimeTree, time: REAL]; <> SetTransformDirty: PUBLIC PROC [node: Node, dirty: BOOL ¬ TRUE]; <> GetTransformDirty: PUBLIC PROC [node: Node] RETURNS [BOOL ¬ FALSE]; <> SetKeyHeadProcs: PUBLIC PROC [ timeTree: TimeTree, keyName: ROPE, interpProc: TTInterpolateProc ¬ NIL, reportProc: TTReportProc ¬ NIL]; <> SetKeyHeadInterpType: PUBLIC PROC [timeTree: TimeTree, keyName: ROPE, interpType: InterpolationType ¬ smooth]; <> InsertTransform: PUBLIC PROC [timeTree: TimeTree, time: REAL, transform: Matrix]; <> SetTransformProcs: PUBLIC PROC [timeTree: TimeTree, report: TTReportProc ¬ NIL, interp: TTInterpolateProc ¬ NIL, interpType: InterpolationType ¬ smooth]; <> SetTransformInterpType: PUBLIC PROC [timeTree: TimeTree, interpType: InterpolationType ¬ smooth]; <> <<-- Rrsrtp conversion>> RrsrtpToMatrix: PUBLIC PROC [rrsrtp: RrsrtpNode] RETURNS [m: Matrix]; <> RrsrtpComponentsToMatrix: PUBLIC PROC [q1: Quaternion, qc: Quaternion, s: Triple, q2: Quaternion, t: Triple, p: Triple] RETURNS [Matrix]; <> MatrixToRrsrtp: PUBLIC PROC [m: Matrix, oldQ: Matrix ¬ NIL, propagate: BOOL ¬ TRUE] RETURNS [rrsrtp: RrsrtpNode]; <> <> <<>> GetNodeKeyHead: PUBLIC PROC [node: Node, name: ROPE] RETURNS [KeyHead]; <> GetStrobedKey: PUBLIC PROC [node: Node, name: ROPE] RETURNS [REF ANY]; <> <<>> TransformNode: PROC [node: Node, matrix: Matrix, order: TransformOrder]; <> <<>> GetGlobalTransform: PUBLIC PROC [node: Node] RETURNS [Matrix]; <> <<>> SaveNode: PUBLIC PROC [node: Node, clientBackup: REF ANY ¬ NIL]; <> <<>> RestoreNode: PUBLIC PROC [node: Node] RETURNS [REF ANY]; <> <<>> <> <<>> LockActiveNode: PUBLIC PROC [timeTree: TimeTree]; <> UnlockActiveNode: PUBLIC PROC [timeTree: TimeTree]; <> <<>> <> <<>> ReportTimeTree: PUBLIC PROC [timeTree: TimeTree]; <> StrobeTimeTree: PUBLIC PROC [timeTree: TimeTree, time: REAL]; <> <<>> <> <> <<>> <> InitializeGraphicsTimeTree: PUBLIC PROC [tt: TimeTree]; <> <> <> <<>> ReportDiffuse: PUBLIC TTReportProc; ReportSpecular: PUBLIC TTReportProc; ReportMetallicity: PUBLIC TTReportProc; ReportShininess: PUBLIC TTReportProc; ReportTransmittance: PUBLIC TTReportProc; ReportColor: PUBLIC TTReportProc; ReportTransform: PUBLIC TTReportProc; <> <> <<>> AssignDiffuse: PUBLIC PROC [tt: TimeTree, time: REAL, diffuse: REAL]; AssignSpecular: PUBLIC PROC [tt: TimeTree, time: REAL, specular: REAL]; AssignMetallicity: PUBLIC PROC [tt: TimeTree, time: REAL, metallicity: REAL]; AssignShininess: PUBLIC PROC [tt: TimeTree, time: REAL, shininess: REAL]; AssignTransmittance: PUBLIC PROC [tt: TimeTree, time: REAL, transmittance: REAL]; AssignColor: PUBLIC PROC [tt: TimeTree, time: REAL, color: Triple]; AssignTransform: PUBLIC PROC [tt: TimeTree, time: REAL, transform: Matrix]; <> <> <> <<>> SetDiffuseInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetSpecularInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetMetallicityInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetShininessInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetTransmittanceInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetColorInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; SetTransformInterpolationType: PUBLIC PROC [tt: TimeTree, type: InterpolationType]; END.