<> <> <> <> <> <<>> <> <<>> DIRECTORY Feedback, FeedbackTypes, GGBasicTypes, GGBoundBox, GGCoreOps, GGCoreTypes, GGHistoryTypes, GGInterfaceTypes, GGModelTypes, GGOutline, GGParent, GGParseIn, GGParseOut, GGProps, GGScene, GGSegment, GGSegmentTypes, GGShapes, GGSlice, GGSliceOps, GGTransform, GGUtility, Imager, ImagerColor, ImagerPath, ImagerTransformation, IO, Lines2d, NodeStyle, PutGet, Real, Rope, TextNode, TiogaImager, Vectors2d; GGSliceImplA: CEDAR PROGRAM IMPORTS Feedback, GGBoundBox, GGCoreOps, GGParent, GGParseIn, GGParseOut, GGProps, GGScene, GGSegment, GGShapes, GGSlice, GGSliceOps, GGTransform, GGUtility, Imager, ImagerTransformation, IO, Lines2d, PutGet, Rope, TextNode, TiogaImager, Vectors2d EXPORTS GGSlice = BEGIN BoundBox: TYPE = REF BoundBoxObj; BoundBoxObj: TYPE = GGCoreTypes.BoundBoxObj; Camera: TYPE = GGInterfaceTypes.Camera; Circle: TYPE = GGBasicTypes.Circle; Color: TYPE = Imager.Color; Corner: TYPE = GGSlice.Corner; DefaultData: TYPE = GGInterfaceTypes.DefaultData; EditConstraints: TYPE = GGModelTypes.EditConstraints; Edge: TYPE = GGBasicTypes.Edge; SliceGenerator: TYPE = GGModelTypes.SliceGenerator; ExtendMode: TYPE = GGModelTypes.ExtendMode; FactoredTransformation: TYPE = ImagerTransformation.FactoredTransformation; MsgRouter: TYPE = FeedbackTypes.MsgRouter; HistoryEvent: TYPE = GGHistoryTypes.HistoryEvent; Line: TYPE = GGCoreTypes.Line; Object: TYPE = Imager.Object; Orientation: TYPE = GGModelTypes.Orientation; Point: TYPE = GGBasicTypes.Point; PointGenerator: TYPE = GGModelTypes.PointGenerator; PointGeneratorObj: TYPE = GGModelTypes.PointGeneratorObj; PointPairGenerator: TYPE = GGModelTypes.PointPairGenerator; PointPairGeneratorObj: TYPE = GGModelTypes.PointPairGeneratorObj; PointWalkProc: TYPE = GGModelTypes.PointWalkProc; Scene: TYPE = GGModelTypes.Scene; Segment: TYPE = GGSegmentTypes.Segment; SegmentGenerator: TYPE = GGModelTypes.SegmentGenerator; SegmentGeneratorObj: TYPE = GGModelTypes.SegmentGeneratorObj; SelectedObjectData: TYPE = GGModelTypes.SelectedObjectData; SelectionClass: TYPE = GGSegmentTypes.SelectionClass; SelectMode: TYPE = GGModelTypes.SelectMode; Sequence: TYPE = GGModelTypes.Sequence; SequenceOfReal: TYPE = GGCoreTypes.SequenceOfReal; Slice: TYPE = GGModelTypes.Slice; SliceClass: TYPE = GGModelTypes.SliceClass; SliceClassObj: TYPE = GGModelTypes.SliceClassObj; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; SliceDescriptorObj: TYPE = GGModelTypes.SliceDescriptorObj; SliceObj: TYPE = GGModelTypes.SliceObj; SliceParts: TYPE = GGModelTypes.SliceParts; StrokeEnd: TYPE = Imager.StrokeEnd; StrokeJoint: TYPE = Imager.StrokeJoint; Transformation: TYPE = ImagerTransformation.Transformation; Vector: TYPE = GGBasicTypes.Vector; WalkProc: TYPE = GGModelTypes.WalkProc; MoveToProc: TYPE = ImagerPath.MoveToProc; LineToProc: TYPE = ImagerPath.LineToProc; CurveToProc: TYPE = ImagerPath.CurveToProc; ConicToProc: TYPE = ImagerPath.ConicToProc; ArcToProc: TYPE = ImagerPath.ArcToProc; <> BoxData: TYPE = REF BoxDataObj; BoxDataObj: TYPE = RECORD [ box: BoundBox, -- this is not used as a bounding box. It is a representation of the shape. transform: Transformation, inverse: Transformation, -- inverse of transform inverseScale: Vector, -- cached value of ImagerTransformation.Factor[inverse].s fillColor: Color, fillPixelArray: Imager.PixelArray _ NIL, fillText: TextNode.Location, formattedNodes: TiogaImager.FormattedNodes, screenStyle: BOOL _ FALSE, -- refers to desired format of nodes isScreenStyle: BOOL _ FALSE, -- refers to actual format of nodes strokeJoint: Imager.StrokeJoint _ round, forward: BOOL _ TRUE, -- that is, should be traversed in the normal order ll, ul, ur, lr savedPointSelections: ARRAY [0..5) OF SelectedObjectData, -- in order, ll, ul, ur, lr, center segments: ARRAY [0..4) OF Segment -- in order left, top, right, bottom ]; CornerArray: TYPE = ARRAY [0..4) OF BOOL; -- ll, ul, ur, lr. Clockwise order of corners. EdgeArray: TYPE = ARRAY [0..4) OF BOOL; -- left, top, right, bottom. Clockwise order of edges. centerIndex: INTEGER = 4; BoxParts: TYPE = REF BoxPartsObj; BoxPartsObj: TYPE = RECORD [ corners: CornerArray, -- which corners of box are selected. edges: EdgeArray, -- which edges of box are selected. center: BOOL -- is the middle joint selected? ]; BoxHitData: TYPE = REF BoxHitDataObj; BoxHitDataObj: TYPE = RECORD [ corner: [-1..3], edge: [-1..3], center: [-1..0], hitPoint: Point ]; Problem: SIGNAL [msg: Rope.ROPE] = Feedback.Problem; copyRestore: PUBLIC BOOL _ TRUE; -- temporary for test Restore procs. BuildBoxSliceClass: PUBLIC PROC [] RETURNS [class: SliceClass] = { OPEN GGSlice; class _ NEW[SliceClassObj _ [ type: $Box, unlink: GGSlice.UnlinkSlice, -- boxData doesn't need unlinking <> getBoundBox: BoxGetBoundBox, getTransformedBoundBox: GGSlice.GenericTransformedBoundBox, getTightBox: BoxGetTightBox, copy: BoxCopy, restore: BoxRestore, <> buildPath: BoxBuildPath, drawBorder: BoxDrawBorder, drawParts: BoxDrawParts, drawTransform: BoxDrawTransform, drawSelectionFeedback: BoxDrawSelectionFeedback, drawAttractorFeedback: BoxDrawAttractorFeedback, attractorFeedbackBoundBox: BoxAttractorFeedbackBoundBox, saveSelections: BoxSaveSelections, remakeSelections: BoxRemakeSelections, <> transform: BoxTransform, <> describe: BoxDescribe, describeHit: BoxDescribeHit, fileout: BoxFileout, filein: BoxFilein, <> isEmptyParts: BoxIsEmptyParts, isCompleteParts: BoxIsCompleteParts, newParts: BoxNewParts, unionParts: BoxUnionParts, differenceParts: BoxDiffParts, movingParts: BoxMovingParts, augmentParts: BoxAugmentParts, alterParts: BoxAlterParts, setSelectedFields: NoOpSetSelectedFields, <> pointsInDescriptor: BoxPointsInDescriptor, walkPointsInDescriptor: BoxWalkPointsInDescriptor, pointPairsInDescriptor: BoxPointPairsInDescriptor, segmentsInDescriptor: BoxSegmentsInDescriptor, walkSegments: BoxWalkSegments, nextPoint: BoxNextPoint, nextPointPair: BoxNextPointPair, nextSegment: BoxNextSegment, <> closestPoint: BoxClosestPoint, closestJointToHitData: BoxClosestJointToHitData, closestPointAndTangent: NoOpClosestPointAndTangent, closestSegment: BoxClosestSegment, filledPathsUnderPoint: BoxFilledPathsUnderPoint, lineIntersection: BoxLineIntersection, circleIntersection: NoOpCircleIntersection, hitDataAsSimpleCurve: BoxHitDataAsSimpleCurve, <