DIRECTORY AtomButtonsTypes, GGBasicTypes, GGSegmentTypes, GGFont, Imager, ImagerPath, ImagerTransformation, IO, Rope, Rosary, ViewerClasses; GGModelTypes: CEDAR DEFINITIONS = BEGIN BitMatrix: TYPE = GGBasicTypes.BitMatrix; BitVector: TYPE = GGBasicTypes.BitVector; BoundBox: TYPE = GGBasicTypes.BoundBox; Circle: TYPE = GGBasicTypes.Circle; FeedbackData: TYPE = AtomButtonsTypes.FeedbackData; Joint: TYPE = GGSegmentTypes.Joint; Line: TYPE = GGBasicTypes.Line; Point: TYPE = GGBasicTypes.Point; Scene: TYPE = REF SceneObj; SceneObj: TYPE; -- Opaque Type, Implemented by GGSceneImpl Segment: TYPE = GGSegmentTypes.Segment; SelectedObjectData: TYPE = GGSegmentTypes.SelectedObjectData; SelectionClass: TYPE = GGSegmentTypes.SelectionClass; SequenceOfReal: TYPE = GGBasicTypes.SequenceOfReal; StrokeEnd: TYPE = Imager.StrokeEnd; -- TYPE = {square, butt, round} StrokeJoint: TYPE = Imager.StrokeJoint; -- TYPE = {miter, bevel, round} Vector: TYPE = GGBasicTypes.Vector; Viewer: TYPE = ViewerClasses.Viewer; Transformation: TYPE = ImagerTransformation.Transformation; jointSize: REAL = 6; halfJointSize: REAL = 3; hotJointSize: REAL = 10; halfHotJointSize: REAL = 5; CameraData: TYPE = REF CameraDataObj; CameraDataObj: TYPE = RECORD [ quality: QualityMode _ fast, displayStyle: DisplayStyle _ print, hideHot: BOOL _ FALSE, hideAlignments: BOOL _ FALSE ]; DisplayStyle: TYPE = {print, screen}; QualityMode: TYPE = {fast, showall, quality}; DefaultData: TYPE = REF DefaultDataObj; DefaultDataObj: TYPE = RECORD [ strokeWidth: REAL _ 2.0, strokeJoint: StrokeJoint _ round, strokeEnd: StrokeEnd _ round, dashed: BOOL _ FALSE, pattern: SequenceOfReal, offset: REAL _ 0.0, length: REAL _ 0.0, strokeColor: Imager.Color,-- no color fillColor: Imager.Color _ NIL, -- no fill font: GGFont.FontData ]; SliceParts: TYPE = REF ANY; SliceDescriptor: TYPE = REF SliceDescriptorObj; SliceDescriptorObj: TYPE = RECORD [ slice: Slice, parts: SliceParts ]; Slice: TYPE = REF SliceObj; SliceObj: TYPE = RECORD [ class: SliceClass, data: REF ANY, parent: Slice, -- for when slices can be part of clusters selectedInFull: SelectedObjectData, normalSelectedParts: SliceDescriptor, -- maintained by GGSelect to improve performance hotSelectedParts: SliceDescriptor, -- maintained by GGSelect to improve performance activeSelectedParts: SliceDescriptor, -- maintained by GGSelect to improve performance nullDescriptor: SliceDescriptor, -- to reduce allocations when there is nothing to report boundBox: BoundBox _ NIL, onOverlay: BOOL _ FALSE, extraPoints: LIST OF Joint, priority: INT _ 0, -- scene order priority. 0 => in back mark: BOOL _ FALSE -- for sweeping thru scenes by Undelete mechanism ]; SliceClass: TYPE = REF SliceClassObj; SliceClassObj: TYPE = RECORD [ type: ATOM, getBoundBox: SliceBoundBoxProc, -- includes space for stroke width and control points getTightBox: SliceTightBoxProc, -- fits tightly around the graphical part of the slice copy: SliceCopyProc, drawParts: SliceDrawPartsProc, drawTransform: SliceDrawTransformProc, drawSelectionFeedback: SliceDrawSelectionFeedbackProc, drawAttractorFeedback: SliceDrawAttractorFeedbackProc, transform: SliceTransformProc, describe: SliceDescribeProc, describeHit: SliceDescribeHitProc, fileout: SliceFileoutProc, filein: SliceFileinProc, isEmptyParts: SliceIsEmptyPartsProc, isCompleteParts: SliceIsCompletePartsProc, newParts: SliceNewPartsProc, unionParts: SliceUnionPartsProc, differenceParts: SliceDifferencePartsProc, movingParts: SliceMovingPartsProc, augmentParts: SliceAugmentPartsProc, setSelectedFields: SliceSetSelectedFieldsProc, pointsInDescriptor: SlicePointsInDescriptorProc, pointPairsInDescriptor: SlicePointPairsInDescriptorProc, segmentsInDescriptor: SliceSegmentsInDescriptorProc, walkSegments: SliceWalkSegmentsProc, nextPoint: SliceNextPointProc, nextPointPair: SliceNextPointPairProc, nextSegment: SliceNextSegmentProc, closestPoint: SliceClosestPointProc, closestJointToHitData: SliceClosestJointToHitDataProc, closestPointAndTangent: SliceClosestPointAndTangentProc, closestSegment: SliceClosestSegmentProc, lineIntersection: SliceLineIntersectionProc, circleIntersection: SliceCircleIntersectionProc, hitDataAsSimpleCurve: SliceHitDataAsSimpleCurveProc, setDefaults: SliceSetDefaultsProc, setStrokeWidth: SliceSetStrokeWidthProc, getStrokeWidth: SliceGetStrokeWidthProc, setStrokeEnd: SliceSetStrokeEndProc, getStrokeEnd: SliceGetStrokeEndProc, setStrokeJoint: SliceSetStrokeJointProc, getStrokeJoint: SliceGetStrokeJointProc, setStrokeColor: SliceSetStrokeColorProc, getStrokeColor: SliceGetStrokeColorProc, setFillColor: SliceSetFillColorProc, getFillColor: SliceGetFillColorProc, setArrows: SliceSetArrowsProc, getArrows: SliceGetArrowsProc, setDashed: SliceSetDashedProc, getDashed: SliceGetDashedProc ]; SliceBoundBoxProc: TYPE = PROC [slice: Slice, parts: SliceParts _ NIL] RETURNS [box: BoundBox]; SliceTightBoxProc: TYPE = PROC [slice: Slice, parts: SliceParts _ NIL] RETURNS [box: BoundBox]; SliceCopyProc: TYPE = PROC [slice: Slice] RETURNS [copy: Slice]; SliceDrawPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts _ NIL, dc: Imager.Context, camera: CameraData, quick: BOOL]; SliceDrawTransformProc: TYPE = PROC [sliceD: SliceDescriptor, dc: Imager.Context, camera: CameraData, transform: Transformation]; SliceDrawSelectionFeedbackProc: TYPE = PROC [slice: Slice, selectedParts: SliceParts, hotParts: SliceParts, dc: Imager.Context, camera: CameraData, dragInProgress, caretIsMoving, hideHot, quick: BOOL]; SliceDrawAttractorFeedbackProc: TYPE = PROC [sliceD: SliceDescriptor, selectedParts: SliceParts, dragInProgress: BOOL, dc: Imager.Context, camera: CameraData]; SliceTransformProc: TYPE = PROC [sliceD: SliceDescriptor, transform: Transformation]; SliceDescribeProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [rope: Rope.ROPE]; SliceDescribeHitProc: TYPE = PROC [slice: Slice, hitData: REF ANY] RETURNS [rope: Rope.ROPE]; SliceFileoutProc: TYPE = PROC [slice: Slice, f: IO.STREAM]; SliceFileinProc: TYPE = PROC [f: IO.STREAM, version: REAL, feedback: FeedbackData] RETURNS [slice: Slice]; ExtendMode: TYPE = {literal, joint, controlPoint, segment, segmentRange, traj, slice, topLevel, none}; SelectMode: TYPE = ExtendMode; SliceIsEmptyPartsProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [BOOL]; SliceIsCompletePartsProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [BOOL]; SliceNewPartsProc: TYPE = PROC [slice: Slice, hitData: REF ANY, mode: SelectMode] RETURNS [sliceD: SliceDescriptor]; SliceUnionPartsProc: TYPE = PROC [partsA: SliceDescriptor, partsB: SliceDescriptor] RETURNS [aPlusB: SliceDescriptor]; SliceDifferencePartsProc: TYPE = PROC [partsA: SliceDescriptor, partsB: SliceDescriptor] RETURNS [aMinusB: SliceDescriptor]; SliceMovingPartsProc: TYPE = PROC [slice: Slice, selectedParts: SliceParts] RETURNS [background, overlay, rubber, drag: SliceDescriptor]; SliceAugmentPartsProc: TYPE = PROC [sliceD: SliceDescriptor, selectClass: SelectionClass] RETURNS [more: SliceDescriptor]; SliceSetSelectedFieldsProc: TYPE = PROC [sliceD: SliceDescriptor, selected: BOOL, selectClass: SelectionClass]; PointAndDone: TYPE = RECORD [point: Point, done: BOOL]; PointPairAndDone: TYPE = RECORD [lo, hi: Point, done: BOOL]; SlicePointsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [pointGen: PointGenerator]; SlicePointPairsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [pointPairGen: PointPairGenerator]; SliceSegmentsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [segGen: SegmentGenerator]; SliceWalkSegmentsProc: TYPE = PROC [slice: Slice, walkProc: WalkProc] RETURNS [sliceD: SliceDescriptor]; WalkProc: TYPE = PROC [seg: Segment, transform: Transformation] RETURNS [keep: BOOL]; SliceNextPointProc: TYPE = PROC [pointGen: PointGenerator] RETURNS [pointAndDone: PointAndDone]; SliceNextPointPairProc: TYPE = PROC [pointPairGen: PointPairGenerator] RETURNS [pointPairAndDone: PointPairAndDone]; SliceNextSegmentProc: TYPE = PROC [segGen: SegmentGenerator] RETURNS [seg: Segment, transform: Transformation]; SliceClosestPointProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; SliceClosestJointToHitDataProc: TYPE = PROC [sliceD: SliceDescriptor, mapPoint: Point, hitData: REF ANY] RETURNS [jointD: SliceDescriptor, point: Point]; SliceClosestPointAndTangentProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, tangent: Vector, hitData: REF ANY, success: BOOL]; SliceClosestSegmentProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; SliceLineIntersectionProc: TYPE = PROC [sliceD: SliceDescriptor, line: Line] RETURNS [points: LIST OF Point, pointCount: NAT]; SliceCircleIntersectionProc: TYPE = PROC [sliceD: SliceDescriptor, circle: Circle] RETURNS [points: LIST OF Point, pointCount: NAT]; SliceHitDataAsSimpleCurveProc: TYPE = PROC [slice: Slice, hitData: REF ANY] RETURNS [simpleCurve: REF ANY]; SliceSetDefaultsProc: TYPE = PROC [slice: Slice, parts: SliceParts, defaults: DefaultData]; SliceSetStrokeWidthProc: TYPE = PROC [slice: Slice, parts: SliceParts, strokeWidth: REAL] RETURNS [box: BoundBox]; SliceGetStrokeWidthProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [strokeWidth: REAL _ 0.0]; SliceSetStrokeEndProc: TYPE = PROC [slice: Slice, parts: SliceParts, strokeEnd: StrokeEnd]; SliceGetStrokeEndProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [strokeEnd: StrokeEnd _ round]; SliceSetStrokeJointProc: TYPE = PROC [slice: Slice, parts: SliceParts, strokeJoint: StrokeJoint]; SliceGetStrokeJointProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [strokeJoint: StrokeJoint _ round]; SliceSetStrokeColorProc: TYPE = PROC [slice: Slice, parts: SliceParts, color: Imager.Color]; SliceGetStrokeColorProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [color: Imager.Color _ NIL]; SliceSetFillColorProc: TYPE = PROC [slice: Slice, color: Imager.Color]; SliceGetFillColorProc: TYPE = PROC [slice: Slice] RETURNS [color: Imager.Color _ NIL]; SliceSetArrowsProc: TYPE = PROC [slice: Slice, parts: SliceParts, leftDown, rightUp: BOOL]; SliceGetArrowsProc: TYPE = PROC [slice: Slice] RETURNS [leftDown, rightUp: BOOL _ FALSE]; SliceSetDashedProc: TYPE = PROC [slice: Slice, parts: SliceParts, dashed: BOOL _ FALSE, pattern: SequenceOfReal _ NIL, offset: REAL _ 0.0, length: REAL _ -1.0]; SliceGetDashedProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [dashed: BOOL _ FALSE, pattern: SequenceOfReal _ NIL, offset, length: REAL _ 0.0]; OutlineDescriptor: TYPE = SliceDescriptor; OutlineDescriptorObj: TYPE = SliceDescriptorObj; Outline: TYPE = Slice; OutlineObj: TYPE = SliceObj; OutlineClass: TYPE = SliceClass; OutlineClassObj: TYPE = SliceClassObj; --OutlineBoundBoxProc: TYPE = PROC [slice: Outline, parts: SliceParts _ NIL] RETURNS [box: BoundBox]; --OutlineTightBoxProc: TYPE = PROC [slice: Outline, parts: SliceParts _ NIL] RETURNS [box: BoundBox]; --OutlineCopyProc: TYPE = PROC [slice: Outline] RETURNS [copy: Outline]; --OutlineDrawPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts _ NIL, dc: Imager.Context, camera: CameraData, quick: BOOL]; --OutlineDrawTransformProc: TYPE = PROC [sliceD: OutlineDescriptor, dc: Imager.Context, camera: CameraData, transform: Transformation]; --OutlineDrawSelectionFeedbackProc: TYPE = PROC [slice: Outline, selectedParts: SliceParts, hotParts: SliceParts, dc: Imager.Context, camera: CameraData, dragInProgress, caretIsMoving, hideHot, quick: BOOL]; --OutlineDrawAttractorFeedbackProc: TYPE = PROC [sliceD: OutlineDescriptor, selectedParts: SliceParts, dragInProgress: BOOL, dc: Imager.Context, camera: CameraData]; --OutlineTransformProc: TYPE = PROC [sliceD: OutlineDescriptor, transform: Transformation]; --OutlineDescribeProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [rope: Rope.ROPE]; --OutlineDescribeHitProc: TYPE = PROC [slice: Outline, hitData: REF ANY] RETURNS [rope: Rope.ROPE]; --OutlineFileoutProc: TYPE = PROC [slice: Outline, f: IO.STREAM]; --OutlineFileinProc: TYPE = PROC [f: IO.STREAM, version: REAL, feedback: FeedbackData] RETURNS [slice: Outline]; --OutlineEmptyPartsProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [BOOL]; --OutlineNewPartsProc: TYPE = PROC [slice: Outline, hitData: REF ANY, mode: SelectMode] RETURNS [sliceD: OutlineDescriptor]; --OutlineUnionPartsProc: TYPE = PROC [partsA: OutlineDescriptor, partsB: OutlineDescriptor] RETURNS [aPlusB: OutlineDescriptor]; --OutlineDifferencePartsProc: TYPE = PROC [partsA: OutlineDescriptor, partsB: OutlineDescriptor] RETURNS [aMinusB: OutlineDescriptor]; --OutlineMovingPartsProc: TYPE = PROC [slice: Outline, selectedParts: SliceParts] RETURNS [background, overlay, rubber, drag: OutlineDescriptor]; --OutlineAugmentPartsProc: TYPE = PROC [sliceD: OutlineDescriptor, selectClass: SelectionClass] RETURNS [more: OutlineDescriptor]; --OutlineSetSelectedFieldsProc: TYPE = PROC [sliceD: OutlineDescriptor, selected: BOOL, selectClass: SelectionClass]; --OutlinePointsInDescriptorProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [pointGen: OutlinePointGenerator]; --OutlinePointPairsInDescriptorProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [pointPairGen: OutlinePointPairGenerator]; --OutlineSegmentsInDescriptorProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [segGen: SegmentGenerator]; --OutlineNextPointProc: TYPE = PROC [pointGen: OutlinePointGenerator] RETURNS [pointAndDone: PointAndDone]; --OutlineNextPointPairProc: TYPE = PROC [pointPairGen: OutlinePointPairGenerator] RETURNS [pointPairAndDone: PointPairAndDone]; --OutlineNextSegmentProc: TYPE = PROC [segGen: SegmentGenerator] RETURNS [seg: Segment, transform: Transformation]; --OutlineClosestPointProc: TYPE = PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; --OutlineClosestJointToHitDataProc: TYPE = PROC [sliceD: OutlineDescriptor, mapPoint: Point, hitData: REF ANY] RETURNS [jointD: OutlineDescriptor, point: Point]; --OutlineClosestPointAndTangentProc: TYPE = PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, tangent: Vector, hitData: REF ANY, success: BOOL]; --OutlineClosestSegmentProc: TYPE = PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; --OutlineLineIntersectionProc: TYPE = PROC [sliceD: OutlineDescriptor, line: Line] RETURNS [points: LIST OF Point, pointCount: NAT]; --OutlineCircleIntersectionProc: TYPE = PROC [sliceD: OutlineDescriptor, circle: Circle] RETURNS [points: LIST OF Point, pointCount: NAT]; --OutlineHitDataAsSimpleCurveProc: TYPE = PROC [slice: Outline, hitData: REF ANY] RETURNS [simpleCurve: REF ANY]; --OutlineSetDefaultsProc: TYPE = PROC [slice: Outline, parts: SliceParts, defaults: DefaultData]; --OutlineSetStrokeWidthProc: TYPE = PROC [slice: Outline, parts: SliceParts, strokeWidth: REAL] RETURNS [box: BoundBox]; --OutlineGetStrokeWidthProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [strokeWidth: REAL]; --OutlineSetStrokeEndProc: TYPE = PROC [slice: Outline, parts: SliceParts, strokeEnd: StrokeEnd]; --OutlineGetStrokeEndProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [strokeEnd: StrokeEnd]; --OutlineSetStrokeJointProc: TYPE = PROC [slice: Outline, parts: SliceParts, strokeJoint: StrokeJoint]; --OutlineGetStrokeJointProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [strokeJoint: StrokeJoint]; --OutlineSetStrokeColorProc: TYPE = PROC [slice: Outline, parts: SliceParts, color: Imager.Color]; --OutlineGetStrokeColorProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [color: Imager.Color]; --OutlineSetFillColorProc: TYPE = PROC [slice: Outline, color: Imager.Color]; --OutlineGetFillColorProc: TYPE = PROC [slice: Outline] RETURNS [color: Imager.Color]; --OutlineSetArrowsProc: TYPE = PROC [slice: Outline, parts: SliceParts, leftDown, rightUp: BOOL]; --OutlineGetArrowsProc: TYPE = PROC [slice: Outline] RETURNS [leftDown, rightUp: BOOL]; --OutlineSetDashedProc: TYPE = PROC [slice: Outline, parts: SliceParts, dashed: BOOL, pattern: SequenceOfReal _ NIL, offset: REAL _ 0.0, length: REAL _ -1.0]; --OutlineGetDashedProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [dashed: BOOL, pattern: SequenceOfReal, offset, length: REAL]; Traj: TYPE = REF TrajObj; TrajObj: TYPE = RECORD [ role: FenceHoleOpen, segCount: NAT, -- the number of segments currently in this trajectory segments: Rosary.ROSARY, -- the segments themselves joints: Rosary.ROSARY, -- the segCount+1 joints at which the segments meet extraPoints: LIST OF Joint, parent: Outline, -- the parent outline of this trajectory, boundBox: BoundBox, visibleJoints: BOOL _ TRUE, strokeJoint: Imager.StrokeJoint _ round, loArrow, hiArrow: BOOL _ FALSE, selectedInPart: SelectedObjectData ]; FenceHoleOpen: TYPE = {fence, hole, open}; TrajEnd: TYPE = {lo, hi}; TrajPartType: TYPE = {none, joint, controlPoint, segment}; Sequence: TYPE = REF SequenceObj; SequenceObj: TYPE = RECORD [ traj: Traj, boundBox: BoundBox, -- bounding box of this sequence. May =seq.traj.boundBox or be tighter. segments: BitVector, joints: BitVector, controlPoints: BitMatrix, -- one BitVector per segment, one bit per CP per BitVector segCount: NAT, -- the number of segments represented by this sequence jointCount: NAT, -- the number of joints represented by this sequence controlPointCount: NAT ]; TrajGenerator: TYPE = REF TrajGeneratorObj; TrajGeneratorObj: TYPE = RECORD [ list: LIST OF Traj ]; SliceGenerator: TYPE = REF SliceGeneratorObj; SliceGeneratorObj: TYPE = RECORD [ list: LIST OF Slice ]; SliceDescriptorGenerator: TYPE = REF SliceDescriptorGeneratorObj; SliceDescriptorGeneratorObj: TYPE = RECORD [ list: LIST OF SliceDescriptor ]; EntityGenerator: TYPE = SliceGenerator; EntityGeneratorObj: TYPE = SliceGeneratorObj; OutlineGenerator: TYPE = SliceGenerator; OutlineGeneratorObj: TYPE = SliceGeneratorObj; OutlineDescriptorGenerator: TYPE = SliceDescriptorGenerator; OutlineDescriptorGeneratorObj: TYPE = SliceDescriptorGeneratorObj; SequenceGenerator: TYPE = REF SequenceGeneratorObj; SequenceGeneratorObj: TYPE = RECORD [ list: LIST OF Sequence ]; SegmentGenerator: TYPE = REF SegmentGeneratorObj; SegmentGeneratorObj: TYPE = RECORD [ traj: Traj, toGo: NAT, index: NAT _ 0, touched: NAT _ 0, -- how many segments have we considered returning (should be <= segCount). seq: Sequence, completeSeq: BOOL, sliceD: SliceDescriptor, classSpecific: REF ANY ]; JointGenerator: TYPE = REF JointGeneratorObj; JointGeneratorObj: TYPE = RECORD [ traj: Traj, toGo: NAT, index: NAT, seq: Sequence, completeSeq: BOOL _ FALSE ]; ControlPointGenerator: TYPE = REF ControlPointGeneratorObj; ControlPointGeneratorObj: TYPE = RECORD [ seq: Sequence, toGo: NAT, segIndex: NAT, -- together [segIndex, cpIndex] name the next control point to consider cpIndex: NAT ]; PointGenerator: TYPE = REF PointGeneratorObj; PointGeneratorObj: TYPE = RECORD [ sliceD: SliceDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; PointPairGenerator: TYPE = REF PointPairGeneratorObj; PointPairGeneratorObj: TYPE = RECORD [ sliceD: SliceDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; OutlinePointGenerator: TYPE = PointGenerator; OutlinePointGeneratorObj: TYPE = PointGeneratorObj; OutlinePointPairGenerator: TYPE = PointPairGenerator; OutlinePointPairGeneratorObj: TYPE = PointPairGeneratorObj; BoundBoxGenerator: TYPE = REF BoundBoxGeneratorObj; BoundBoxGeneratorObj: TYPE = RECORD [ list: LIST OF BoundBox ]; AlignmentObject: TYPE = REF ANY; -- types: AlignmentLine, AlignmentCircle, AlignmentPoint, SliceDescriptor, Sequence FeatureData: TYPE = REF FeatureDataObj; FeatureDataObj: TYPE = RECORD [ type: FeatureType, shape: AlignmentObject ]; FeatureType: TYPE = {outline, slice, distanceLine, slopeLine, angleLine, symmetryLine, radiiCircle, intersectionPoint, midpoint, anchor}; ResultFeatureType: TYPE = {outline, slice, distanceLine, slopeLine, angleLine, symmetryLine, radiiCircle, intersectionPoint, midpoint, anchor}; END. :~GGModelTypes.mesa Last edited by: Eric Bier on April 6, 1987 6:26:10 pm PDT Copyright c 1985 by Xerox Corporation. All rights reserved. Stone, August 5, 1985 2:13:37 pm PDT Pier, May 11, 1987 7:20:35 pm PDT Imported Types Joint and Control Point sizes Camera print uses Press fonts on the screen. screen uses Tioga fonts on the screen fast is for interactive use. showall is for making interpress masters which look like the screen. quality is for previewing masters on the screen and making interpress masters for final artwork. Slices Fundamentals Drawing Transforming Textual Description Parts Part Generators Hit Testing Style Fundamental Slice Routines Returns the geometric bound box for the named parts of the slice. IF parts = NIL, find the boundBox of the whole slice. The returned boundbox will allow space for control points and stroke width. Returns the tight fitting geometric bound box for the named parts of the slice. IF parts = NIL, find the boundBox of the whole slice. Drawing Slice draws its parts into the Imager context. IF parts = NIL, draw the whole slice. Slice applies transformation (temporarily) to its indicated parts, then draws itself into the Imager context. Used for rubberbanding or dragging Slice draws its selection feedback, as indicated by its parts, into the Imager context. quick is a flag which, if set, causes the slice to draw an abbreviated version of its selection feedback. During motion is true if anything in the scene is currently moving. Hide hot is TRUE if hotness feedback should not be shown. sliceD is a simple SliceDescriptor describing where on the slice, the caret has been placed. The slice should draw appropriate feedback. Transforming Apply the given transformation to internal data of the slice as specified by parts. It is now in a new position, orientation, scaling, or skewing. Textual Description Return a short description of slice and parts suitable for feedback line. Return a short description of hitData suitable for feedback line. Write a description of yourself onto stream f. Read a description of yourself from stream f. Parts SelectMode is used in SliceNewPartsProc. It is used to decide what kind of descriptor to build given a Slice and a HitData. It is interpreted as follows: literal => Select the hit part. joint => Select a joint or control point near the hit part. controlPoint => Has no meaning for SliceNewPartsProc. segment => Select a segment near that hit part. segmentRange => Has no meaning for SliceNewPartsProc. traj => Select the entire path that includes the hit part. slice => Select the entire slice that most immediately includes the hit part. topLevel => Select the largest slice that includes the slice that includes the hit part. none => return an empty descriptor. Returns a class-specific description of its parts to be used in calls to SelectSlice. Parts are determined from the mode and from the hitData within the slice, which was set by the slice during calls to SliceClosest* procs. Takes two parts descriptions and returns their union. This routine is used by the ExtendSelection routines. Takes two parts descriptions and returns their difference. This routine is used by the Deselection routines. We are about to perform a drag operation. Some parts of the object will stay in the background plane, some will be drawn on the overlay plane but stay stationary, some will rubber-band, and some will be dragged as a unit. This procedure identifies these four classes of parts. Takes a parts description (usually the selected parts just before a SelectSlice operation) and returns a parts descriptor which describes parts which should be selected as well. Used so that slices with segment/joint analogies can behave like polygons. Part Generators The SliceWalkSegmentsProc takes a slice and calls the walkProc for each segment in the slice with the segment data and possibly an associated transformation. It returns a slice descriptor which describes all segments of the slice for which the walkProc returned TRUE. Hit Testing Used for hit testing. Find the nearest point on the parts of sliceD to testPoint. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a joint number, if the class objects have joints. This slice has been hit somewhere (perhaps on a segment). Find the closest joint to that segment point. Return its position and a descriptor of it. Used for hit testing. Find the nearest point on the parts of sliceD to testPoint and the tangent vector (towards hi end of segment) at that point. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a joint number, if the class objects have joints. Used for hit testing. Find the nearest segment of the parts of sliceD to testPoint. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a segment number, if the class objects has segments. Finds the intersection of the line with those slice parts mentioned in sliceD. Finds the intersection of the circle with those slice parts mentioned in sliceD. simpleCurve will be of type Edge, Arc, etc. There will be Conic and Bezier types as well. Style Sets the stroke width of the named parts of slice to be strokeWidth. Returns the bounding box of all elements of the slice that will require refreshing as a result of the change. Get the stroke width of the named parts of slice. Sets the stroke end of the named parts of slice to be strokeEnd. Get the stroke end of the named parts of slice. Sets the stroke Joint of the named parts of slice to be strokeJoint. Get the stroke Joint of the named parts of slice. Sets the stroke color of the named parts of slice to be color. Get the stroke color of the named parts of slice. Sets the fill color of the slice to be color. Get the fill color of the slice. Sets the arrow ends of the named parts of the slice. Get the arrow ends of the named parts of the slice. Outlines OutlineDescriptor: TYPE = REF OutlineDescriptorObj; OutlineDescriptorObj: TYPE = RECORD [ slice: Outline, parts: SliceParts ]; Outline: TYPE = REF OutlineObj; OutlineObj: TYPE = RECORD [ class: OutlineClass, data: REF ANY, fillColor: Imager.Color, -- store in data lineEnds: Imager.StrokeEnd, -- store in data. OBSOLETE: use individual traj.strokeEnd children: LIST OF Traj, -- store in data parent: Slice, -- for when slices can be part of clusters selectedInFull: SelectedObjectData, normalSelectedParts: OutlineDescriptor, -- maintained by GGSelect to improve performance hotSelectedParts: OutlineDescriptor, -- maintained by GGSelect to improve performance activeSelectedParts: OutlineDescriptor, -- maintained by GGSelect to improve performance nullDescriptor: OutlineDescriptor, -- to reduce allocations when there is nothing to report boundBox: BoundBox, onOverlay: BOOL _ FALSE, extraPoints: LIST OF Joint, priority: INT _ 0, -- scene order priority. 0 => in back mark: BOOL _ FALSE -- for sweeping thru scenes by Undelete mechanism ]; OutlineClass: TYPE = REF OutlineClassObj; OutlineClassObj: TYPE = RECORD [ type: ATOM, Fundamentals getBoundBox: OutlineBoundBoxProc, getTightBox: OutlineTightBoxProc, copy: OutlineCopyProc, Drawing drawParts: OutlineDrawPartsProc, drawTransform: OutlineDrawTransformProc, drawSelectionFeedback: OutlineDrawSelectionFeedbackProc, drawAttractorFeedback: OutlineDrawAttractorFeedbackProc, Transforming transform: OutlineTransformProc, Textual Description describe: OutlineDescribeProc, describeHit: OutlineDescribeHitProc, fileout: OutlineFileoutProc, filein: OutlineFileinProc, Parts emptyParts: OutlineEmptyPartsProc, newParts: OutlineNewPartsProc, unionParts: OutlineUnionPartsProc, differenceParts: OutlineDifferencePartsProc, movingParts: OutlineMovingPartsProc, augmentParts: OutlineAugmentPartsProc, setSelectedFields: OutlineSetSelectedFieldsProc, Part Generators pointsInDescriptor: OutlinePointsInDescriptorProc, pointPairsInDescriptor: OutlinePointPairsInDescriptorProc, segmentsInDescriptor: OutlineSegmentsInDescriptorProc, nextPoint: OutlineNextPointProc, nextPointPair: OutlineNextPointPairProc, nextSegment: OutlineNextSegmentProc, Hit Testing closestPoint: OutlineClosestPointProc, closestJointToHitData: OutlineClosestJointToHitDataProc, closestPointAndTangent: OutlineClosestPointAndTangentProc, closestSegment: OutlineClosestSegmentProc, lineIntersection: OutlineLineIntersectionProc, circleIntersection: OutlineCircleIntersectionProc, hitDataAsSimpleCurve: OutlineHitDataAsSimpleCurveProc, Style setDefaults: OutlineSetDefaultsProc, setStrokeWidth: OutlineSetStrokeWidthProc, getStrokeWidth: OutlineGetStrokeWidthProc, setStrokeEnd: OutlineSetStrokeEndProc, getStrokeEnd: OutlineGetStrokeEndProc, setStrokeJoint: OutlineSetStrokeJointProc, getStrokeJoint: OutlineGetStrokeJointProc, setStrokeColor: OutlineSetStrokeColorProc, getStrokeColor: OutlineGetStrokeColorProc, setFillColor: OutlineSetFillColorProc, getFillColor: OutlineGetFillColorProc, setArrows: OutlineSetArrowsProc, getArrows: OutlineGetArrowsProc, setDashed: OutlineSetDashedProc, getDashed: OutlineGetDashedProc ]; Fundamentals Returns the geometric bounds the named parts of the outline. If parts = NIL, return the boundbox of the whole outline. Allows space for control points and stroke width. Returns the tight geometric bounds the named parts of the outline. If parts = NIL, return the boundbox of the whole outline. Drawing sliceD is a simple SliceDescriptor describing where on the slice, the caret has been placed. The slice should draw appropriate feedback. Transforming Apply the given transformation to internal data of the slice as specified by parts. It is now in a new position, orientation, scaling, or skewing. Return a short description of slice and parts suitable for feedback line. Return a short description of hitData suitable for feedback line. Write a description of yourself onto stream f. Read a description of yourself from stream f. Parts Takes two parts descriptions and returns their union. This routine is used by the ExtendSelection routines. Takes two parts descriptions and returns their difference. This routine is used by the Deselection routines. Takes a parts description (usually the selected parts just before a Drag operation) and returns a parts descriptor which describes everything in the slice that will move when the input parts are moved. Part Generators Hit Testing Used for hit testing. Find the nearest point on the parts of sliceD to testPoint. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a joint number, if the class objects have joints. This slice has been hit somewhere (perhaps on a segment). Find the closest joint to that segment point. Return its position and a descriptor of it. Used for hit testing. Find the nearest point on the parts of sliceD to testPoint and the tangent vector (towards hi end of segment) at that point. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a joint number, if the class objects have joints. Used for hit testing. Find the nearest segment of the parts of sliceD to testPoint. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If the nearest point is farther away than tolerance units, this procedure may opt to return success = FALSE. If a valid point is returned, then success = TRUE. The proc should fill in slice.hitData, which is class-specific data describing the actual part of the slice that was closest. For some classes, this data will be a segment number, if the class objects has segments. Finds the intersection of the line with those slice parts mentioned in sliceD. Finds the intersection of the circle with those slice parts mentioned in sliceD. simpleCurve will be of type Edge, Arc, etc. There will be Conic and Bezier types as well. Style Sets the stroke width of the named parts of slice to be strokeWidth. Returns the bounding box of all elements of the slice that will require refreshing as a result of the change. Get the stroke width of the named parts of slice. Sets the stroke end of the named parts of slice to be strokeEnd. Get the stroke end of the named parts of slice. Sets the stroke joint of the named parts of slice to be StrokeJoint. Get the stroke joint of the named parts of slice. Sets the stroke color of the named parts of slice to be color. Get the stroke color of the named parts of slice. Sets the fill color of the slice to be color. Get the fill color of the slice. Sets the arrow ends of the named parts of the slice. Get the arrow ends of the named parts of the slice. Outline Parts Segments refer to joints (and other control points), and have drawing styles. Joints have a position and a continuity constraint Generators EntityGenerator: TYPE = REF EntityGeneratorObj; EntityGeneratorObj: TYPE = RECORD [ list: LIST OF REF ANY, countValid: BOOL _ FALSE, count: NAT ]; OutlineGenerator: TYPE = REF OutlineGeneratorObj; OutlineGeneratorObj: TYPE = RECORD [ list: LIST OF Outline ]; OutlineDescriptorGenerator: TYPE = REF OutlineDescriptorGeneratorObj; OutlineDescriptorGeneratorObj: TYPE = RECORD [ list: LIST OF OutlineDescriptor ]; outlineD: OutlineDescriptor, OutlinePointGenerator: TYPE = REF OutlinePointGeneratorObj; OutlinePointGeneratorObj: TYPE = RECORD [ outlineD: OutlineDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; OutlinePointPairGenerator: TYPE = REF OutlinePointPairGeneratorObj; OutlinePointPairGeneratorObj: TYPE = RECORD [ outlineD: OutlineDescriptor, toGo: NAT, index: NAT, classSpecific: REF ANY ]; Gravity and Alignments ÊV˜Icodešœ™Kšœ9™9šœ<™™>—š Ÿœœœ#œœ˜kKšœ1™1—šŸœœœ%˜GKšœ-™-—š Ÿœœœœœ˜VKšœ ™ —šŸœœœ6œ˜[Kšœ4™4—š Ÿœœœœœœ˜YKšœ3™3—KšŸœœœ+ œœ œœ ˜ KšŸœœœ#œ œœœœ˜œK™KšŸ™Kšœœ˜*Kšœœ˜0Kšœœœ™3šœœœ™%K™K™K™—K˜Kšœ œ ˜Kšœ œ ˜Kšœ œœ ™šœ œœ™K™Kšœœœ™Kšœ ™*Kšœ 9™VKšœ œœ ™(Kšœ *™:Kšœ#™#Kšœ( 0™XKšœ& 0™VKšœ) 0™YKšœ$ 8™\K™Kšœ œœ™Kšœ œœ™Kšœ œ %™8Kšœœœ 1™DK™K™—Kšœœ˜ Kšœœ˜&Kšœœœ™)šœœœ™ šœœ™ KšŸ ™ —K™!K™!™KšŸ™—K™ K™(K™8™8KšŸ ™ —™ KšŸ™—K™K™$K™™KšŸ™—K™"K™K™"K™,K™$K™&™0KšŸ™—K™2K™:K™6K™ K™(™$KšŸ ™ —K™&K™8K™:Kšœ*™*K™.K™2™6KšŸ™—K™$K™*K™*K™&K™&K™*K™*K™*K™*K™&K™&K™ K™ K™ K™K™—K™šœ ™ K˜—š œŸœœœ&œœ˜eKšœIœ^™ª—š œŸœœœ&œœ˜eKšœOœ+™}—Kš œŸœœœœ˜HK™Kšœ™Kš œŸœœœ&œ1œ˜ƒKšœŸœœœ`˜‡Kš œŸ œœœšœ˜Ïš œŸ œœœHœ*˜¥Kšœ‰™‰—K™Kšœ ™ šœŸœœœ8˜[K™“—š œŸœœœœ œ˜YK™I—šœŸœœœœœœ œ˜cKšœA™A—š œŸœœœœœ˜AK™.—šœŸœœœœœ œœ˜pK™-—K˜Kšœ™K˜Kš œŸœœœœœ˜PKš œŸœœœœœœ˜|š œŸœœœ8œ˜€K™m—š œŸœœœ8œ˜†K™m—š œŸœœœ-œ8˜‘K™É—Kš œŸœœœ:œ˜‚Kš œŸœœœ'œ˜uK™Kšœ™Kš œŸœœœœ#˜sKš œŸ!œœœœ+˜Kš œŸœœœœ˜nKš œŸœœœ#œ˜kKš œŸœœœ+œ&˜Kš œŸœœœœ+˜sK˜K˜Kšœ ™ šœŸœœœ:œœœ œœ œ˜²Kšœºœ0œÖ™É—š œŸ œœœ7œœœ+˜¡K™•—šœŸ!œœœ:œœœœœ œ˜ÍKšœûœ0œÖ™Š—šœŸœœœ:œœœ œœ œ˜´Kšœ¼œiœ0œÙ™¼—šœŸœœœ)œ œœœ˜„KšœN™N—šœŸœœœ-œ œœœ˜ŠKšœP™P—šœŸœœœœœœœœ˜qKšœZ™Z—K˜Kšœ™KšŸœœœ<˜aš œŸœœœ2œœ˜xKšœ³™³—š œŸœœœ%œœ˜iKšœ1™1—šœŸœœœ;˜aKšœ@™@—š œŸœœœ%œ˜jKšœ/™/—šœŸœœœ?˜gKšœD™D—š œŸœœœ%œ˜pKšœ1™1—šœŸœœœ:˜bKšœ>™>—š œŸœœœ%œ˜kKšœ1™1—šœŸœœœ'˜MKšœ-™-—š œŸœœœœ˜VKšœ ™ —š œŸœœœ8œ˜aKšœ4™4—š œŸœœœœœ˜WKšœ3™3—KšœŸœœœ-œœ œœ ˜žKš œŸœœœ%œ œ+œ˜ŽK˜KšŸ ™ K™Kšœœœ ˜šœ œœ˜K˜Kšœ œ 6˜Ešœœ ˜3K™M—šœœ 3˜JK™2—Kšœ œœ˜Kšœ )˜:Kšœ˜Kšœœœ˜Kšœ(˜(Kšœœœ˜Kšœ"˜"Kšœ˜—Kšœœ˜*Kšœ œ ˜Kšœœ(˜:K˜Kšœ œœ ˜!šœ œœ˜K˜ Kšœ G˜[Kšœ˜Kšœ˜Kšœ :˜TKšœ œ 6˜EKšœ œ 4˜EKšœ˜K˜—K™KšŸ ™ K™Kšœœœ˜+šœœœ˜!Kšœœœ˜K˜K˜—Kšœœœ˜-šœœœ˜"Kšœœœ˜K˜K˜—Kšœœœ˜Ašœœœ˜,Kšœœœ˜K˜K˜—Kšœœ˜'Kšœœ˜-Kšœœœ™/šœœœ™#Kš œœœœœ™Kšœ œœ™Kšœ™ K™K™—Kšœœ˜(Kšœœ˜.Kšœœœ™1šœœœ™$Kšœœœ™K™K™—Kšœœ˜