File: SVSelections.mesa
Last edited by: Eric Bier on January 16, 1985 5:29:51 pm PST
Created on July 11, 1984 11:27:40 am PDT
Contents: Definitions for several kinds of selection objects in Solidviews including Movees and Targets.
DIRECTORY
Graphics,
SV2d,
SV3d,
SVModelTypes,
SVRayTypes,
SVSceneTypes,
SVInterfaceTypes;
SVSelections: CEDAR DEFINITIONS =
BEGIN
Assembly: TYPE = SVSceneTypes.Assembly;
Camera: TYPE = SVModelTypes.Camera;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
EditToolData: TYPE = SVInterfaceTypes.EditToolData;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Point2d: TYPE = SV2d.Point2d;
Primitive: TYPE = SVRayTypes.Primitive;
Scene: TYPE = SVSceneTypes.Scene;
ViewerToolData: TYPE = SVInterfaceTypes.ViewerToolData;
A Skitter is an interactive selection on an object surface. It has no lasting effect unless it is turned into a Movee or Target. There is only one live skitter at a time in the whole world. Skitters only move by interactive pointing. The assembly which is under a live skitter becomes the Star assembly for purposes of shape editing and artwork editing. Skitters have no coordinate system. Just a single matrix to remind them where in WORLD they are. They are viewpoint dependent.
Skitter: TYPE = SVInterfaceTypes.Skitter;
SkitterMode: TYPE = SVInterfaceTypes.SkitterMode;
A single skitter is created at initialization time. The user can update with the following routines:
UpdateSkitter: PROC [assembly: Assembly, primitive: Primitive, viewerToolData: ViewerToolData];
SetModeSkitter: PROC [mode: SkitterMode];
PositionSkitter: PROC [cameraPoint: Point2d, skitterWORLD: Matrix4by4];
ComplementSkitter: PROC [dc: Graphics.Context, camera: Camera];
DrawSkitter: PROC [dc: Graphics.Context, camera: Camera];
KillSkitter: PROC [editToolData: EditToolData];
IsAliveSkitter: PROC [] RETURNS [BOOL];
Remove all pointers to objects. Cease drawing the skitter.
GetSkitterData: PROC [] RETURNS [assembly: Assembly, primitive: Primitive, viewerToolData: ViewerToolData];
GetModeSkitter: PROC [] RETURNS [mode: SkitterMode];
GetPositionSkitter: PROC [] RETURNS [cameraPoint: Point2d, skitterWORLD: Matrix4by4];
Hooks, and Floaters are special primitive assemblies which refer to a special "null" master object. For convenience, we provide procedures here to wire up these objects to a scene.
AddHookFromSkitter: PROC [] RETURNS [assembly: Assembly];
AddFloaterFromSkitter: PROC [] RETURNS [assembly: Assembly];
Movees and Targets are persistent Selections. They refer to one of the following:
1) A Floater's coordSys
2) A Hook coordSys
3) An Object's coordSys.
Movees allow the referent to participate in operations including:
1) A hook movee selects an object to be tugged and a tugboat at the same time.
2) A floater, hook, or object selection allows the selected coordSys to be moved. A hook might be moved around on a surface or might become a floater. An object moves along with its children. A floater moves in space.
3) The origin of an in-scene ray is specified.
4) The origin of a floater calculation is specified.
Targets allow secondary objects to be specified.
1) Any target can be a center of rotation, a base frame for translation.
2) All selectable objects are also assemblies in the scene tree. All assemblies have an associated distinguished plane. Hence a target can suggest a plane to be used for dragging.
3) The direction point of an in-scene ray is specified.
4) The end point of a floater calculation is specified.
Selections do not move interactively as skitters do. They are not really objects at all. Think of them as pointers to coordinate frames which are currently active. If the referent coordinate frame moves, so does the image of the selection.
Selection: TYPE = SVInterfaceTypes.Selection;
ReferentType: TYPE = SVInterfaceTypes.ReferentType; -- {hook, floater, coordSys};
SelectionType: TYPE = SVInterfaceTypes.SelectionType; -- {target, movee};
The system maintains the following lists and distinguished objects:
1) The global skitter.
2) A stack of all movee selections.
3) A stack of all target selections.
CreateHookMovee: PROC [jack: Assembly, indirect: Assembly, viewerToolData: ViewerToolData] RETURNS [movee: Selection];
assembly is the Assembly the hook is sitting on (two levels of indirection). coordSys is the CoordSystem of the Hook (one level of indirection).
CreateCoordSysMovee: PROC [coincident: Assembly, viewerToolData: ViewerToolData] RETURNS [movee: Selection];
CreateHookTarget: PROC [jack: Assembly, indirect: Assembly, viewerToolData: ViewerToolData] RETURNS [target: Selection];
CreateCoordSysTarget: PROC [coincident: Assembly, viewerToolData: ViewerToolData] RETURNS [target: Selection];
CreatePlaneSelection: PROC [coincident: Assembly, viewerToolData: ViewerToolData] RETURNS [planeSel: Selection];
GetSelectionGenerator: PROC [selectType: SelectionType] RETURNS [g: SelectionGenerator, selectionsExist: BOOL];
ComplainIfNot: PROC [selectionsExist: BOOL];
NextSelection: PROC [g: SelectionGenerator] RETURNS [sel: Selection];
NextSelectionCoincident: PROC [g: SelectionGenerator] RETURNS [coin: Assembly];
SelectionGenerator: TYPE = SVInterfaceTypes.SelectionGenerator;
PushMovee: PROC [moveeSel: Selection];
PopMovee: PROC [] RETURNS [moveeSel: Selection];
NextMovee: PROC [] RETURNS [moveeSel: Selection];
Like PopMovee, but doesn't complain if stack is empty.
PopMoveeCoincident: PROC [] RETURNS [movee: Assembly];
NextMoveeCoincident: PROC [] RETURNS [movee: Assembly];
Like PopMoveeCoincident, but doesn't complain if stack is empty.
TopMovee: PROC [] RETURNS [movee: Selection];
Returns NIL if there are none (doesn't complain).
TopMoveeC: PROC [] RETURNS [movee: Selection];
Returns NIL AND complains if there are none.
TopMoveeCoincident: PROC [] RETURNS [movee: Assembly];
Returns NIL if there are none (doesn't complain).
ClearMoveeStack: PROC [editToolData: EditToolData];
PushTarget: PROC [targetSel: Selection];
PopTarget: PROC [] RETURNS [targetSel: Selection];
NextTarget: PROC [] RETURNS [targetSel: Selection];
PopTargetCoincident: PROC [] RETURNS [target: Assembly];
NextTargetCoincident: PROC [] RETURNS [movee: Assembly];
Like PopTargetCoincident, but doesn't complain if stack is empty.
TopTarget: PROC [] RETURNS [targetSel: Selection];
Returns NIL if there are none. (doesn't complain);
TopTargetC: PROC [] RETURNS [targetSel: Selection];
Returns NIL AND complains if there are none.
TopTargetCoincident: PROC [] RETURNS [target: Assembly];
TopTargetCoinCoordSys: PROC [] RETURNS [targetCS: CoordSystem];
Returns NIL if there are none. (doesn't complain);
TopTargetCoinCoordSysC: PROC [] RETURNS [targetCS: CoordSystem];
Returns NIL AND complains if there are none.
ClearTargetStack: PROC [editToolData: EditToolData];
PushPlane: PROC [planeSel: Selection];
PopPlane: PROC [] RETURNS [planeSel: Selection];
TopPlane: PROC [] RETURNS [planeSel: Selection];
Returns NIL if there are none. (doesn't complain);
TopPlaneC: PROC [] RETURNS [planeSel: Selection];
Returns NIL AND complains if there are none.
TopPlaneCoincident: PROC [] RETURNS [planeAssem: Assembly];
PlaneStackEmpty: PROC [] RETURNS [BOOL];
ClearPlaneStack: PROC [editToolData: EditToolData];
ComplementAnySelectionsOnDC: PROC [dc: Graphics.Context, assembly: Assembly, scene: Scene];
ComplementSelection: PROC [viewerToolData: ViewerToolData, sel: Selection];
ComplementSelectionDC: PROC [dc: Graphics.Context, sel: Selection, viewerToolData: ViewerToolData];
ComplementAnySelectionsDC: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData];
ComplementAllSelections: PROC [selType: SelectionType];
ComplementReferentDC: PROC [dc: Graphics.Context, selection: Selection, viewerToolData: ViewerToolData];
Complements assembly in a double-buffered fashion.
KillSkitterAndSelections: PROC [editToolData: EditToolData];
END.