DIRECTORY Rope, SV2d, SV3d, SVModelTypes, SVVector3d; CoordSys: CEDAR DEFINITIONS = BEGIN CoordSystem: TYPE = SVModelTypes.CoordSystem; CoordSysList: TYPE = SVModelTypes.CoordSysList; Matrix4by4: TYPE = SV3d.Matrix4by4; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = SV3d.Point3d; Vector3d: TYPE = SVVector3d.Vector3d; CreateRoot: PROC [name: Rope.ROPE] RETURNS [newCS: CoordSystem]; CreateCoordSysInTree: PROC [name: Rope.ROPE, mat: Matrix4by4, parent: CoordSystem, root: CoordSystem] RETURNS [newCS: CoordSystem]; NameAlreadyExists: SIGNAL; CreateScalarsOnlyCoordSysInTree: PROC [name: Rope.ROPE, scalars: Vector3d, parent: CoordSystem, root: CoordSystem] RETURNS [newCS: CoordSystem]; CopyCoordSysFromAnyTree: PROC [source: CoordSystem, newName: Rope.ROPE, parent: CoordSystem, root: CoordSystem] RETURNS [newCS: CoordSystem]; PutAInTermsOfB: PROC [a: CoordSystem, b: CoordSystem] RETURNS [mat: Matrix4by4]; DeleteCoordSysAndChildren: PROC [cs: CoordSystem, root: CoordSystem]; FindCoordSysInTree: PROC [name: Rope.ROPE, root: CoordSystem] RETURNS [cs: CoordSystem]; CoordSysNotFound: SIGNAL; CoordSysListEmpty: SIGNAL; CoordSysNameIsPresent: PROC [name: Rope.ROPE, root: CoordSystem] RETURNS [BOOL]; MakeListFromTree: PROC [root: CoordSystem] RETURNS [csl: CoordSysList]; FindCoordSysInList: PROC [name: Rope.ROPE, csl: CoordSysList] RETURNS [cs: CoordSystem]; Parent: PROC [cs: CoordSystem] RETURNS [parent: CoordSystem]; Name: PROC [cs: CoordSystem] RETURNS [name: Rope.ROPE]; SetName: PROC [cs: CoordSystem, name: Rope.ROPE]; GetSceneAssembly: PROC [world: CoordSystem] RETURNS [sa: CoordSystem]; BaseAndNumber: PROC [name: Rope.ROPE] RETURNS [base: Rope.ROPE, number: NAT]; UniqueNameWithSuffix: PROC [oldName: Rope.ROPE, suffix: Rope.ROPE, root: CoordSystem] RETURNS [unique: Rope.ROPE]; UniqueNameFrom: PROC [name: Rope.ROPE, root: CoordSystem] RETURNS [unique: Rope.ROPE]; NameWithSuffix: PROC [oldName: Rope.ROPE, suffix: Rope.ROPE, root: CoordSystem] RETURNS [probablyUnique: Rope.ROPE]; SetScalars: PROC [cs: CoordSystem, scalars: Vector3d]; GetScalars: PROC [cs: CoordSystem] RETURNS [scalars: Vector3d]; SetMat: PROC [cs: CoordSystem, mat: Matrix4by4]; GetMat: PROC [cs: CoordSystem] RETURNS [mat: Matrix4by4]; IsScalarsOnly: PROC [cs: CoordSystem] RETURNS [BOOL]; CameraToScreen: PROC [cameraPoint2d: Point2d, screenCoordSys: CoordSystem] RETURNS [screenPoint2d: Point2d]; ScreenToCamera: PROC [screenPoint2d: Point2d, screenCoordSys: CoordSystem] RETURNS [cameraPoint2d: Point2d]; FromCSToCS: PROC [pt: Point3d, currentCS: CoordSystem, newCS: CoordSystem] RETURNS [newPt: Point3d]; FromCSToCSMat: PROC [mat: Matrix4by4, currentCS: CoordSystem, newCS: CoordSystem] RETURNS [newMat: Matrix4by4]; WRTWorld: PROC [cs: CoordSystem] RETURNS [mat: Matrix4by4]; WRTCamera: PROC [cs: CoordSystem, cameraCS: CoordSystem] RETURNS [mat: Matrix4by4]; FindWorldInTermsOf: PROC [cs: CoordSystem] RETURNS [mat: Matrix4by4]; FindCameraInTermsOf: PROC [cs: CoordSystem, cameraCS: CoordSystem] RETURNS [mat: Matrix4by4]; FindAInTermsOfB: PROC [a: CoordSystem, b: CoordSystem] RETURNS [mat: Matrix4by4]; FindTranslationOfAinTermsOfB: PROC [a: CoordSystem, b: CoordSystem] RETURNS [displacements: Vector3d]; END. File: CoordSys.mesa Last edited by Bier on May 5, 1987 1:17:08 am PDT Author: Eric Bier in June, 1982 Contents: Allocation and access to a user-specified set of named coordinate systems Building the Tree Like CreateCoordSysInTree but uses the matrix from the old CoordSys. If source is a scalars-only coordsys, then newCS will be as well. Finds the matrix and redefines CoordSystem a to be in terms of b from now on. A gets a new parent. Produces a list of the CoordSystem's in subtree rooted at root. The list is in breadth-first order. This procedure is on its way out. Use FindCoordSysInTree when possible. Unique Names Takes a solidviews name, like "teapot.73". Adds the suffix to the basename and fixes the number to ensure uniqueness. If the suffix were "$$tool", then UniqueNameWithSuffix might return "teapot$$tool.89". Takes a solidviews name, like "teapot.73". Fixes the number to ensure uniqueness. UniqueNameFrom might return "teapot.106". Changing the Transformations cs must be scalarsOnly. cs must be scalarsOnly. changes the relationship of cs to its parent. reports the relationship of cs to its parent. Transformation Queries Takes ptcurrentCS and returns ptnewCS. Takes matcurrentCS and returns matnewCS. The above three procs return the relevant matrix with no side effects Κ*– "cedar" style˜Iheadšœ™Iprocšœ1™1Lšœ™LšœS™SL˜šΟk ˜ Lšœ+˜+—L˜Lšœ œ˜Lš˜˜Lšœ œ˜-Lšœœ˜/Lšœ œ˜#Lšœ œ˜Lšœ œ˜Lšœ œ˜%—K™LšΟn œœ œœ˜@Lšžœœ œ;œ˜ƒLšœœ˜Lšžœœ œ=œ˜šžœœ%œ*œ˜Lšœ‡™‡—šžœœ"œ˜PLšœc™c—L˜Lšžœœ&˜EJšžœœ œœ˜XLšœœ˜Lšœœ˜Jš žœœ œœœ˜Pšžœœœ˜GLšœc™c—šžœœ œœ˜XLšœH™H—Lšžœœœ˜=Lšžœœœ œ˜7Lšžœœœ˜1Lšžœœœ˜FK™ Jš ž œœ œœ œ œ˜Mš žœœœœœœ˜rJšœΞ™Ξ—J– "Cedar" styleš žœœ œœœ˜Vš žœœœœœœ˜tJ– "Cedar" stylešœ}™}—K™šž œœ&˜6Lšœ™—šž œœœ˜?Lšœ™—šžœœ$˜0LšΟc-™-—Lšžœœœ˜9šž œœœœ˜5Lšœ Ÿ œ™-—K™Lšžœœ7œ˜lLšžœœ7œ˜lL˜šž œœ;œ˜dJšœΟu œ œ™&—šž œœ?œ˜oJšœ   œ œ™(—L˜Lšžœœœ˜;Lšž œœ*œ˜SLšžœœœ˜ELšžœœ*œ˜]Lšžœœ"œ˜QLšœE™ELšžœœ"œ˜fL˜Lšœ˜Lšœ˜L˜L˜—…— –ά