<> <> <> <> <<>> DIRECTORY AtomButtonsTypes, Feedback, FunctionCache, GGBasicTypes, GGBoundBox, GGCircles, GGInterfaceTypes, GGModelTypes, GGSegment, GGSegmentTypes, GGParseIn, GGParseOut, GGShapes, GGSlice, GGUtility, Imager, ImagerPath, ImagerTransformation, IO, Lines2d, NodeStyle, RealFns, Rope, Vectors2d, ViewerClasses; GGSliceImplC: CEDAR PROGRAM IMPORTS Feedback, FunctionCache, GGBoundBox, GGCircles, GGParseIn, GGParseOut, GGSegment, GGShapes, GGSlice, Imager, ImagerPath, ImagerTransformation, IO, Lines2d, RealFns, Rope, Vectors2d EXPORTS GGSlice = BEGIN OPEN GGModelTypes; -- for SliceProc types Object: TYPE = Imager.Object; Color: TYPE = Imager.Color; Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = Feedback.Problem; <> CircleData: TYPE = REF CircleDataObj; CircleDataObj: TYPE = RECORD [ <> circle: Circle, -- a representation of a unit circle (for the convenience of GGCircles.LineMeetsCircle) tightBox: BoundBox, transform: ImagerTransformation.Transformation, scale: Vector, -- cached value of ImagerTransformation.Factor[transform].s evenScaling: BOOL, simpleCircle: Circle, -- for CircleHitDataAsSimpleCurve inverse: ImagerTransformation.Transformation, inverseScale: Vector, -- cached value of ImagerTransformation.Factor[inverse].s startPoint: Point, -- original point on circumference when circle was created fillColor: Color, segment: Segment ]; MaxCirclePoints: INTEGER = 5; CirclePoints: TYPE = [0..MaxCirclePoints); -- origin, left, top, right, bottom CircleParts: TYPE = REF CirclePartsObj; CirclePartsObj: TYPE = RECORD [ cpArray: ARRAY CirclePoints OF BOOL, -- used when origin or CPs are selected <> outline: BOOL -- TRUE if outline itself is in parts ]; CircleHitData: TYPE = REF CircleHitDataObj; CircleHitDataObj: TYPE = RECORD [ index: [-1..MaxCirclePoints), -- records index of which origin or CP is hit. -1 => no hit hitPoint: Point, outline: BOOL -- TRUE if outline itself is hit ]; Props: TYPE = REF PropsRec; PropsRec: TYPE = RECORD [ transform: Transformation, strokeWidth: REAL _ 0.0, strokeEnd: StrokeEnd _ round, dashed: BOOL _ FALSE, -- dashed stroke properties pattern: SequenceOfReal, offset: REAL _ 0.0, length: REAL _ 0.0, <> <> data: REF ]; BuildCircleSliceClass: PUBLIC PROC [] RETURNS [class: SliceClass] = { OPEN GGSlice; class _ NEW[SliceClassObj _ [ type: $Circle, <> getBoundBox: CircleBoundBox, getTightBox: CircleTightBox, copy: CircleCopy, <> drawParts: CircleDrawParts, drawTransform: CircleDrawTransform, drawSelectionFeedback: CircleDrawSelectionFeedback, drawAttractorFeedback: NoOpDrawAttractorFeedback, <> transform: CircleTransform, <> describe: CircleDescribe, describeHit: CircleDescribeHit, fileout: CircleFileout, filein: CircleFilein, <> isEmptyParts: CircleIsEmptyParts, isCompleteParts: CircleIsCompleteParts, newParts: CircleNewParts, unionParts: CircleUnionParts, differenceParts: CircleDiffParts, movingParts: CircleMovingParts, augmentParts: CircleAugmentParts, setSelectedFields: NoOpSetSelectedFields, <> pointsInDescriptor: CirclePointsInDescriptor, pointPairsInDescriptor: NoOpPointPairsInDescriptor, segmentsInDescriptor: CircleSegmentsInDescriptor, walkSegments: CircleWalkSegments, nextPoint: CircleNextPoint, nextPointPair: NoOpNextPointPair, nextSegment: CircleNextSegment, <> closestPoint: CircleClosestPoint, closestJointToHitData: NoOpClosestJointToHitData, closestPointAndTangent: NIL, closestSegment: CircleClosestSegment, lineIntersection: CircleLineIntersection, circleIntersection: NoOpCircleIntersection, hitDataAsSimpleCurve: CircleHitDataAsSimpleCurve, <