<> <> <> <> <> <<>> DIRECTORY Feedback, FeedbackTypes, FileNames, FS, FunctionCache, GGBasicTypes, GGBoundBox, GGCoreTypes, GGFileOps, GGFromImager, GGHistoryTypes, GGInterfaceTypes, GGModelTypes, GGMUserProfile, GGParseIn, GGParseOut, GGProps, GGScene, GGSegment, GGSegmentTypes, GGShapes, GGSlice, GGSliceOps, GGTransform, GGUtility, Imager, ImagerBox, ImagerInterpress, ImagerMaskCapture, ImagerMemory, ImagerTransformation, Interpress, IO, NodeStyle, Real, RefTab, Rope, SF, SymTab, Vectors2d; GGSliceImplF: CEDAR PROGRAM IMPORTS Feedback, FileNames, FS, FunctionCache, GGBoundBox, GGFileOps, GGFromImager, GGMUserProfile, GGParseIn, GGParseOut, GGProps, GGScene, GGSegment, GGShapes, GGSlice, GGSliceOps, GGTransform, Imager, ImagerBox, ImagerInterpress, ImagerMaskCapture, ImagerMemory, ImagerTransformation, Interpress, IO, RefTab, Rope, SymTab, Vectors2d EXPORTS GGSlice = BEGIN BoundBox: TYPE = REF BoundBoxObj; BoundBoxObj: TYPE = GGCoreTypes.BoundBoxObj; Camera: TYPE = GGModelTypes.Camera; CameraObj: TYPE = GGModelTypes.CameraObj; Color: TYPE = Imager.Color; DefaultData: TYPE = GGModelTypes.DefaultData; EditConstraints: TYPE = GGModelTypes.EditConstraints; ExtendMode: TYPE = GGModelTypes.ExtendMode; MsgRouter: TYPE = FeedbackTypes.MsgRouter; HistoryEvent: TYPE = GGHistoryTypes.HistoryEvent; 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; 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; Transformation: TYPE = ImagerTransformation.Transformation; Vector: TYPE = GGBasicTypes.Vector; WalkProc: TYPE = GGModelTypes.WalkProc; Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = Feedback.Problem; <> ipMaxPoints: INTEGER = 4; ipMaxEdges: INTEGER = 4; IPPointArray: TYPE = ARRAY [0..ipMaxPoints) OF BOOL; -- ll, ul, ur, lr IPEdgeArray: TYPE = ARRAY [0..ipMaxEdges) OF BOOL; -- left, top, right, bottom ipCornerRopes: ARRAY [0..ipMaxPoints) OF Rope.ROPE = [ "lower left corner", "upper left corner", "upper right corner", "lower right corner"]; ipEdgeRopes: ARRAY [0..ipMaxEdges) OF Rope.ROPE = [ "left edge", "top edge", "right edge", "bottom edge"]; IPData: TYPE = REF IPDataObj; IPDataObj: TYPE = RECORD [ localTightBox: BoundBox, -- a tight box in local coordinates. Set when slice is created. localBox: BoundBox, -- a loose box in local coordinates. Set when slice is created. includeByValue: BOOL _ FALSE, -- store the actual interpress in the Gargoyle master? file: Rope.ROPE, -- fileName of Interpress Master mem: Imager.Context, -- imager memory context transform: ImagerTransformation.Transformation, -- includes default position inverse: ImagerTransformation.Transformation, inverseScale: Vector, -- cached value of ImagerTransformation.Factor[inverse].s seg: Segment -- a null segment whose entire purpose is to contain properties in seg.props ]; IPParts: TYPE = REF IPPartsObj; IPPartsObj: TYPE = RECORD [ points: IPPointArray, -- which corners of box are selected. edges: IPEdgeArray, -- which edges of box are selected. innards: BOOL _ FALSE -- FALSE => corners and edges only; no innards ]; IPHitData: TYPE = REF IPHitDataObj; IPHitDataObj: TYPE = RECORD [ point: [-1..ipMaxPoints), -- which point of box is hit. edge: INTEGER, -- which edge of box is hit. <> hitPoint: Point ]; MasterStuff: TYPE = RECORD [ master: Interpress.Master, pixelsPerUnit: REAL ]; ContextStuff: TYPE = RECORD [ memContext: Imager.Context, localTightBox: BoundBox, localBox: BoundBox ]; BuildIPSliceClass: PUBLIC PROC [] RETURNS [class: SliceClass] = { OPEN GGSlice; class _ NEW[SliceClassObj _ [ type: $IP, unlink: GGSlice.UnlinkSlice, -- ipData doesn't need unlinking <> getBoundBox: IPGetBoundBox, getTransformedBoundBox: GGSlice.GenericTransformedBoundBox, getTightBox: IPGetTightBox, copy: IPCopy, restore: IPRestore, <> buildPath: NoOpBuildPath, drawBorder: NoOpDrawBorder, drawParts: IPDrawParts, drawTransform: IPDrawTransform, drawSelectionFeedback: IPDrawSelectionFeedback, drawAttractorFeedback: NoOpDrawAttractorFeedback, saveSelections: NoOpSaveSelections, remakeSelections: NoOpRemakeSelections, <> transform: IPTransform, <> describe: IPDescribe, describeHit: IPDescribeHit, fileout: IPFileout, filein: IPFilein, <> isEmptyParts: IPIsEmptyParts, isCompleteParts: IPIsCompleteParts, newParts: IPNewParts, unionParts: IPUnionParts, differenceParts: IPDiffParts, movingParts: IPMovingParts, augmentParts: IPAugmentParts, alterParts: NoOpAlterParts, setSelectedFields: NoOpSetSelectedFields, <> pointsInDescriptor: IPPointsInDescriptor, walkPointsInDescriptor: IPWalkPointsInDescriptor, pointPairsInDescriptor: IPPointPairsInDescriptor, segmentsInDescriptor: IPSegmentsInDescriptor, walkSegments: IPWalkSegments, nextPoint: IPNextPoint, nextPointPair: IPNextPointPair, nextSegment: IPNextSegment, <> closestPoint: IPClosestPoint, closestJointToHitData: NoOpClosestJointToHitData, closestPointAndTangent: NoOpClosestPointAndTangent, closestSegment: IPClosestSegment, filledPathsUnderPoint: IPFilledPathsUnderPoint, lineIntersection: NoOpLineIntersection, circleIntersection: NoOpCircleIntersection, hitDataAsSimpleCurve: NoOpHitDataAsSimpleCurve, <