GGOutline.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on January 14, 1987 5:50:43 pm PST
Contents: Procedures to implement the Outline Slice Class in Gargoyle. Outlines consist of Trajectories which in turn consist of Segments. Outline is the most important slice class.
Pier, July 3, 1986 1:05:02 pm PDT
DIRECTORY
GGBasicTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, Imager, ImagerTransformation;
GGOutline: CEDAR DEFINITIONS
IMPORTS Imager = BEGIN
GargoyleData: TYPE = GGInterfaceTypes.GargoyleData;
Joint: TYPE = GGSegmentTypes.Joint;
Outline: TYPE = GGModelTypes.Outline;
OutlineDescriptor: TYPE = GGModelTypes.OutlineDescriptor;
TrajPartType: TYPE = GGModelTypes.TrajPartType;
Point: TYPE = GGBasicTypes.Point;
Scene: TYPE = GGModelTypes.Scene;
Segment: TYPE = GGSegmentTypes.Segment;
SelectionClass: TYPE = GGInterfaceTypes.SelectionClass;
Sequence: TYPE = GGModelTypes.Sequence;
SliceParts: TYPE = GGModelTypes.SliceParts;
SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor;
Traj: TYPE = GGModelTypes.Traj;
TrajEnd: TYPE = GGModelTypes.TrajEnd;
TrajGenerator: TYPE = GGModelTypes.TrajGenerator;
The Outline Slice Class
CreateOutline: PROC [traj: Traj, lineEnds: Imager.StrokeEnd ← square, fillColor: Imager.Color ← Imager.black] RETURNS [outline: Outline];
CreateOutline creates a simple outline with a single trajectory. The lineEnds of an open outline, or the fill color of closed outline are stored in the outline record.
AddHole: PROC [outline: Outline, hole: Traj] RETURNS [holier: Outline];
ReplaceFence: PROC [outline: Outline, newFence: Traj] RETURNS [newOutline: Outline];
ReplaceHole: PROC [outline: Outline, oldHole, newHole: Traj] RETURNS [newOutline: Outline];
PartsFromSequence: PROC [outline: Outline, seq: Sequence] RETURNS [sliceParts: SliceParts];
CopyParts: PROC [outline: Outline, parts: SliceParts] RETURNS [copy: SliceParts];
FindTrajInDescriptor: PROC [outlineD: OutlineDescriptor, traj: Traj] RETURNS [seq: Sequence];
Needed by GGSelectImpl.FindSelectedSequence.
SaveSelectionsInOutline: PROC [outline: Outline, scene: Scene];
RemakeSelectionsFromOutline: PROC [outline: Outline, scene: Scene];
SaveSelectionInTraj: PROC [traj: Traj, selectClass: SelectionClass, scene: Scene];
RemakeSelectionFromTraj: PROC [traj: Traj, scene: Scene, selectClass: SelectionClass];
SequencesOfOutline: PROC [outlineD: OutlineDescriptor] RETURNS [seqList: LIST OF Sequence];
RemoveTraj: PROC [outlineD: OutlineDescriptor, traj: Traj];
UnpackOnePointDescriptorOld: PROC [outlineD: OutlineDescriptor] RETURNS [traj: Traj, isACP: BOOL, segNum, cpNum, jointNum: NAT];
UnpackOnePointDescriptor: PROC [sliceD: SliceDescriptor] RETURNS [traj: Traj, isACP: BOOL, segNum, cpNum, jointNum: NAT];
UnpackOneSegmentDescriptorOld: PROC [outlineD: OutlineDescriptor] RETURNS [traj: Traj, segNum: NAT];
UnpackOneSegmentDescriptor: PROC [sliceD: SliceDescriptor] RETURNS [traj: Traj, segNum: NAT];
UnpackSimpleDescriptorOld: PROC [outlineD: OutlineDescriptor] RETURNS [success: BOOL, partType: TrajPartType, traj: Traj, joint: Joint ← NIL, jointNum: NAT ← 999, cp: Point, cpNum: NAT ← 999, seg: Segment ← NIL, segNum: NAT ← 999];
UnpackSimpleDescriptor: PROC [sliceD: SliceDescriptor] RETURNS [success: BOOL, partType: TrajPartType, traj: Traj, joint: Joint ← NIL, jointNum: NAT ← 999, cp: Point, cpNum: NAT ← 999, seg: Segment ← NIL, segNum: NAT ← 999];
NearestJointToHitData: PROC [hitData: REF ANY] RETURNS [jointNum: NAT, traj: Traj];
UnpackHitData: PROC [hitData: REF ANY] RETURNS [traj: Traj, hitType: GGModelTypes.TrajPartType, segNum, cpNum, jointNum: INT, hitPoint: Point];
This will go away when the Caret machinery is revised.
UpdateDescriptorBoundBoxes: PROC [outlineD: OutlineDescriptor];
Update the bound boxes of all contained sequences.
For use by GGTrajImpl only
UpdateOutlineBoundBox: PROC [slice: Outline];
Used by GGSelect to do a DeselectTraj.
Queries about Trajectories
OutlineOfTraj: PROC [traj: Traj] RETURNS [outline: Outline];
Up one level (traj -> outline). Finds the unique outline to which traj belongs.
Queries about Outlines.
HasHoles: PROC [outline: Outline] RETURNS [BOOL];
FenceOfOutline: PROC [outline: Outline] RETURNS [fence: Traj];
HolesOfOutline: PROC [outline: Outline] RETURNS [trajGen: TrajGenerator];
TrajsInOutline: PROC [outline: Outline] RETURNS [trajGen: TrajGenerator];
Generates all of the holes of outline.
END.