GGSlice.mesa
Copyright Ó 1987, 1991, 1992 by Xerox Corporation. All rights reserved.
Contents: Public access to instances of each slice class.
Pier, August 15, 1991 9:36 pm PDT
Bier, December 2, 1991 11:07 am PST
Kurlander, August 6, 1987 11:17:31 am PDT
Eisenman, September 28, 1987 5:57:33 pm PDT
Doug Wyatt, April 10, 1992 12:08 pm PDT
DIRECTORY
FeedbackTypes, GGBasicTypes, GGFont, GGHistoryTypes, GGModelTypes, GGSegmentTypes, Imager, ImagerTransformation, InterpressInterpreter, Rope, TextNode, TiogaImager;
GGSlice: CEDAR DEFINITIONS IMPORTS Imager = BEGIN
OPEN GGModelTypes;
BoundBox: TYPE = GGModelTypes.BoundBox;
Color: TYPE = Imager.Color;
Camera: TYPE = GGModelTypes.Camera;
DisplayStyle: TYPE = GGModelTypes.DisplayStyle;
MsgRouter: TYPE = FeedbackTypes.MsgRouter;
FontData: TYPE = GGFont.FontData;
HistoryEvent: TYPE = GGHistoryTypes.HistoryEvent;
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;
SliceGenerator: TYPE = GGModelTypes.SliceGenerator;
SliceParts: TYPE = GGModelTypes.SliceParts;
StrokeEnd: TYPE = Imager.StrokeEnd;
Vector: TYPE = GGBasicTypes.Vector;
WalkProc: TYPE = GGModelTypes.WalkProc;
NotFound: SIGNAL;
FontNameError: SIGNAL;
Creation and Queries about Slice Classes
RegisterSliceClass: PROC [class: SliceClass];
FetchSliceClass: PROC [name: ATOM] RETURNS [class: SliceClass];
Creation, Modification and Queries about Slices
DescriptorFromParts: PROC [slice: Slice, parts: SliceParts] RETURNS [sliceD: SliceDescriptor];
EntitiesInSlice: PROC [slice: Slice] RETURNS [entityGenerator: SliceGenerator];
Clusters
ClusterData: TYPE = REF ClusterDataObj;
ClusterDataObj: TYPE = RECORD [
frozen: BOOL ¬ TRUE
];
CreateCluster: PROC [frozen: BOOL ¬ TRUE] RETURNS [parent: Slice];
AddChildToCluster: PROC [parent: Slice, child: Slice, priority: INT];
AddChildrenToCluster: PROC [parent: Slice, children: LIST OF Slice, priority: INT];
RemoveChild: PROC [parent: Slice, child: Slice] RETURNS [newParent: Slice];
PruneNullClusters: PROC [scene: Scene, cluster: Slice];
SetFrozen: PROC [cluster: Slice, frozen: BOOL];
GetFrozen: PROC [cluster: Slice] RETURNS [frozen: BOOL];
Disconnects the named child from parent (to which it presumably belongs). Does not affect selections.
BuildClusterSliceClass: PROC [] RETURNS [class: SliceClass];
BuildMoreClusterSliceClass: PROC [class: SliceClass]; -- for internal communication only
Text Slices
BuildTextSliceClass: PROC [] RETURNS [class: SliceClass];
MakeTextSlice: PROC [text: Rope.ROPE, color: Imager.Color, displayStyle: DisplayStyle, 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 !!
SetTextFont: PROC [slice: Slice, fontData: FontData, router: MsgRouter, history: HistoryEvent] RETURNS [ success: BOOL ¬ TRUE];
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.
SetTextFontAndTransform: PROC [slice: Slice, fontData: FontData, router: MsgRouter, history: HistoryEvent] RETURNS [ success: BOOL ¬ TRUE];
The text slice's font will be set using fontData. fontData.transform will be used.
GetFontData: PROC [slice: Slice] RETURNS [fontData: FontData];
GetFontDataRope: PROC [slice: Slice] RETURNS [Rope.ROPE];
GetFontLiteralDataRope: PROC [slice: Slice] RETURNS [Rope.ROPE];
GetLooksDataRope: PROC [slice: Slice] RETURNS [Rope.ROPE];
IsWhitespace: PROC [slice: Slice] RETURNS [BOOL];
GetText: PROC [slice: Slice] RETURNS [text: Rope.ROPE];
SetText: PROC [slice: Slice, text: Rope.ROPE];
AppendText: PROC [slice: Slice, text: Rope.ROPE];
BackspaceText: PROC [slice: Slice, word: BOOL ¬ FALSE];
SetTextAmplifySpace: PROC [slice: Slice, amplifySpace: REAL, router: MsgRouter, history: HistoryEvent];
GetTextAmplifySpace: PROC [slice: Slice] RETURNS [amplifySpace: REAL];
SetTextColors: PROC [slice: Slice, textColor: Imager.Color, useTextColor: BOOL ¬ TRUE, shadowColor: Imager.Color, useShadowColor: BOOL ¬ FALSE, history: HistoryEvent];
GetTextColors: PROC [slice: Slice] RETURNS [textColor, shadowColor: Imager.Color];
GetTextDropShadow: PROC [slice: Slice] RETURNS [dropShadowOn: BOOL, dropShadow: Vector, color: Imager.Color];
DropShadowOn: PROC [slice: Slice, offset: Vector, history: HistoryEvent];
DropShadowOff: PROC [slice: Slice, history: HistoryEvent];
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
GetTextLineSpacing: PROC [slice: Slice] RETURNS [REAL];
SetTextLineSpacing: PROC [slice: Slice, lineSpacing: REAL, history: HistoryEvent];
SetTextDisplayStyle: PROC [slice: Slice, displayStyle: DisplayStyle, history: HistoryEvent];
OutlinesFromTextString: PROC [slice: Slice] RETURNS [shadowOutlines, outlines: LIST OF Slice];
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.
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];
transform defaults to the identity.
MakeBoxFromMaskPixel: PROC [pa: Imager.PixelArray, color: Color, router: MsgRouter, transform: ImagerTransformation.Transformation ¬ NIL] RETURNS [slice: Slice];
MakeBoxSlice: PROC [box: BoundBox, corner: Corner, transform: ImagerTransformation.Transformation] RETURNS [sliceD: SliceDescriptor];
BoxFetchSegment: PROC [slice: Slice, index: NAT] RETURNS [seg: Segment];
SetBoxText: PROC [slice: Slice, loc: TextNode.Location, screenStyle: BOOL ¬ FALSE, history: HistoryEvent];
GetBoxText: PROC [slice: Slice] RETURNS [loc: TextNode.Location, screenStyle: BOOL];
GetBoxNodes: PROC [slice: Slice] RETURNS [nodes: TiogaImager.FormattedNodes];
RenderText: PROC [dc: Imager.Context, slice: GGModelTypes.Slice, camera: Camera, quick: BOOL];
used by parent to render text after rendering fill and outline
Circle Slices
BuildCircleSliceClass: PROC [] RETURNS [class: SliceClass];
MakeCircleSlice: PROC [origin: Point, outerPoint: Point] RETURNS [sliceD: SliceDescriptor];
CircleGetParams: PROC [slice: Slice] RETURNS [origin: Point, outerPoint: Point, transform: ImagerTransformation.Transformation]; -- used by MatchTool
Interpress Slices
BuildIPSliceClass: PROC [] RETURNS [class: SliceClass];
MakeIPSliceFromMaster: PROC [ipMaster: InterpressInterpreter.Master, pixelsPerUnit: REAL ¬ 2834.646, fullName: Rope.ROPE ¬ NIL, router: MsgRouter, transform: ImagerTransformation.Transformation ¬ NIL, localTightBox: BoundBox ¬ NIL, localBox: BoundBox ¬ NIL, includeByValue: BOOL] RETURNS [slice: Slice];
pixelsPerUnit explains what the unit was when the interpress master was made. The default value is for meters.
MakeIPSliceFromMaskPixel: PROC [pa: Imager.PixelArray, color: Color, router: MsgRouter, 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, router: MsgRouter, transform: ImagerTransformation.Transformation ¬ NIL] RETURNS [slice: Slice];
SetIncludeByValue: PROC [slice: Slice, includeByValue: BOOL, history: HistoryEvent];
GetIncludeByValue: PROC [slice: Slice] RETURNS [includeByValue: BOOL];
SetDefaultUseLatestIPVersion: PROC [useLatestIPVersion: BOOL];
A duplicate of GGUserProfile.SetDefaultUseLatestIPVersion, for the modelling level.
GetDefaultUseLatestIPVersion: PROC [] RETURNS [useLatestIPVersion: BOOL];
A duplicate of GGUserProfile.GetDefaultUseLatestIPVersion, for the modelling level.
Outline and Trajectory Slices
BuildTrajSliceClass: PROC [] RETURNS [class: SliceClass];
BuildMoreTrajSliceClass: PROC [class: SliceClass]; -- for internal communication only
BuildOutlineSliceClass: PROC [] RETURNS [class: SliceClass];
BuildMoreOutlineSliceClass: PROC [class: SliceClass]; -- for internal communication only
TrajShapeChangeNotify: PROC [slice: Slice]; -- calls KillBoundBox and invalidates the polyline approximation
Slice Utility Routines
copyRestore: BOOL; -- temporary for test Restore procs. in GGSliceImplA.copyRestore
KillBoundBox: PROC [slice: Slice]; -- invalidate cached bound box and tight box in ancestor caches
KillBoundBoxOnly: PROC [slice: Slice]; -- invalidate cached bound box in ancestor caches
KillTightBoxOnly: PROC [slice: Slice]; -- invalidate cached tight box in ancestor caches
UnlinkSlice: PROC [slice: Slice];
For use ONLY to destroy REFs in slices so that Cedar garbage collector can collect storage. Only for wizards.
NoOp Class Routines
In GGSliceImplC.NoOpBoundBox
NoOpBoundBox: SliceBoundBoxProc;
NoOpTransformedBoundBox: SliceTransformedBoundBoxProc;
NoOpTightBox: SliceTightBoxProc;
NoOpCopy: SliceCopyProc;
Drawing
NoOpBuildPath: SliceBuildPathProc;
NoOpDrawBorder: SliceDrawBorderProc;
NoOpDrawParts: SliceDrawPartsProc;
NoOpDrawTransform: SliceDrawTransformProc;
NoOpDrawSelectionFeedback: SliceDrawSelectionFeedbackProc;
NoOpDrawAttractorFeedback: SliceDrawAttractorFeedbackProc;
NoOpAttractorFeedbackBoundBox: SliceAttractorFeedbackBoundBoxProc;
Transforming
NoOpSaveSelections: SliceSaveSelectionsProc;
NoOpRemakeSelections: SliceRemakeSelectionsProc;
NoOpTransform: SliceTransformProc;
Textual Description
NoOpDescribe: SliceDescribeProc;
NoOpDescribeHit: SliceDescribeHitProc;
NoOpFileout: SliceFileoutProc;
NoOpFilein: SliceFileinProc;
Hit Testing
NoOpEmptyParts: SliceIsEmptyPartsProc;
NoOpIsCompleteParts: SliceIsCompletePartsProc;
NoOpNewParts: SliceNewPartsProc;
NoOpUnionParts: SliceUnionPartsProc;
NoOpDifferenceParts: SliceDifferencePartsProc;
NoOpMovingParts: SliceMovingPartsProc;
NoOpAugmentParts: SliceAugmentPartsProc;
NoOpAlterParts: SliceAlterPartsProc;
NoOpSetSelectedFields: SliceSetSelectedFieldsProc;
NoOpPointsInDescriptor: SlicePointsInDescriptorProc;
NoOpPointPairsInDescriptor: SlicePointPairsInDescriptorProc;
NoOpSegmentsInDescriptor: SliceSegmentsInDescriptorProc;
NoOpWalkSegments: SliceWalkSegmentsProc;
NoOpNextPoint: SliceNextPointProc;
NoOpNextPointPair: SliceNextPointPairProc;
NoOpNextSegment: SliceNextSegmentProc;
NoOpClosestPoint: SliceClosestPointProc;
NoOpClosestJointToHitData: SliceClosestJointToHitDataProc;
NoOpClosestPointAndTangent: SliceClosestPointAndTangentProc;
NoOpClosestSegment: SliceClosestSegmentProc;
NoOpFilledPathsUnderPoint: SliceFilledPathsUnderPointProc;
NoOpLineIntersection: SliceLineIntersectionProc;
NoOpCircleIntersection: SliceCircleIntersectionProc;
NoOpHitDataAsSimpleCurve: SliceHitDataAsSimpleCurveProc;
Style
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;
NoOpSetOrientation: SliceSetOrientationProc;
NoOpGetOrientation: SliceGetOrientationProc;
GenericTransformedBoundBox: SliceTransformedBoundBoxProc;
this proc is an expensive way to calculate the bound box of a transformed object
END.