<<>> <> <> <> <> DIRECTORY Draw2d, G2dContour, G3dBasic, G3dCurve, G3dMatrix, G3dPlane, G3dShape, G3dSpline, G3dVector, Imager, ImagerInterpress, IO, Rope, ViewerClasses; G3dTube: CEDAR DEFINITIONS ~ BEGIN <> <> <> Contour: TYPE ~ G2dContour.Contour; ContourSequence: TYPE ~ G2dContour.ContourSequence; -- presumed ordered according to t Frame: TYPE ~ G3dBasic.Frame; Hull: TYPE ~ G3dBasic.Hull; Pair: TYPE ~ G3dBasic.Pair; PairSequence: TYPE ~ G3dBasic.PairSequence; Ray: TYPE ~ G3dBasic.Ray; Triad: TYPE ~ G3dBasic.Triad; Triple: TYPE ~ G3dBasic.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; Curve: TYPE ~ G3dCurve.Curve; Matrix: TYPE ~ G3dMatrix.Matrix; Plane: TYPE ~ G3dPlane.Plane; Shape: TYPE ~ G3dShape.Shape; Bezier: TYPE ~ G3dSpline.Bezier; NearSpline: TYPE ~ G3dSpline.NearSpline; Spline: TYPE ~ G3dSpline.Spline; NearSegment: TYPE ~ G3dVector.NearSegment; Color: TYPE ~ Imager.Color; STREAM: TYPE ~ IO.STREAM; ROPE: TYPE ~ Rope.ROPE; origin: Triple ~ [0.0, 0.0, 0.0]; RadiusMode: TYPE ~ {linear, square}; XSection: TYPE ~ REF XSectionRep; XSectionRep: TYPE ~ RECORD [ t: REAL ¬ 0.0, -- parametric position on curve frame: Frame ¬ [], -- reference frame length: REAL ¬ 0.0, -- distance from beginning of curve scale: REAL ¬ 1.0, -- scale twist: REAL ¬ 0.0, -- twist matrix: Matrix ¬ NIL, -- matrix (right-handed) w/ scale,twist contour: Contour ¬ NIL, -- normalized to unit square normals: PairSequence ¬ NIL -- normals of contour ]; XSectionSequence: TYPE ~ REF XSectionSequenceRep; XSectionSequenceRep: TYPE ~ RECORD [ length: NAT ¬ 0, element: SEQUENCE maxLength: NAT OF XSection ]; Tube: TYPE ~ REF TubeRep; TubeRep: TYPE ~ RECORD [ <> p0, p1: Triple ¬ origin, -- Hermite endpoints of curve v0, v1: Triple ¬ origin, -- Hermite tangents of curve circleRes: INTEGER ¬ 6, -- # sides of circular contour epsilon: REAL ¬ 0.03, -- criterion for spline flatness tw0, tw1: REAL ¬ 0.0, -- twists tens0, tens1: REAL ¬ 1.0, -- tensions r0, r1: REAL ¬ 0.05, -- radii scale: REAL ¬ 1.0, -- applied to radii taper: REAL ¬ 0.0, -- applied to r1 contours: ContourSequence ¬ NIL, -- optional contours <> spline: Spline ¬ NIL, -- coefficients of curve xSpline: Spline ¬ NIL, -- curve xformed to screen bezier: Bezier ¬ [], -- useful in proximity testing refVec: Triple ¬ origin, -- reference vector to make xSections length: REAL ¬ 0.0, -- length of the tube length0, length1: REAL ¬ 0.0, -- distances from root plane: Plane ¬ [], -- plane at p1 perpendicular to curve xSections: XSectionSequence ¬ NIL, -- reference xSections, ordered by t <> planeValid: BOOL ¬ FALSE, -- if plane ok splineValid: BOOL ¬ FALSE, -- if tube.spline were set lengthsValid: BOOL ¬ FALSE, -- if length, length0, and length1 ok xSectionsValid: BOOL ¬ FALSE, -- if xSections ok <> prev, next: Tube ¬ NIL, -- parent and continuing tubes branches: TubeSequence ¬ NIL, -- branch (non-continuing) tubes <> nearSpline: NearSpline ¬ [], -- relative to a previous query nearSegment: NearSegment ¬ [], -- relative to a previous query <> name: ROPE ¬ NIL, -- optional name of tube color: Color ¬ NIL, -- Imager color refAny: REF ANY ¬ NIL, -- for client data selected: BOOL ¬ FALSE -- selected for drawing? ]; TubeSequence: TYPE ~ REF TubeSequenceRep; TubeSequenceRep: TYPE ~ RECORD [ length: NAT ¬ 0, element: SEQUENCE maxLength: NAT OF Tube ]; TubePlace: TYPE ~ RECORD [tube: Tube, t: REAL]; DetailType: TYPE ~ { autoSimplify, -- kill details if mouse held label, -- label vectors skeleton, -- draw straight line skeleton spline, -- draw spline axis ends, -- draw spline ends pick, -- draw picked point enabled, -- enable viewing of details xSections, -- reference xSections lines, -- longitudinal lines curvature, -- curvature velocity, -- velocity acceleration, -- acceleration contours, -- true: contours, false: circles points, -- points normals, -- normals shape, -- xSections or curvature or velocity or acceleration skin -- contours or normals }; Details: TYPE ~ REF DetailsRep; DetailsRep: TYPE ~ ARRAY DetailType OF BOOL ¬ [ FALSE, -- autoSimplify TRUE, -- label FALSE, -- skeleton TRUE, -- spline TRUE, -- ends TRUE, -- pick TRUE, -- enabled FALSE, -- xSections FALSE, -- lines FALSE, -- curvature FALSE, -- velocity FALSE, -- acceleration FALSE, -- contours FALSE, -- points FALSE, -- normals FALSE, -- shape FALSE -- skin ]; <> TubeProc: TYPE ~ PROC [tube: Tube] RETURNS [continue: BOOL ¬ TRUE]; << Procedure for operating on each tube section.>> <<>> XSectionProc: TYPE ~ PROC [position, velocity: Triple, t: REAL] RETURNS [XSection]; << Return a xSection given the position and velocity>> << of the curve at parametric position t.>> <<>> PointProc: TYPE ~ PROC [id: INTEGER, position, normal: Triple, texture: Pair] RETURNS [continue: BOOL ¬ TRUE]; << Procedure for operating on the given point.>> PolyProc: TYPE ~ PROC [id, p0, p1, p2: INTEGER] RETURNS [continue: BOOL ¬ TRUE]; << Procedure for operating on the given triangle.>> <> <> EvalPosition: PROC [tube: Tube, t: REAL] RETURNS [Triple]; <> <> <<>> EvalXSection: PROC [tube: Tube, t: REAL] RETURNS [XSection]; <> <> <> <> SetSpline: PROC [tube: Tube]; <> SetSectionSpline: PROC [tube: Tube]; <> <<>> ExtractPartTube: PROC [in: Tube, t0, t1: REAL, out: Tube ¬ NIL] RETURNS [Tube]; <> <<>> CurveFromTube: PROC [tube: Tube] RETURNS [Curve]; <> <> SetTubeProperties: PROC [ tube: Tube, scale, taper, epsilon: REAL, recursively: BOOL ¬ TRUE]; <> <<>> PropagateEpsilon: PROC [tube: Tube, epsilon: REAL]; <> <<>> PropagateScale: PROC [tube: Tube, scale: REAL]; <> <<>> Tension: PROC [tube: Tube, t: REAL] RETURNS [REAL]; <> Twist: PROC [tube: Tube, t: REAL] RETURNS [REAL]; <> <> AddContour: PROC [tube: Tube, contour: Contour]; <> <<>> DivideContours: PROC [tube, tube0, tube1: Tube, t: REAL]; <> <<>> TContour: PROC [contours: ContourSequence, circle: Contour, t: REAL] RETURNS [Contour]; <> <> <<>> Skin: PROC [tube: Tube]; <> <<>> GetContourPairs: PROC [xSection: XSection] RETURNS [PairSequence]; <> PropagateCircleRes: PROC [tube: Tube, circleRes: INTEGER]; <> <<>> ScreenCircleRes: PROC [tube: Tube, view: Matrix] RETURNS [INTEGER]; <> <> <> Radius: PROC [tube: Tube, t: REAL, roundTip: BOOL ¬ FALSE] RETURNS [REAL]; <> <> <<>> SetRadii: PROC [tube: Tube, radius: REAL]; <> <<>> SetDescendantRadii: PROC [tube: Tube, mode: RadiusMode]; <> <> <> Length: PROC [tube: Tube, t: REAL] RETURNS [REAL]; <> <<>> SetLengths: PROC [tube: Tube]; <> SetSectionLengths: PROC [tube: Tube]; <> <<>> AdjustXSectionLengths: PROC [tube: Tube]; <> <> SetPlanes: PROC [tube: Tube]; <> SetPlane: PROC [tube: Tube]; <> <> ReScale: PROC [tube: Tube, scale: REAL ¬ 1.0, taper: REAL ¬ 0.0]; <> <<>> SetCircles: PROC [tube: Tube, circleRes: NAT]; <> <> NearestTube: PROC [q: Triple, tube: Tube, nearValid: BOOL ¬ TRUE] RETURNS [TubePlace]; <> <<>> NearestTube2d: PROC [tube: Tube, screen: Pair, mouseDown: BOOL, view: Matrix] RETURNS [TubePlace]; <> <> Rotate: PROC [tube: Tube, line: Ray, angle: REAL, degrees, tubeAlso: BOOL ¬ TRUE]; <> <> <> Make: PROC [ tube: Tube, skin: BOOL ¬ FALSE, roundTip: BOOL ¬ FALSE, view: Matrix ¬ NIL, epsilon: REAL ¬ 0.03, xSectionProc: XSectionProc ¬ NIL]; <> <> <<>> <> <> <> <<>> <> <> <<>> <> <> <<>> <> <> <> <> <<>> <> <> <<>> MakeXSections: PROC [ tube: Tube, skin: BOOL ¬ FALSE, roundTip: BOOL ¬ FALSE, view: Matrix ¬ NIL, xSectionProc: XSectionProc ¬ NIL]; <> <> <<>> MakeSectionXSections: PROC [ tube: Tube, skin: BOOL ¬ FALSE, roundTip: BOOL ¬ FALSE, view: Matrix ¬ NIL, xSectionProc: XSectionProc ¬ NIL]; <> <> <<>> NXSections: PROC [tube: Tube] RETURNS [INTEGER]; <> <<>> TotalNXSections: PROC [tube: Tube] RETURNS [nXSections: NAT ¬ 0]; <> <<>> GetXSection: PROC [tube: Tube, t: REAL] RETURNS [XSection]; <> <<>> PutXSection: PROC [tube: Tube, xSection: XSection]; <> <<>> CopyXSection: PROC [xSections: XSection] RETURNS [XSection]; <> <<>> CopyXSections: PROC [xSections: XSectionSequence] RETURNS [XSectionSequence]; <> <<>> Basis: PROC [v, vv, rv: Triple] RETURNS [Triad]; <> <> <> <<>> RefMatrix: PROC [position: Triple, triad: Triad, scale, twist: REAL, out: Matrix ¬ NIL] RETURNS [Matrix]; <> <> <<>> XYFromXSection: PROC [point: Triple, tube: Tube, t: REAL] RETURNS [Pair]; <> <> ShapeFromTube: PROC [tube: Tube] RETURNS [Shape]; <> <<>> CopyTubeSection: PROC [tube: Tube, copy: Tube ¬ NIL] RETURNS [Tube]; <> <<>> CopyEntireTube: PROC [tube: Tube] RETURNS [copy: Tube]; <> <<>> Find: PROC [searchee, search: Tube] RETURNS [BOOL]; <> <<>> Where: PROC [searchee, search: Tube] RETURNS [ROPE]; <> <<>> SetLastTubePicked: PROC [tube: Tube]; <> <<>> LastTubePicked: PROC [copy: BOOL ¬ TRUE] RETURNS [Tube]; <> First: PROC [tube: Tube] RETURNS [Tube]; <> <<>> Last: PROC [tube: Tube] RETURNS [Tube]; <> <<>> Divide: PROC [tube: Tube, t: REAL]; <> Delete: PROC [tube: Tube]; <> <<>> SelectAll: PUBLIC PROC [tube: Tube]; <> <<>> UnSelectAll: PUBLIC PROC [tube: Tube]; <> <<>> ExtractTubeName: PROC [fileName: ROPE] RETURNS [ROPE]; <> <<>> SetTubeColors: PROC [tube: Tube]; <> <> Average: PROC [tube0, tube1: Tube] RETURNS [Tube]; <> <> <<>> InterpTubes: PROC [tube1, tube2, interp: Tube, alpha: REAL]; <> <> <> <> NewTube: PROC [ knots: TripleSequence, tension: REAL ¬ 1.0, tangent0, tangent1: Triple ¬ [], cyclic: BOOL ¬ FALSE] RETURNS [Tube]; <> <> <> NewBranch: PROC [tube: Tube] RETURNS [Tube]; <> <<>> AddBranch: PROC [tube, branch: Tube]; <> <<>> GetBranch: PROC [tube: Tube, n: NAT] RETURNS [branch: Tube]; <> <> <> TubeHull: PROC [tube: Tube] RETURNS [Hull]; <> <<>> InvalidateTubeAttributes: PROC [tube: Tube]; <> <<>> NTubes: PROC [tube: Tube] RETURNS [INTEGER]; <> <<>> NBranches: PROC [tube: Tube, nextAlso: BOOL ¬ FALSE] RETURNS [INTEGER]; <> <<>> NSiblings: PROC [tube: Tube, tubeAlso: BOOL ¬ TRUE] RETURNS [INTEGER]; <> <<>> NPoints: PROC [tube: Tube] RETURNS [INT]; <> <<>> NPolys: PROC [tube: Tube] RETURNS [INT]; <> <<>> NSplinesInBranch: PROC [tube: Tube] RETURNS [INT]; <> <<>> Depth: PROC [tube: Tube] RETURNS [NAT]; <> <<>> Info: PROC [tube: Tube] RETURNS [nPoints, nPolys, minCres, maxCres: INT]; <> <> Points: PROC [tube: Tube, pointProc: PointProc, view: Matrix ¬ NIL] RETURNS [nPoints: INT]; <> Polys: PROC [tube: Tube, polyProc: PolyProc] RETURNS [nPolys: INT]; <> <> ApplyToTube: PROC [tube: Tube, tubeProc: TubeProc]; <> <<>> ApplyToBranches: PROC [tube: Tube, tubeProc: TubeProc, nextAlso: BOOL ¬ TRUE]; <> <<>> ApplyToSiblings: PROC [tube: Tube, tubeProc: TubeProc, tubeAlso: BOOL ¬ TRUE]; <> <> ReadTube: PROC [stream: STREAM] RETURNS [Tube]; <> <<>> WriteTube: PROC [stream: STREAM, tube: Tube, m: Matrix ¬ NIL]; <> <<>> WritePointsPolys: PROC [tube: Tube, fileName: ROPE, m: Matrix ¬ NIL] RETURNS [nPoints, nPolys: INT]; <> <> <<>> WriteIP: PROC [ref: ImagerInterpress.Ref, tube: Tube, details: Details, m: Matrix]; <> <<>> TubeFromFile: PROC [fileName: ROPE] RETURNS [tube: Tube]; <> <<>> TubeToFile: PROC [tube: Tube, fileName: ROPE, matrix: Matrix ¬ NIL]; <> <> DrawType: TYPE ~ Draw2d.DrawType; MarkType: TYPE ~ Draw2d.MarkType; Viewport: TYPE ~ G3dMatrix.Viewport; Context: TYPE ~ Imager.Context; DrawTube: PROC [ context: Context, tube: Tube, details: Details, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ solid]; <> <<>> DrawSkeleton: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ solid]; <> <<>> DrawSplines: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ solid]; <> DrawSplineEnds: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], mark: MarkType ¬ dot]; <> DrawPoints: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], markType: MarkType ¬ dot]; <> DrawContours: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ solid]; <> DrawLines: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], drawType: DrawType ¬ solid]; <> DrawXSections: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], label: BOOL, drawType: DrawType ¬ solid]; <> DrawNormals: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], label: BOOL, drawType: DrawType ¬ solid]; <> <<>> DrawCurvature: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], label: BOOL, drawType: DrawType ¬ solid]; <> DrawVelocity: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], label: BOOL, drawType: DrawType ¬ solid]; <> DrawAcceleration: PROC [ context: Context, tube: Tube, view: Matrix, viewport: Viewport ¬ [], label: BOOL, drawType: DrawType ¬ solid]; <> NVectors: PROC [tube: Tube, details: Details] RETURNS [INTEGER]; <> <<>> END.