GGSelect.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by Bier on December 28, 1986 4:25:16 pm PST
Contents: Procedures dealing selecting and deselecting objects, including both selection actions and selection feedback.
Pier, November 20, 1986 12:22:35 pm PST
Kurlander August 25, 1986 2:16:06 pm PDT
DIRECTORY
GGBasicTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, GGObjects;
GGSelect: CEDAR DEFINITIONS = BEGIN
BoundBox: TYPE = GGBasicTypes.BoundBox;
Caret: TYPE = GGInterfaceTypes.Caret;
EntityGenerator: TYPE = GGModelTypes.EntityGenerator;
Outline: TYPE = GGModelTypes.Outline;
OutlineDescriptor: TYPE = GGModelTypes.OutlineDescriptor;
Scene: TYPE = GGModelTypes.Scene;
SelectionClass: TYPE = GGSegmentTypes.SelectionClass;
Sequence: TYPE = GGModelTypes.Sequence;
SequenceGenerator: TYPE = GGModelTypes.SequenceGenerator;
Slice: TYPE = GGModelTypes.Slice;
SliceParts: TYPE = GGModelTypes.SliceParts;
SliceGenerator: TYPE = GGModelTypes.SliceGenerator;
SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor;
SliceDescriptorGenerator: TYPE = GGModelTypes.SliceDescriptorGenerator;
Traj: TYPE = GGModelTypes.Traj;
TrajEnd: TYPE = GGModelTypes.TrajEnd;
TrajGenerator: TYPE = GGModelTypes.TrajGenerator;
Select and Deselect
SelectAll: PROC [scene: Scene, selectClass: SelectionClass];
SelectOutline: PROC [outline: Outline, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
SelectEntireOutline: PROC [outline: Outline, scene: Scene, selectClass: SelectionClass];
outline is now selected. This overrides any selections on outline's parts.
SelectSlice: PROC [slice: Slice, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
SelectEntireSlice: PROC [slice: Slice, scene: Scene, selectClass: SelectionClass];
SelectTraj: PROC [traj: Traj, scene: Scene, selectClass: SelectionClass];
traj is now selected. This overrides any selections on traj's parts. THIS PROC for backward compatibility. Please use SelectOutline.
SelectSequence: PROC [seq: Sequence, scene: Scene, selectClass: SelectionClass];
THIS PROC for backward compatibility. Please use SelectOutline.
ReselectTraj: PROC [traj: Traj, trajEnd: TrajEnd, scene: Scene, extend: BOOL];
DeselectAllAllClasses: PROC [scene: Scene];
DeselectAll: PROC [scene: Scene, selectClass: SelectionClass];
DeselectEntity: PROC [entity: REF ANY, scene: Scene, selectClass: SelectionClass];
DeselectEntityAllClasses: PROC [entity: REF ANY, scene: Scene];
DeselectOutline: PROC [outline: Outline, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
DeselectEntireOutline: PROC [outline: Outline, scene: Scene, selectClass: SelectionClass];
DeselectTraj: PROC [traj: Traj, scene: Scene, selectClass: SelectionClass];
traj is now deselected. This overrides any selections on traj's parts. THIS PROC for backward compatibility. Please use DeselectOutline.
DeselectSequence: PROC [seq: Sequence, scene: Scene, selectClass: SelectionClass];
THIS PROC for backward compatibility. Please use DeselectOutline.
DeselectSlice: PROC [slice: Slice, parts: SliceParts, scene: Scene, selectClass: SelectionClass];
Updating selections after objects are modified
SaveSelectionsInOutline: PROC [outline: Outline, scene: Scene];
The outline is about to have some of its pieces copies. We want those pieces to inherit selection information from the original. Store this information in the original.
SaveSelectionInTraj: PUBLIC PROC [traj: Traj, selectClass: SelectionClass, scene: Scene];
Save selection data internally (in preparation for trajectory surgery)
RemakeSelectionsFromOutline: PROC [outline: Outline, scene: Scene];
This outline has just been created by copying parts from an existing outline. The selection information was copied as well. Make sequences from the selection bits, and select these sequences.
Enumerate Selected Objects
IsSelectedInFull: PROC [entity: REF ANY, scene: Scene, selectClass: SelectionClass] RETURNS [BOOL];
Returns TRUE iff the entity 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.
ListSelectedDescendants: PROC [entity: REF ANY, scene: Scene, selectClass: SelectionClass] RETURNS [components: LIST OF REF ANY];
FindSelectedSequence: PROC [traj: Traj, scene: Scene, selectClass: SelectionClass] RETURNS [seq: Sequence];
If trajectory is not selected at all, this returns NIL.
ListSelected: PUBLIC PROC [scene: Scene, selectClass: SelectionClass] RETURNS [selectedList: LIST OF REF ANY];
FindSequenceInList: PUBLIC PROC [traj: Traj, selectedList: LIST OF REF ANY] RETURNS [seq: Sequence];
FindSelectedOutline: PROC [outline: Outline, scene: Scene, selectClass: SelectionClass] RETURNS [outlineD: OutlineDescriptor];
If trajectory is not selected at all, this returns NIL.
FindSelectedSlice: PROC [slice: Slice, scene: Scene, selectClass: SelectionClass] RETURNS [sliceD: SliceDescriptor];
If trajectory is not selected at all, this returns NIL.
SelectedStuff: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [selectedGen: EntityGenerator];
Returns a generator for all selected entities (i.e. everything which is selected as selectClass).
SelectedSequences: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [seqGen: SequenceGenerator];
SelectedOutlines: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [outDGen: GGModelTypes.OutlineDescriptorGenerator];
SelectedSlices: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [sliceDescGen: SliceDescriptorGenerator];
NextSliceDescriptor: PROC [g: SliceDescriptorGenerator] RETURNS [next: SliceDescriptor];
NextOutlineDescriptor: PROC [g: GGModelTypes.OutlineDescriptorGenerator] RETURNS [next: OutlineDescriptor];
DeletedFromSelection: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [deleted: EntityGenerator];
Creates separate outlines for each run on the selected list and puts these runs and any slices on the selected list into the returned EntityGenerator. Used to remember selected elements for use by Undelete.
OutlineSequenceGenerator: TYPE = REF OutlineSequenceGeneratorObj;
OutlineSequenceGeneratorObj: TYPE = RECORD [
list: LIST OF OutlineSequence
];
OutlineSequence: TYPE = REF OutlineSequenceObj;
OutlineSequenceObj: TYPE = RECORD [
outline: Outline,  -- the outline represented by this record
fenceSeq: Sequence,  -- included parts of the fence trajectory
holeSeqs: SequenceGenerator -- included parts of holes
];
SelectedOutlineSequences: PROC [scene: Scene, selectClass: SelectionClass] RETURNS [outSeqGen: OutlineSequenceGenerator];
Returns a generator for all selected sequences, grouped by outline.
NextOutlineSequences: PROC [outSeqGen: OutlineSequenceGenerator] RETURNS [outSeq: OutlineSequence];
RunProc: TYPE = PROC [run: Sequence] RETURNS [traj: Traj];
ForEachOutlineRun: PROC [scene: Scene, caret: Caret, selectClass: SelectionClass, runProc: RunProc, segmentsOnly: BOOLTRUE, selectNewRuns: BOOLFALSE] 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.
END.