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: BOOL ← TRUE, -- kill details if mouse held
label: BOOL ← TRUE, -- label iff label a vector
skel: BOOL ← FALSE, -- draw straight line skeleton
pick: BOOL ← TRUE, -- draw spline axis, draw picked point
on: BOOL ← TRUE, -- true if any details true
shape: BOOL ← TRUE, -- true if any details 'cept spline true
spline: BOOL ← TRUE, -- details
frames, lines, circles: BOOL ← FALSE, -- details
curv, vel, acc, normals: BOOL ← FALSE -- 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: BOOL ← FALSE,
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 ANY ← NIL
];
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: BOOL ← FALSE
];
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).