GGSliceOps.mesa
Copyright Ó 1987, 1988, 1992 by Xerox Corporation. All rights reserved.
Created by: Ken Pier, November 25, 1987 10:45:05 am PST
Last Edited by: Ken Pier, July 16, 1991 5:06 pm PDT
Bier, December 2, 1991 11:05 am PST
This module is the outer interface to slice class procs
DIRECTORY
FeedbackTypes, GGModelTypes, IO;
GGSliceOps: CEDAR DEFINITIONS = BEGIN
OPEN GGModelTypes;
One-to-one correspondence between procs here and SliceClass procs. Clients should call through this interface instead of directly through class record.
noteNoMore: BOOL;
debugHalt: BOOL;
GetType: PROC [slice: Slice] RETURNS [type: ATOM];
Fundamentals
GetBoundBox: SliceBoundBoxProc;
GetTransformedBoundBox: SliceTransformedBoundBoxProc;
GetTightBox: SliceTightBoxProc;
Copy: SliceCopyProc;
Restore: SliceRestoreProc;
Unlink: SliceUnlinkProc;
Drawing
BuildPath: SliceBuildPathProc;
DrawBorder: SliceDrawBorderProc;
DrawParts: SliceDrawPartsProc;
DrawTransform: SliceDrawTransformProc;
DrawSelectionFeedback: SliceDrawSelectionFeedbackProc;
DrawAttractorFeedback: SliceDrawAttractorFeedbackProc;
AttractorFeedbackBoundBox: SliceAttractorFeedbackBoundBoxProc;
SaveSelections: SliceSaveSelectionsProc;
RemakeSelections: SliceRemakeSelectionsProc;
Transforming
Transform: SliceTransformProc;
Textual Description
Describe: SliceDescribeProc;
DescribeHit: SliceDescribeHitProc;
Fileout: SliceFileoutProc;
Filein: SliceFileinProc;
Parts
IsEmptyParts: SliceIsEmptyPartsProc;
IsCompleteParts: SliceIsCompletePartsProc;
NewParts: SliceNewPartsProc;
UnionParts: SliceUnionPartsProc;
DifferenceParts: SliceDifferencePartsProc;
MovingParts: SliceMovingPartsProc;
AugmentParts: SliceAugmentPartsProc;
AlterParts: SliceAlterPartsProc;
SetSelectedFields: SliceSetSelectedFieldsProc;
Part Generators
PointsInDescriptor: SlicePointsInDescriptorProc;
WalkPointsInDescriptor: SliceWalkPointsInDescriptorProc;
PointPairsInDescriptor: SlicePointPairsInDescriptorProc;
SegmentsInDescriptor: SliceSegmentsInDescriptorProc;
WalkSegments: SliceWalkSegmentsProc;
NextPoint: SliceNextPointProc;
NextPointPair: SliceNextPointPairProc;
NextSegment: SliceNextSegmentProc;
Hit Testing
ClosestPoint: SliceClosestPointProc;
ClosestJointToHitData: SliceClosestJointToHitDataProc;
ClosestPointAndTangent: SliceClosestPointAndTangentProc;
ClosestSegment: SliceClosestSegmentProc;
FilledPathsUnderPoint: SliceFilledPathsUnderPointProc;
LineIntersection: SliceLineIntersectionProc;
CircleIntersection: SliceCircleIntersectionProc;
HitDataAsSimpleCurve: SliceHitDataAsSimpleCurveProc;
Style
SetDefaults: SliceSetDefaultsProc;
SetStrokeWidth: SliceSetStrokeWidthProc;
GetStrokeWidth: SliceGetStrokeWidthProc;
SetStrokeEnd: SliceSetStrokeEndProc;
GetStrokeEnd: SliceGetStrokeEndProc;
SetStrokeJoint: SliceSetStrokeJointProc;
GetStrokeJoint: SliceGetStrokeJointProc;
SetStrokeColor: SliceSetStrokeColorProc;
GetStrokeColor: SliceGetStrokeColorProc;
SetFillColor: SliceSetFillColorProc;
GetFillColor: SliceGetFillColorProc;
SetArrows: SliceSetArrowsProc;
GetArrows: SliceGetArrowsProc;
SetDashed: SliceSetDashedProc;
GetDashed: SliceGetDashedProc;
SetOrientation: SliceSetOrientationProc;
GetOrientation: SliceGetOrientationProc;
Procedures implemented as a thin veneer on top of the basic class procs
FileoutSlice: PROC [f: IO.STREAM, slice: Slice];
FileinSlice: PROC [f: IO.STREAM, version: REAL, router: FeedbackTypes.MsgRouter, camera: Camera, class: SliceClass ¬ NIL] RETURNS [slice: Slice];
PartsInBoundBox: PROC [slice: Slice, box: BoundBox] RETURNS [inParts: SliceDescriptor];
Returns a descriptor of those parts of slice that are within box.
WithinBoundBox: PROC [slice: Slice, box: BoundBox] RETURNS [in: BOOL];
Returns TRUE if all parts of slice are within box.
IsOpen: PROC [slice: Slice] RETURNS [isOpen: BOOL ¬ FALSE];
Returns TRUE if slice is an open trajectory
Describes those paths of slice, with non-NIL fill color, that contain point. Used by GGMultiGravityImpl for faces-preferred gravit, which is used for selections. Paths are listed near to far in overlap order.
Routines that operate on several classes, but aren't class procs
IsDescriptorOfEnd: PROC [sliceD: SliceDescriptor] RETURNS [BOOL];
UnpackJoint: PROC [sliceD: SliceDescriptor] RETURNS [success: BOOL, trajD: SliceDescriptor, jointNum: INT];
Used by GGEventImplB.DeleteCaretSegment.
UnpackSegment: PROC [sliceD: SliceDescriptor] RETURNS [success: BOOL, hitType: TrajPartType, traj: Slice, seg: Segment, segNum: NAT ¬ 999];
Used by GGEventImplC.AddControlPoint.
END.