TubeDefs.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, May 16, 1986 1:00:17 am PDT
DIRECTORY Controls, Controls3d, Imager, IO, Matrix3d, Rope, Spline3d, Vector3d;
TubeDefs: CEDAR DEFINITIONS
~ BEGIN
ROPE:     TYPE ~ Rope.ROPE;
Context:    TYPE ~ Imager.Context;
Mouse:    TYPE ~ Controls.Mouse;
ControlData:   TYPE ~ Controls.ControlData;
GraphicsData:  TYPE ~ Controls.GraphicsData;
OuterData:   TYPE ~ Controls.OuterData;
Triple:     TYPE ~ Vector3d.Triple;
Coeffs:    TYPE ~ Spline3d.Coeffs;
Matrix:    TYPE ~ Matrix3d.Matrix;
MatrixRep:   TYPE ~ Matrix3d.MatrixRep;
MatrixSeq:   TYPE ~ Matrix3d.MatrixSequence;
MatrixSeqRep:  TYPE ~ Matrix3d.MatrixSequenceRep;
Pair:     TYPE ~ Matrix3d.Pair;
PairSequence:  TYPE ~ REF PairSequenceRec;
PairSequenceRec:  TYPE ~ RECORD [element: SEQUENCE length: NAT OF Pair];
DetailType:   TYPE ~ {on, auto, label, pick, skel, spline, circles,
        lines, frames, normals, curv, vel, acc};
Details:    TYPE ~ REF DetailsRec;
DetailsRec:   TYPE ~ RECORD [
auto:       BOOLTRUE,    -- kill details if mouse held
label:       BOOLTRUE,    -- label iff label a vector
skel:       BOOLFALSE,    -- draw straight line skeleton
pick:       BOOLTRUE,    -- draw spline axis, draw picked point
on:       BOOLTRUE,    -- true if any details true
shape:       BOOLTRUE,    -- true if any details 'cept spline true
spline:      BOOLTRUE,    -- details
frames, lines, circles:  BOOLFALSE,   -- details
curv, vel, acc, normals: BOOLFALSE    -- details
];
Frame:    TYPE ~ RECORD [t: REAL, m: Matrix];
FrameSeq:   TYPE ~ REF FrameSeqRep;
FrameSeqRep:  TYPE ~ RECORD [element: SEQUENCE maxLength: NAT OF Frame];
Tube:     TYPE ~ REF TubeRec;
TubeRec:    TYPE ~ RECORD [
p0, p1, v0, v1:     Triple ← [0.0, 0.0, 0.0],  -- Hermite representation of curve
twist0, twist1:    REAL ← 0.0,
r0, r1:       REAL ← 0.05,
selected:      BOOLFALSE,
c:         Coeffs ← NIL,    -- coefficients of curve
xc:        Coeffs ← NIL,    -- curve xformed to screen
refVec:       Triple ← [0.0, 0.0, 0.0],  -- reference vector to make frames
axialRes:      NAT ← 0,
circleRes:      NAT ← 6,
frames:      FrameSeq ← NIL,    -- reference frames
prev, next:      Tube ← NIL,
nBranches:     NAT ← 0,
branches:      TubeSequence ← NIL,
refAny:      REF ANYNIL
];
TubeSequence:  TYPE ~ REF TubeSequenceRec;
TubeSequenceRec: TYPE ~ RECORD [element: SEQUENCE maxLength: NAT OF Tube];
Pick:     TYPE ~ REF PickRec;
PickRec:    TYPE ~ RECORD [
origPos:      Triple ← [0.0, 0.0, 0.0],
pos, tan:      Triple ← [0.0, 0.0, 0.0],
t:        REAL ← 1.0,
tube:       Tube ← NIL,
tubePt0, tubePt1:   Tube ← NIL,
tubePick0, tubePick1:  Tube ← NIL,
dividePending:    BOOLFALSE
];
END.
..
Triad:     TYPE ~ ARRAY {v, n, b} OF Triple;
A Triad is defined as a vector, its principal normal, and its binormal
(see Computation Geometry for Design and Manufacture by Faux and Pratt).