DIRECTORY GGBasicTypes, GGSegmentTypes, Imager, ImagerPath, ImagerTransformation, IO, Rope, Rosary, ViewerClasses; GGModelTypes: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; Point: TYPE = GGBasicTypes.Point; Vector: TYPE = GGBasicTypes.Vector; Line: TYPE = GGBasicTypes.Line; Circle: TYPE = GGBasicTypes.Circle; BoundBox: TYPE = GGBasicTypes.BoundBox; BitVector: TYPE = GGBasicTypes.BitVector; BitMatrix: TYPE = GGBasicTypes.BitMatrix; SequenceOfReal: TYPE = GGBasicTypes.SequenceOfReal; SelectedObjectData: TYPE = GGSegmentTypes.SelectedObjectData; SelectionClass: TYPE = GGSegmentTypes.SelectionClass; Joint: TYPE = GGSegmentTypes.Joint; jointSize: REAL = 6; halfJointSize: REAL = 3; hotJointSize: REAL = 10; halfHotJointSize: REAL = 5; Scene: TYPE = REF SceneObj; SceneObj: TYPE; -- Opaque Type, Implemented by GGObjectsImpl 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}; SliceDescriptor: TYPE = REF SliceDescriptorObj; SliceDescriptorObj: TYPE = RECORD [ slice: Slice, parts: SliceParts ]; SliceParts: TYPE = REF ANY; 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: SliceParts, -- maintained by GGSelect to improve performance hotSelectedParts: SliceParts, -- maintained by GGSelect to improve performance activeSelectedParts: SliceParts, -- maintained by GGSelect to improve performance 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, fileout: SliceFileoutProc, filein: SliceFileinProc, emptyParts: SliceEmptyPartsProc, newParts: SliceNewPartsProc, unionParts: SliceUnionPartsProc, differenceParts: SliceDifferencePartsProc, movingParts: SliceMovingPartsProc, fixedParts: SliceFixedPartsProc, augmentParts: SliceAugmentPartsProc, setSelectedFields: SliceSetSelectedFieldsProc, pointsInDescriptor: SlicePointsInDescriptorProc, pointPairsInDescriptor: SlicePointPairsInDescriptorProc, nextPoint: SliceNextPointProc, nextPointPair: SliceNextPointPairProc, closestPoint: SliceClosestPointProc, closestPointAndTangent: SliceClosestPointAndTangentProc, closestSegment: SliceClosestSegmentProc, lineIntersection: SliceLineIntersectionProc, circleIntersection: SliceCircleIntersectionProc, hitDataAsSimpleCurve: SliceHitDataAsSimpleCurveProc, setStrokeWidth: SliceSetStrokeWidthProc, getStrokeWidth: SliceGetStrokeWidthProc, setStrokeColor: SliceSetStrokeColorProc, getStrokeColor: SliceGetStrokeColorProc, setFillColor: SliceSetFillColorProc, getFillColor: SliceGetFillColorProc, setArrows: SliceSetArrowsProc, getArrows: SliceGetArrowsProc, setDashed: SliceSetDashedProc, getDashed: SliceGetDashedProc ]; SliceBoundBoxProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [box: BoundBox]; SliceTightBoxProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [box: BoundBox]; SliceCopyProc: TYPE = PROC [slice: Slice] RETURNS [copy: Slice]; SliceDrawPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts, dc: Imager.Context, camera: CameraData, quick: BOOL]; SliceDrawTransformProc: TYPE = PROC [slice: Slice, parts: SliceParts, dc: Imager.Context, camera: CameraData, transform: ImagerTransformation.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 [slice: Slice, parts: SliceParts, transform: ImagerTransformation.Transformation]; SliceDescribeProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [rope: Rope.ROPE]; SliceFileoutProc: TYPE = PROC [slice: Slice, f: IO.STREAM]; SliceFileinProc: TYPE = PROC [f: IO.STREAM, version: REAL, feedback: Viewer] RETURNS [slice: Slice]; ExtendMode: TYPE = {joint, controlPoint, segment, segmentRange, traj, outline, slice, topLevel, none}; SelectMode: TYPE = ExtendMode; SlicePointsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [pointGen: PointGenerator]; SlicePointPairsInDescriptorProc: TYPE = PROC [sliceD: SliceDescriptor] RETURNS [pointPairGen: PointPairGenerator]; SliceNextPointProc: TYPE = PROC [pointGen: PointGenerator] RETURNS [pointAndDone: PointAndDone]; SliceNextPointPairProc: TYPE = PROC [pointPairGen: PointPairGenerator] RETURNS [pointPairAndDone: PointPairAndDone]; PointAndDone: TYPE = RECORD [point: Point, done: BOOL]; PointPairAndDone: TYPE = RECORD [lo, hi: Point, done: BOOL]; SliceEmptyPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [BOOL]; SliceNewPartsProc: TYPE = PROC [slice: Slice, hitData: REF ANY, mode: SelectMode] RETURNS [parts: SliceParts]; SliceUnionPartsProc: TYPE = PROC [slice: Slice, partsA: SliceParts, partsB: SliceParts] RETURNS [aPlusB: SliceParts]; SliceDifferencePartsProc: TYPE = PROC [slice: Slice, partsA: SliceParts, partsB: SliceParts] RETURNS [aMinusB: SliceParts]; SliceMovingPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [moving: SliceParts]; SliceFixedPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts, selectedList: LIST OF REF ANY] RETURNS [fixed: SliceParts]; SliceAugmentPartsProc: TYPE = PROC [slice: Slice, parts: SliceParts, selectClass: SelectionClass] RETURNS [more: SliceParts]; SliceSetSelectedFieldsProc: TYPE = PROC [sliceD: SliceDescriptor, selected: BOOL, selectClass: SelectionClass]; SliceClosestPointProc: TYPE = PROC [sliceD: SliceDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; 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]; SliceSetStrokeWidthProc: TYPE = PROC [slice: Slice, parts: SliceParts, strokeWidth: REAL]; SliceGetStrokeWidthProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [strokeWidth: REAL]; SliceSetStrokeColorProc: TYPE = PROC [slice: Slice, parts: SliceParts, color: Imager.Color]; SliceGetStrokeColorProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [color: Imager.Color]; SliceSetFillColorProc: TYPE = PROC [slice: Slice, color: Imager.Color]; SliceGetFillColorProc: TYPE = PROC [slice: Slice] RETURNS [color: Imager.Color]; SliceSetArrowsProc: TYPE = PROC [slice: Slice, parts: SliceParts, leftDown, rightUp: BOOL]; SliceGetArrowsProc: TYPE = PROC [slice: Slice] RETURNS [leftDown, rightUp: BOOL]; SliceSetDashedProc: TYPE = PROC [slice: Slice, parts: SliceParts, dashed: BOOL, pattern: SequenceOfReal _ NIL, offset: REAL _ 0.0, length: REAL _ -1.0]; SliceGetDashedProc: TYPE = PROC [slice: Slice, parts: SliceParts] RETURNS [dashed: BOOL, pattern: SequenceOfReal, offset, length: REAL]; OutlineDescriptor: TYPE = REF OutlineDescriptorObj; OutlineDescriptorObj: TYPE = RECORD [ slice: Outline, parts: SliceParts ]; Outline: TYPE = REF OutlineObj; OutlineObj: TYPE = RECORD [ class: OutlineClass, fillColor: Imager.Color, -- store in data lineEnds: Imager.StrokeEnd, -- store in data children: LIST OF Traj, -- store in data parent: Slice, -- for when slices can be part of clusters normalSelectedParts: SliceParts, -- maintained by GGSelect to improve performance hotSelectedParts: SliceParts, -- maintained by GGSelect to improve performance activeSelectedParts: SliceParts, -- maintained by GGSelect to improve performance boundBox: BoundBox, onOverlay: BOOL _ FALSE, 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, getBoundBox: OutlineBoundBoxProc, getTightBox: OutlineTightBoxProc, copy: OutlineCopyProc, drawParts: OutlineDrawPartsProc, drawTransform: OutlineDrawTransformProc, drawSelectionFeedback: OutlineDrawSelectionFeedbackProc, drawAttractorFeedback: OutlineDrawAttractorFeedbackProc, transform: OutlineTransformProc, describe: OutlineDescribeProc, fileout: OutlineFileoutProc, filein: OutlineFileinProc, emptyParts: OutlineEmptyPartsProc, newParts: OutlineNewPartsProc, unionParts: OutlineUnionPartsProc, differenceParts: OutlineDifferencePartsProc, movingParts: OutlineMovingPartsProc, fixedParts: OutlineFixedPartsProc, augmentParts: OutlineAugmentPartsProc, setSelectedFields: OutlineSetSelectedFieldsProc, pointsInDescriptor: OutlinePointsInDescriptorProc, pointPairsInDescriptor: OutlinePointPairsInDescriptorProc, nextPoint: OutlineNextPointProc, nextPointPair: OutlineNextPointPairProc, closestPoint: OutlineClosestPointProc, closestPointAndTangent: OutlineClosestPointAndTangentProc, closestSegment: OutlineClosestSegmentProc, lineIntersection: OutlineLineIntersectionProc, circleIntersection: OutlineCircleIntersectionProc, hitDataAsSimpleCurve: OutlineHitDataAsSimpleCurveProc, setStrokeWidth: OutlineSetStrokeWidthProc, getStrokeWidth: OutlineGetStrokeWidthProc, setStrokeColor: OutlineSetStrokeColorProc, getStrokeColor: OutlineGetStrokeColorProc, setFillColor: OutlineSetFillColorProc, getFillColor: OutlineGetFillColorProc, setArrows: OutlineSetArrowsProc, getArrows: OutlineGetArrowsProc, setDashed: OutlineSetDashedProc, getDashed: OutlineGetDashedProc ]; OutlineBoundBoxProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [box: BoundBox]; OutlineTightBoxProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [box: BoundBox]; OutlineCopyProc: TYPE = PROC [slice: Outline] RETURNS [copy: Outline]; OutlineDrawPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts, dc: Imager.Context, camera: CameraData, quick: BOOL]; OutlineDrawTransformProc: TYPE = PROC [slice: Outline, parts: SliceParts, dc: Imager.Context, camera: CameraData, transform: ImagerTransformation.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 [slice: Outline, parts: SliceParts, transform: ImagerTransformation.Transformation]; OutlineDescribeProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [rope: Rope.ROPE]; OutlineFileoutProc: TYPE = PROC [slice: Outline, f: IO.STREAM]; OutlineFileinProc: TYPE = PROC [f: IO.STREAM, version: REAL, feedback: Viewer] RETURNS [slice: Outline]; OutlinePointsInDescriptorProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [pointGen: OutlinePointGenerator]; OutlinePointPairsInDescriptorProc: TYPE = PROC [sliceD: OutlineDescriptor] RETURNS [pointPairGen: OutlinePointPairGenerator]; OutlineNextPointProc: TYPE = PROC [pointGen: OutlinePointGenerator] RETURNS [pointAndDone: PointAndDone]; OutlineNextPointPairProc: TYPE = PROC [pointPairGen: OutlinePointPairGenerator] RETURNS [pointPairAndDone: PointPairAndDone]; OutlineEmptyPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [BOOL]; OutlineNewPartsProc: TYPE = PROC [slice: Outline, hitData: REF ANY, mode: SelectMode] RETURNS [parts: SliceParts]; OutlineUnionPartsProc: TYPE = PROC [slice: Outline, partsA: SliceParts, partsB: SliceParts] RETURNS [aPlusB: SliceParts]; OutlineDifferencePartsProc: TYPE = PROC [slice: Outline, partsA: SliceParts, partsB: SliceParts] RETURNS [aMinusB: SliceParts]; OutlineMovingPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [moving: SliceParts]; OutlineFixedPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts, selectedList: LIST OF REF ANY] RETURNS [fixed: SliceParts]; OutlineAugmentPartsProc: TYPE = PROC [slice: Outline, parts: SliceParts, selectClass: SelectionClass] RETURNS [more: SliceParts]; OutlineSetSelectedFieldsProc: TYPE = PROC [sliceD: OutlineDescriptor, selected: BOOL, selectClass: SelectionClass]; OutlineClosestPointProc: TYPE = PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL]; 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]; OutlineSetStrokeWidthProc: TYPE = PROC [slice: Outline, parts: SliceParts, strokeWidth: REAL]; OutlineGetStrokeWidthProc: TYPE = PROC [slice: Outline, parts: SliceParts] RETURNS [strokeWidth: REAL]; 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}; 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 ]; EntityGenerator: TYPE = REF EntityGeneratorObj; EntityGeneratorObj: TYPE = RECORD [ list: LIST OF REF ANY, countValid: BOOL _ FALSE, count: NAT ]; TrajGenerator: TYPE = REF TrajGeneratorObj; TrajGeneratorObj: TYPE = RECORD [ list: LIST OF Traj ]; OutlineGenerator: TYPE = REF OutlineGeneratorObj; OutlineGeneratorObj: TYPE = RECORD [ list: LIST OF Outline ]; OutlineDescriptorGenerator: TYPE = REF OutlineDescriptorGeneratorObj; OutlineDescriptorGeneratorObj: TYPE = RECORD [ list: LIST OF OutlineDescriptor ]; SliceGenerator: TYPE = REF SliceGeneratorObj; SliceGeneratorObj: TYPE = RECORD [ list: LIST OF Slice ]; SliceDescriptorGenerator: TYPE = REF SliceDescriptorGeneratorObj; SliceDescriptorGeneratorObj: TYPE = RECORD [ list: LIST OF SliceDescriptor ]; 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 ]; 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 = 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 ]; 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, resultType: ResultFeatureType, hitPart: REF ANY, -- types: SequencePart, BoxHitData, CircleHitData, ... visible: BOOL _ FALSE ]; FeatureType: TYPE = {outline, slice, distanceLine, slopeLine, angleLine, symmetryLine, radiiCircle, intersectionPoint, midpoint, anchor}; ResultFeatureType: TYPE = {outline, slice, distanceLine, slopeLine, angleLine, symmetryLine, radiiCircle, intersectionPoint, midpoint, anchor}; TrajPartType: TYPE = {none, joint, controlPoint, segment}; END. %<GGModelTypes.mesa Last edited by: Eric Bier on January 22, 1987 4:34:50 pm PST Copyright c 1985 by Xerox Corporation. All rights reserved. Stone, August 5, 1985 2:13:37 pm PDT Pier, October 21, 1986 1:17:19 pm PDT Imported Types Joint and Control Point sizes Scene and View 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. 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. 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. Write a description of yourself onto stream f. Read a description of yourself from stream f. Describing Parts of the Slice 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. 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. 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 NOT move when the input parts are moved. selectedList is gargoyleData.selected.normal. 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. 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. 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. Get the stroke width 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 data: REF ANY, selectedInFull: SelectedObjectData, extraPoints: LIST OF Joint, A Temporary Class Type (until Outlines become real Slices) Fundamentals Drawing Transforming Textual Description Parts Hit Testing Style Fundamental Outline Routines 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. sliceD is a simple SliceDescriptor describing where on the slice, the caret has been placed. The slice should draw appropriate feedback. 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. Write a description of yourself onto stream f. Read a description of yourself from stream f. Describing Parts of the Outline 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. 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 NOT move when the input parts are moved. 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. 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. Get the stroke width 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 Gravity and Alignments Ê ˜Icodešœ™Kšœ<™<šœ<™™>—šŸœœœ#œ˜eKšœ1™1—šŸœœœ%˜GKšœ-™-—šŸœœœœ˜PKšœ ™ —šŸœœœ6œ˜[Kšœ4™4—š Ÿœœœœœ˜QKšœ3™3—KšŸœœœ+œœ œœ ˜˜Kš Ÿœœœ#œ œ+œ˜ˆK™KšŸ™Kšœœœ˜3šœœœ˜%K˜K˜K˜—Kšœ œœ ˜šœ œœ˜K˜Kšœœœ™K˜*Kšœ-˜-Kšœ œœ˜(K˜:Kšœ#™#Kšœ! 0˜QKšœ 0˜OKšœ" 0˜RK˜Kšœ œœ˜Kšœ œœ™Kšœ œ %˜8Kšœœœ 1˜DK˜—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˜ K˜(K˜&K˜:Kšœ*˜*K˜.K˜2˜6KšŸ™—K˜*K˜*K˜*K˜*K˜&K˜&K˜ K˜ K˜ K˜K˜K˜—K™K™K˜šŸœœœ$œ˜]Kšœª™ª—šŸœœœ$œ˜]Kšœ}™}—KšŸœœœœ˜FKšŸœœœTœ˜{KšŸœœœ}˜¢KšŸ œœœšœ˜ÍšŸ œœœHœ*˜£Kšœ‰™‰—šŸœœœU˜vK™“—š Ÿœœœ%œ œ˜_K™I—š Ÿœœœœœ˜?K™.—šŸœœœœœ œœ˜hK™-—K˜K™K˜KšŸœœœœ#˜qKšŸ!œœœœ+˜}KšŸœœœ#œ˜iKšŸœœœ+œ&˜}K˜Kš Ÿœœœ%œœ˜VKš Ÿœœœœœœ˜ršŸœœœ:œ˜yK™m—šŸœœœ:œ˜K™m—šŸœœœ%œ˜eK™É—šœœœ3œœœœœ˜‚K™Í—KšŸœœœBœ˜KšŸœœœ'œ˜sK˜K™ K˜šŸœœœ:œœœ œœ œ˜°KšœÉ™É—šŸ!œœœ:œœœœœ œ˜ËKšœŠ™Š—šŸœœœ:œœœ œœ œ˜²Kšœ¼™¼—šŸœœœ)œ œœœ˜‚KšœN™N—šŸœœœ-œ œœœ˜ˆKšœP™P—šŸœœœœœœœœ˜oKšœZ™Z—K˜K™K˜šŸœœœ2œ˜^KšœD™D—š Ÿœœœ%œœ˜gKšœ1™1—šŸœœœ:˜`Kšœ>™>—šŸœœœ%œ˜iKšœ1™1—šŸœœœ'˜KKšœ-™-—šŸœœœœ˜TKšœ ™ —šŸœœœ8œ˜_Kšœ4™4—š Ÿœœœœœ˜UKšœ3™3—KšŸœœœ-œœ œœ ˜œ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šœ G˜[Kšœ˜Kšœ˜Kšœ :˜TKšœ œ 6˜EKšœ œ 4˜EKšœ˜K˜—K™KšŸ ™ K™Kšœœœ˜/šœœœ˜#Kš œœœœœ˜Kšœ œœ˜Kšœ˜ K˜K™—Kšœœœ˜+šœœœ˜!Kšœœœ˜K˜K˜—Kšœœœ˜1šœœœ˜$Kšœœœ˜K˜K˜—Kšœœœ˜Ešœœœ˜.Kšœœœ˜K˜K˜—Kšœœœ˜-šœœœ˜"Kšœœœ˜K˜K˜—Kšœœœ˜Ašœœœ˜,Kšœœœ˜K˜K˜—Kšœœœ˜3šœœœ˜%Kšœœœ ˜K˜K˜—Kšœœœ˜1šœœœ˜$Kšœ ˜ Kšœœ˜ Kšœœ˜Kšœ œP˜\K˜Kšœ ˜K˜K˜—šœœœ˜-šœœœ˜"Kšœ ˜ Kšœœ˜ Kšœœ˜ K˜Kšœ œ˜K˜K˜——šœœœ˜;šœœœ˜)Kšœ˜Kšœœ˜ Kšœ œ G˜VKšœ ˜ Kšœ˜K˜——šœœœ˜-šœœœ˜"Kšœ˜Kšœœ˜ Kšœœ˜ Kšœœ˜K˜K˜——šœœœ˜5šœœœ˜&Kšœ˜Kšœœ˜ Kšœœ˜ Kšœœ˜K˜K˜——šœœœ˜;šœœœ˜)Kšœ˜Kšœœ˜ Kšœœ˜ Kšœœ˜K˜K˜——šœœœ˜Cšœœœ˜-Kšœ˜Kšœœ˜ Kšœœ˜ Kšœœ˜K˜—K˜—Kšœœœ˜3šœœœ˜%Kšœœœ ˜K˜K˜—KšŸ™K™Kšœœœœ S˜tKšœ œœ˜'šœœœ˜Kšœ˜Kšœ˜K˜Kšœ œœ 6˜HKšœ œ˜K˜—Kšœ œx˜‰Kšœœx˜šœœ(˜:K˜—Kšœ˜—…—Lœ†ø