GGSelect.mesa
Contents: Procedures dealing selecting and deselecting objects, including both selection actions and selection feedback.
Copyright Ó 1985, 1988, 1992 by Xerox Corporation. All rights reserved.
Pier, October 27, 1988 4:22:18 pm PDT
Kurlander August 25, 1986 2:16:06 pm PDT
Bier, June 22, 1989 9:19:52 pm PDT
DIRECTORY
GGBasicTypes, GGCoreTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, GGScene;
GGSelect: CEDAR DEFINITIONS = BEGIN
BoundBox: TYPE = GGCoreTypes.BoundBox;
Caret: TYPE = GGInterfaceTypes.Caret;
Scene: TYPE = GGModelTypes.Scene;
SelectionClass: TYPE = GGSegmentTypes.SelectionClass;
Sequence: TYPE = GGModelTypes.Sequence;
Slice: TYPE = GGModelTypes.Slice;
SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor;
SliceDescriptorGenerator: TYPE = GGModelTypes.SliceDescriptorGenerator;
SliceGenerator: TYPE = GGModelTypes.SliceGenerator;
SliceParts: TYPE = GGModelTypes.SliceParts;
Traj: TYPE = GGModelTypes.Traj;
TrajEnd: TYPE = GGModelTypes.TrajEnd;
SelectAll: PROC [scene: Scene, selectClass: SelectionClass];
SelectEntireSlice: PROC [slice: Slice, scene: Scene, selectClass: SelectionClass];
SelectSlice: PROC [sliceD: SliceDescriptor, scene: Scene, selectClass: SelectionClass];
SelectSliceFromParts: PROC [slice: Slice, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
SaveSelectionsInSliceAllClasses: PROC [slice: Slice, scene: Scene];
ReselectSliceAllClasses: PROC [slice: Slice, scene: Scene];
ReselectTraj: PROC [traj: Traj, trajEnd: TrajEnd, scene: Scene, extend: BOOL] RETURNS [newHot: Sequence];
DeselectEntity: PROC [entity: REF ANY, scene: Scene, selectClass: SelectionClass];
DeselectEntityAllClasses: PROC [entity: REF ANY, scene: Scene];
DeselectAll: PROC [scene: Scene, selectClass: SelectionClass];
DeselectAllAllClasses: PROC [scene: Scene];
DeselectSlice: PROC [slice: Slice, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
DeselectEntireSlice: PROC [slice: Slice, scene: Scene, selectClass: SelectionClass];
Enumerate Selected Objects
IsSelectedInFull:
PROC [slice: Slice, scene: Scene, selectClass: SelectionClass]
RETURNS [
BOOL];
Returns TRUE iff the slice is selected in entirety.
IsSelectedInPart:
PROC [entity:
REF
ANY, scene: Scene, selectClass: SelectionClass]
RETURNS [
BOOL];
Returns TRUE if all or part of entity is selected. These are the cases:
1) entity is a slice. Some outline is selected all or in part.
2) entity is an outline. Some trajectory is selected all or in part.
3) entity is a trajectory. Some joint or segment is selected.
4) entity is a sequence. Some joint or segment is selected
NoSelections:
PROC [scene: Scene, selectClass: SelectionClass]
RETURNS [
BOOL];
Returns TRUE if nothing is currently selected.
FindSelectedSlice: PROC [slice: Slice, selectClass: SelectionClass] RETURNS [sliceD: SliceDescriptor];
GetLastSelection:
PROC [scene: Scene]
RETURNS [sliceD: SliceDescriptor];
If slice is not selected at all, this returns NIL.
DuplicateSelections: PROC [scene: Scene, fromClass: SelectionClass, toClass: SelectionClass];
ForEachOutlineRun: PROC [scene: Scene, selectClass: SelectionClass, runProc: RunProc, segmentsOnly: BOOL ← TRUE, selectNewRuns: BOOL ← FALSE] RETURNS [bBox: BoundBox];
Finds all selected runs (contigous selections of joints and segments, and allows the called to replace them, using a callback proc. This is used for deletion and for changing spline type. IF segmentsOnly is true, ForEachOutlineRun will not call the runProc with runs consisting of a single joint. If selectNewRuns is true, the new runs will be normal selected after ForEachOutlineRun completes.
SubstituteForSegment:
PROC [traj: Traj, segNum:
NAT, newRun: Traj, scene: Scene]
RETURNS [bBox: BoundBox, newTraj: Traj];
Replaces the specified segment with a new run. Probably shouldn't be in GGSelect, but it uses many of the non-public routines used by ForEachOutlineRun.
ListSelected: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [selectedList: LIST OF SliceDescriptor];
SetSelected:
PROC [scene: Scene, selectClass: SelectionClass, selected:
LIST
OF SliceDescriptor];
For each SliceDescriptor in selected that is not obsolete, re-establish that selection. Remember to call DeselectAll[scene, selectClass] if you wish to replace any existing selections.
UniformSelections:
PROC [scene: Scene, selectClass: SelectionClass]
RETURNS [
BOOL];
Returns TRUE if every selected segment (or segment equivalent) has the same looks and every selected fence has the same fill color and every selected text slice has the same font.
END.