DIRECTORY AtomButtonsTypes, GGBasicTypes, GGFont, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, Imager, ImagerFont, ImagerTransformation, Interpress, NodeStyle, Rope, ViewerClasses; GGSlice: CEDAR DEFINITIONS IMPORTS Imager = BEGIN WalkProc: TYPE = GGModelTypes.WalkProc; BoundBox: TYPE = GGModelTypes.BoundBox; Color: TYPE = Imager.Color; DefaultData: TYPE = GGInterfaceTypes.DefaultData; EntityGenerator: TYPE = GGModelTypes.EntityGenerator; FeedbackData: TYPE = AtomButtonsTypes.FeedbackData; FontData: TYPE = GGFont.FontData; Point: TYPE = GGBasicTypes.Point; PointGenerator: TYPE = GGModelTypes.PointGenerator; PointPairGenerator: TYPE = GGModelTypes.PointPairGenerator; Segment: TYPE = GGSegmentTypes.Segment; SegmentGenerator: TYPE = GGModelTypes.SegmentGenerator; SelectionClass: TYPE = GGSegmentTypes.SelectionClass; Slice: TYPE = GGModelTypes.Slice; SliceClass: TYPE = GGModelTypes.SliceClass; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; SliceParts: TYPE = GGModelTypes.SliceParts; StrokeEnd: TYPE = Imager.StrokeEnd; Vector: TYPE = GGBasicTypes.Vector; Viewer: TYPE = ViewerClasses.Viewer; SliceBoundBoxProc: TYPE = GGModelTypes.SliceBoundBoxProc; SliceTightBoxProc: TYPE = GGModelTypes.SliceTightBoxProc; SliceCopyProc: TYPE = GGModelTypes.SliceCopyProc; SliceDrawPartsProc: TYPE = GGModelTypes.SliceDrawPartsProc; SliceDrawTransformProc: TYPE = GGModelTypes.SliceDrawTransformProc; SliceDrawSelectionFeedbackProc: TYPE = GGModelTypes.SliceDrawSelectionFeedbackProc; SliceDrawAttractorFeedbackProc: TYPE = GGModelTypes.SliceDrawAttractorFeedbackProc; SliceTransformProc: TYPE = GGModelTypes.SliceTransformProc; SliceDescribeHitProc: TYPE = GGModelTypes.SliceDescribeHitProc; SliceDescribeProc: TYPE = GGModelTypes.SliceDescribeProc; SliceFileoutProc: TYPE = GGModelTypes.SliceFileoutProc; SliceFileinProc: TYPE = GGModelTypes.SliceFileinProc; SliceIsEmptyPartsProc: TYPE = GGModelTypes.SliceIsEmptyPartsProc; SliceIsCompletePartsProc: TYPE = GGModelTypes.SliceIsCompletePartsProc; SliceNewPartsProc: TYPE = GGModelTypes.SliceNewPartsProc; SliceUnionPartsProc: TYPE = GGModelTypes.SliceUnionPartsProc; SliceDifferencePartsProc: TYPE = GGModelTypes.SliceDifferencePartsProc; SliceMovingPartsProc: TYPE = GGModelTypes.SliceMovingPartsProc; SliceAugmentPartsProc: TYPE = GGModelTypes.SliceAugmentPartsProc; SliceSetSelectedFieldsProc: TYPE = GGModelTypes.SliceSetSelectedFieldsProc; SlicePointsInDescriptorProc: TYPE = GGModelTypes.SlicePointsInDescriptorProc; SlicePointPairsInDescriptorProc: TYPE = GGModelTypes.SlicePointPairsInDescriptorProc; SliceSegmentsInDescriptorProc: TYPE = GGModelTypes.SliceSegmentsInDescriptorProc; SliceWalkSegmentsProc: TYPE = GGModelTypes.SliceWalkSegmentsProc; SliceNextSegmentProc: TYPE = GGModelTypes.SliceNextSegmentProc; SliceNextPointProc: TYPE = GGModelTypes.SliceNextPointProc; SliceNextPointPairProc: TYPE = GGModelTypes.SliceNextPointPairProc; SliceClosestPointProc: TYPE = GGModelTypes.SliceClosestPointProc; SliceClosestJointToHitDataProc: TYPE = GGModelTypes.SliceClosestJointToHitDataProc; SliceClosestPointAndTangentProc: TYPE = GGModelTypes.SliceClosestPointAndTangentProc; SliceClosestSegmentProc: TYPE = GGModelTypes.SliceClosestSegmentProc; SliceLineIntersectionProc: TYPE = GGModelTypes.SliceLineIntersectionProc; SliceCircleIntersectionProc: TYPE = GGModelTypes.SliceCircleIntersectionProc; SliceHitDataAsSimpleCurveProc: TYPE = GGModelTypes.SliceHitDataAsSimpleCurveProc; SliceSetDefaultsProc: TYPE = GGModelTypes.SliceSetDefaultsProc; SliceSetStrokeWidthProc: TYPE = GGModelTypes.SliceSetStrokeWidthProc; SliceGetStrokeWidthProc: TYPE = GGModelTypes.SliceGetStrokeWidthProc; SliceSetStrokeEndProc: TYPE = GGModelTypes.SliceSetStrokeEndProc; SliceGetStrokeEndProc: TYPE = GGModelTypes.SliceGetStrokeEndProc; SliceSetStrokeJointProc: TYPE = GGModelTypes.SliceSetStrokeJointProc; SliceGetStrokeJointProc: TYPE = GGModelTypes.SliceGetStrokeJointProc; SliceSetStrokeColorProc: TYPE = GGModelTypes.SliceSetStrokeColorProc; SliceGetStrokeColorProc: TYPE = GGModelTypes.SliceGetStrokeColorProc; SliceSetFillColorProc: TYPE = GGModelTypes.SliceSetFillColorProc; SliceGetFillColorProc: TYPE = GGModelTypes.SliceGetFillColorProc; SliceSetArrowsProc: TYPE = GGModelTypes.SliceSetArrowsProc; SliceGetArrowsProc: TYPE = GGModelTypes.SliceGetArrowsProc; SliceSetDashedProc: TYPE = GGModelTypes.SliceSetDashedProc; SliceGetDashedProc: TYPE = GGModelTypes.SliceGetDashedProc; NotFound: SIGNAL; FontNameError: SIGNAL; RegisterSliceClass: PROC [class: SliceClass]; FetchSliceClass: PROC [name: ATOM] RETURNS [class: SliceClass]; UpdateDescriptorBoundBoxes: PROC [sliceD: SliceDescriptor]; SetDefaults: PROC [slice: Slice, parts: SliceParts, defaults: DefaultData]; CopySlice: PROC [slice: Slice] RETURNS [copy: Slice]; EntitiesInSlice: PROC [slice: Slice] RETURNS [entityGenerator: EntityGenerator]; DescriptorFromParts: PROC [slice: Slice, parts: SliceParts] RETURNS [sliceD: SliceDescriptor]; SegmentsInDescriptor: PROC [sliceD: SliceDescriptor] RETURNS [segGen: SegmentGenerator]; NextSegment: PROC [segGen: SegmentGenerator] RETURNS [next: Segment]; WalkSegments: PROC [slice: Slice, walkProc: WalkProc] RETURNS [sliceD: SliceDescriptor]; BuildTextSliceClass: PROC [] RETURNS [class: SliceClass]; MakeTextSlice: PROC [text: Rope.ROPE, amplifySpace: REAL _ 1.0, dropShadowsOn: BOOL _ FALSE, dropShadowOffset: Vector _ [0.0, 0.0], shadowColor: Imager.Color _ Imager.black] RETURNS [slice: Slice]; SetTextFont: PROC [slice: Slice, fontData: FontData, feedback: FeedbackData] RETURNS [ success: BOOL _ TRUE]; SetTextFontAndTransform: PROC [slice: Slice, fontData: FontData, feedback: FeedbackData] RETURNS [ success: BOOL _ TRUE]; GetFontData: PROC [slice: Slice] RETURNS [fontData: FontData]; GetFontDataRope: PROC [slice: Slice] RETURNS [Rope.ROPE]; GetFontLiteralDataRope: PROC [slice: Slice] RETURNS [Rope.ROPE]; IsWhitespace: PROC [slice: Slice] RETURNS [BOOL]; GetText: PROC [slice: Slice] RETURNS [text: Rope.ROPE]; AppendText: PROC [slice: Slice, text: Rope.ROPE]; BackspaceText: PROC [slice: Slice]; SetTextAmplifySpace: PROC [slice: Slice, amplifySpace: REAL, feedback: FeedbackData]; GetTextAmplifySpace: PROC [slice: Slice] RETURNS [amplifySpace: REAL]; SetTextColor: PROC [slice: Slice, color: Imager.Color, colorName: Rope.ROPE]; GetTextColor: PROC [slice: Slice] RETURNS [color: Imager.Color, colorName: Rope.ROPE]; DropShadowOn: PROC [slice: Slice, offset: Vector]; DropShadowOff: PROC [slice: Slice]; Corner: TYPE = {none, ll, ul, ur, lr}; -- lower left, upper left, upper right, lower right Edge: TYPE = {none, left, right, top, bottom}; BuildBoxSliceClass: PROC [] RETURNS [class: SliceClass]; MakeBoxSlice: PROC [box: BoundBox, corner: Corner, transform: ImagerTransformation.Transformation] RETURNS [sliceD: SliceDescriptor]; BuildCircleSliceClass: PROC [] RETURNS [class: SliceClass]; MakeCircleSlice: PROC [origin: Point, outerPoint: Point] RETURNS [sliceD: SliceDescriptor]; BuildIPSliceClass: PROC [] RETURNS [class: SliceClass]; MakeIPSliceFromMaster: PROC [ipMaster: Interpress.Master, pixelsPerUnit: REAL _ 2834.646, fullName: Rope.ROPE _ NIL, feedback: FeedbackData, transform: ImagerTransformation.Transformation _ NIL, localBox: BoundBox _ NIL, includeByValue: BOOL] RETURNS [slice: Slice]; MakeIPSliceFromMaskPixel: PROC [pa: Imager.PixelArray, color: Color, feedback: FeedbackData, transform: ImagerTransformation.Transformation _ NIL] RETURNS [slice: Slice]; MakeIPSliceFromMaskBits: PROC [base: LONG POINTER, wordsPerLine: NAT, sMin, fMin, sSize, fSize: NAT, tx, ty: INTEGER _ 0, color: Color, feedback: FeedbackData, transform: ImagerTransformation.Transformation _ NIL] RETURNS [slice: Slice]; SetIncludeByValue: PROC [slice: Slice, includeByValue: BOOL]; GetIncludeByValue: PROC [slice: Slice] RETURNS [includeByValue: BOOL]; NoOpBoundBox: SliceBoundBoxProc; NoOpTightBox: SliceTightBoxProc; NoOpCopy: SliceCopyProc; NoOpDrawParts: SliceDrawPartsProc; NoOpDrawTransform: SliceDrawTransformProc; NoOpDrawSelectionFeedback: SliceDrawSelectionFeedbackProc; NoOpDrawAttractorFeedback: SliceDrawAttractorFeedbackProc; NoOpTransform: SliceTransformProc; NoOpDescribe: SliceDescribeProc; NoOpDescribeHit: SliceDescribeHitProc; NoOpFileout: SliceFileoutProc; NoOpFilein: SliceFileinProc; NoOpEmptyParts: SliceIsEmptyPartsProc; NoOpIsCompleteParts: SliceIsCompletePartsProc; NoOpNewParts: SliceNewPartsProc; NoOpUnionParts: SliceUnionPartsProc; NoOpDifferenceParts: SliceDifferencePartsProc; NoOpMovingParts: SliceMovingPartsProc; NoOpAugmentParts: SliceAugmentPartsProc; NoOpSetSelectedFields: SliceSetSelectedFieldsProc; NoOpPointsInDescriptor: SlicePointsInDescriptorProc; NoOpPointPairsInDescriptor: SlicePointPairsInDescriptorProc; NoOpSegmentsInDescriptor: SliceSegmentsInDescriptorProc; NoOpWalkSegments: SliceWalkSegmentsProc; NoOpNextPoint: SliceNextPointProc; NoOpNextPointPair: SliceNextPointPairProc; NoOpNextSegment: SliceNextSegmentProc; NoOpClosestPoint: SliceClosestPointProc; NoOpClosestJointToHitData: SliceClosestJointToHitDataProc; NoOpClosestPointAndTangent: SliceClosestPointAndTangentProc; NoOpClosestSegment: SliceClosestSegmentProc; NoOpLineIntersection: SliceLineIntersectionProc; NoOpCircleIntersection: SliceCircleIntersectionProc; NoOpHitDataAsSimpleCurve: SliceHitDataAsSimpleCurveProc; NoOpSetDefaults: SliceSetDefaultsProc; NoOpSetStrokeWidth: SliceSetStrokeWidthProc; NoOpGetStrokeWidth: SliceGetStrokeWidthProc; NoOpSetStrokeEnd: SliceSetStrokeEndProc; NoOpGetStrokeEnd: SliceGetStrokeEndProc; NoOpSetStrokeJoint: SliceSetStrokeJointProc; NoOpGetStrokeJoint: SliceGetStrokeJointProc; NoOpSetStrokeColor: SliceSetStrokeColorProc; NoOpGetStrokeColor: SliceGetStrokeColorProc; NoOpSetFillColor: SliceSetFillColorProc; NoOpGetFillColor: SliceGetFillColorProc; NoOpSetArrows: SliceSetArrowsProc; NoOpGetArrows: SliceGetArrowsProc; NoOpSetDashed: SliceSetDashedProc; NoOpGetDashed: SliceGetDashedProc; END. ^GGSlice.mesa Copyright c 1986, 1987 by Xerox Corporation. All rights reserved. Contents: Implements the various slice classes in Gargoyle. Pier, May 12, 1987 3:01:23 pm PDT Bier, April 6, 1987 6:34:04 pm PDT Creation and Queries about Slice Classes -- used to store bounding boxes in $Outline class sequences. Other classes are ignored. Creation, Modification and Queries about Slices DeleteSlice: PROC [scene: Scene, slice: Slice]; -- MOVED TO GGScene Calls the slice class walkSegments proc. The walkProc is called with each segment in the slice. If walkProc returns TRUE, the part of the slice that corresponds to the segment will be in the SliceDescriptor returned by WalkSegments. Text Slices MakeTextSlice: PROC [text: Rope.ROPE, color: Imager.Color _ Imager.black, amplifySpace: REAL _ 1.0, dropShadowsOn: BOOL _ FALSE, dropShadowOffset: Vector _ [0.0, 0.0], shadowColor: Imager.Color _ Imager.black] RETURNS [slice: Slice]; MakeTextSlice MUST BE FOLLOWED BY A CALL TO SetTextFont !! The text slice's font will be set using fontData. The translation component of the existing slice transform will be used. If fontData.transform=NIL, the scale component of the new transform is set to fontData.scale and the rotation component to 0. The text slice's font will be set using fontData. fontData.transform will be used. A fontName is a font designation with family, size, and face, like Helvetica23BI or TimesRoman6. A colorName is a name from the color naming system in the Cedar ColorTool. may raise FontStringError Box Slices A box is a slice which maintains its rectilinear properties. It is possible to select/drag one of four corners, one of four edges, or the entire box. When a corner is dragged, box is rubberbanded to keep its box shape. When an edge is dragged, only the perpendicular component of the drag vector is used to move the edge, thus maintaining box shape. When the entire box is selected (traj or topLevel), it can be translated and rotated. transform defaults to the identity. MakeBoxSlice: PROC [box: BoundBox, corner: Corner, transform: ImagerTransformation.Transformation, strokeWidth: REAL _ 2.0, strokeEnd: StrokeEnd _ round] RETURNS [sliceD: SliceDescriptor]; Circle Slices MakeCircleSlice: PROC [origin: Point, outerPoint: Point, strokeWidth: REAL _ 2.0, strokeColor: Imager.Color _ Imager.black, fillColor: Imager.Color _ NIL] RETURNS [sliceD: SliceDescriptor]; Interpress Slices pixelsPerUnit explains what the unit was when the interpress master was made. The default value is for meters. NoOp Class Routines In GGSliceImplC.NoOpBoundBox Drawing Transforming Textual Description Hit Testing Style Κ ‰˜codešœ ™ KšœB™BKšΟnœ4™Kšœžœžœžœ˜9Kšœžœžœžœ˜@Kš œžœžœžœ˜1Kšœžœžœ žœ˜7Kš œžœžœ˜1Kš œžœ˜#Kšœžœžœ˜UKšœžœžœžœ˜FKš œžœ5žœ˜MKš œžœžœ'žœ˜VKš œžœ ˜2š œžœ˜#Kšœ«™«K™—K˜K™ K™Kšœ΄™΄K™KšœžœŸ3˜ZKšœžœ$˜.K˜šœžœžœ˜8Kšœ#™#—Kš œžœ^žœ&žœ™ΌKš œžœQžœ˜…K˜K™ K˜Kšœžœžœ˜;Kš œžœ1žœLžœžœ™½Kšœžœ$žœ˜[K˜K™K™Kšœžœžœ˜7šœžœ.žœžœžœKžœžœžœžœ˜ŠKšœo™o—Kšœžœpžœžœ˜ͺKšœžœžœžœžœžœ žœ]žœžœ˜ξKšœžœ žœ˜=Kšœžœžœžœ˜FK˜K™Kšœ™K™Kš œ˜ Kš œ˜ šœ˜Kšœ™—Kš œ˜"Kšœ˜*Kšœ!˜:šœ!˜:Kšœ ™ —š œ˜"Kšœ™—Kš œ˜ Kšœ˜&Kš œ˜š œ˜Kšœ ™ —Kšœ˜&Kšœ˜.Kš œ˜ Kšœ˜$Kšœ˜.Kšœ˜&Kšœ˜(Kšœ˜2Kšœ˜4Kšœ"˜