<> <> <> <> <> <<>> DIRECTORY Atom, GGBasicTypes, GGBoundBox, GGCircles, GGError, GGLines, GGSlice, GGInterfaceTypes, GGModelTypes, GGObjects, GGShapes, GGParseOut, GGParseIn, GGTransform, GGUtility, GGVector, Imager, ImagerTransformation, ImagerColor, ImagerPath, IO, NodeStyle, RealFns, Rope, ViewerClasses; GGSliceImplA: CEDAR PROGRAM IMPORTS Atom, GGBoundBox, GGCircles, GGError, GGLines, GGObjects, GGSlice, GGParseIn, GGParseOut, GGShapes, GGTransform, GGVector, Imager, ImagerPath, IO, RealFns, ImagerTransformation, Rope EXPORTS GGSlice = BEGIN Scene: TYPE = GGModelTypes.Scene; BoundBox: TYPE = GGModelTypes.BoundBox; CameraData: TYPE = GGInterfaceTypes.CameraData; Circle: TYPE = GGBasicTypes.Circle; Color: TYPE = ImagerColor.Color; Corner: TYPE = GGSlice.Corner; DisplayStyle: TYPE = GGSlice.DisplayStyle; Edge: TYPE = GGBasicTypes.Edge; ExtendMode: TYPE = GGModelTypes.ExtendMode; Line: TYPE = GGBasicTypes.Line; Point: TYPE = GGBasicTypes.Point; PointGenerator: TYPE = GGModelTypes.PointGenerator; PointGeneratorObj: TYPE = GGModelTypes.PointGeneratorObj; PointPairGenerator: TYPE = GGModelTypes.PointPairGenerator; PointPairGeneratorObj: TYPE = GGModelTypes.PointPairGeneratorObj; SelectedObjectData: TYPE = GGModelTypes.SelectedObjectData; SelectionClass: TYPE = GGInterfaceTypes.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; Viewer: TYPE = ViewerClasses.Viewer; Vector: TYPE = GGBasicTypes.Vector; SliceClassDef: TYPE = REF SliceClassDefObj; SliceClassDefObj: TYPE = RECORD[type: ATOM, class: SliceClass]; <> BoxData: TYPE = REF BoxDataObj; BoxDataObj: TYPE = RECORD [ box: BoundBox, -- this is not used as a bounding box. It is a representation of the shape. tightBox: BoundBox, -- a Manhattan aligned box, that contains this box. tightBox does NOT allow for stroke width or control points. transform: ImagerTransformation.Transformation, inverse: ImagerTransformation.Transformation, -- inverse of transform inverseScale: Vector, -- cached value of ImagerTransformation.Factor[inverse].s strokeWidths: ARRAY [0..4) OF REAL, -- in order left, top, right, bottom strokeColors: ARRAY [0..4) OF Imager.Color, -- in order left, top, right, bottom fillColor: Imager.Color ]; 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. 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 ]; BuildBoxSliceClass: PUBLIC PROC [] RETURNS [class: SliceClass] = { OPEN GGSlice; class _ NEW[SliceClassObj _ [ type: $Box, <> getBoundBox: BoxGetBoundBox, getTightBox: BoxGetTightBox, copy: BoxCopy, <> drawParts: BoxDrawParts, drawTransform: BoxDrawTransform, drawSelectionFeedback: BoxDrawSelectionFeedback, drawAttractorFeedback: NoOpDrawAttractorFeedback, <> transform: BoxTransform, <> describe: BoxDescribe, fileout: BoxFileout, filein: BoxFilein, <> emptyParts: BoxEmptyParts, newParts: BoxNewParts, unionParts: BoxUnionParts, differenceParts: BoxDiffParts, movingParts: BoxMovingParts, fixedParts: BoxFixedParts, augmentParts: BoxAugmentParts, <> pointsInDescriptor: BoxPointsInDescriptor, pointPairsInDescriptor: BoxPointPairsInDescriptor, nextPoint: BoxNextPoint, nextPointPair: BoxNextPointPair, <> closestPoint: BoxClosestPoint, closestPointAndTangent: NoOpClosestPointAndTangent, closestSegment: BoxClosestSegment, lineIntersection: BoxLineIntersection, circleIntersection: NoOpCircleIntersection, hitDataAsSimpleCurve: BoxHitDataAsSimpleCurve, <