SoExtSelection Class |
Selection node that supports lasso selection.
Namespace: OIV.Inventor.Nodes
The SoExtSelection type exposes the following members.
Name | Description | |
---|---|---|
SoExtSelection | Constructor. |
Name | Description | |
---|---|---|
AddChild | Adds a child at the end of the list of children. | |
AffectsState | Returns true if a node has an effect on the state during traversal. | |
AnimateOverlayLasso | Obsolete. Calls AnimateOverlayLasso(true). | |
AnimateOverlayLasso(Boolean) | Obsolete. Sets the the lasso animation flag. | |
Callback | (Inherited from SoSeparator.) | |
ClearCacheList | (Inherited from SoSeparator.) | |
Copy | Calls Copy(false). (Inherited from SoNode.) | |
Copy(Boolean) | Creates and returns an exact copy of the node. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Deselect(Int32) | Deselects a path by removing it from the selection list. | |
Deselect(SoNode) | Deselects the passed node by creating a path to it, and removing the node from the selection list by calling deselect(path) . | |
Deselect(SoPath) | Deselects the passed path by removing it from the selection list. | |
DeselectAll | Deselects all paths in the selection list, that is, clear the list. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Distribute | (Inherited from SoNode.) | |
DoAction | (Inherited from SoSeparator.) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
FindChild | Finds index of given child within group. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). | |
GetBoundingBox | (Overrides SoSeparatorGetBoundingBox(SoGetBoundingBoxAction).) | |
GetChild | Returns pointer the child node with the given index. | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetLassoColor | Obsolete. Gets the lasso color. | |
GetLassoCoordsDC | Returns the lasso coordinates in device coordinates. | |
GetLassoCoordsWC | Returns the lasso coordinates in world coordinates. | |
GetLassoWidth | Obsolete. Gets the lasso line width. | |
GetList | Returns the list of selected paths. | |
GetMatrix | (Inherited from SoSeparator.) | |
GetName | Returns the name of an instance. | |
GetNumChildren | Returns number of children. | |
GetNumSelected | Returns the number of paths in the selection list. | |
GetOverlayLassoColorIndex | Obsolete. Gets the lasso color index. | |
GetOverlayLassoPattern | Obsolete. Gets the lasso stipple pattern. | |
GetOverlaySceneGraph | Returns the scene graph that should be passed to the render area function setOverlaySceneGraph . | |
GetPath | Returns the ith path in the selection list. | |
GetPickRadius | Returns the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
GetPrimitiveCount | (Inherited from SoSeparator.) | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetSelectionPathList | Returns paths list of selected objects. | |
GetSelectionSceneGraph | Returns the scenegraph displayed as "lasso" in fast edit mode. | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Overrides SoSeparatorGLRender(SoGLRenderAction).) | |
GLRenderBelowPath | (Inherited from SoSeparator.) | |
GLRenderInPath | (Inherited from SoSeparator.) | |
GLRenderOffPath | (Inherited from SoSeparator.) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Overrides SoSelectionHandleEvent(SoHandleEventAction).) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
InsertChild | Adds a child so that it becomes the one with the given index. | |
IsBoundingBoxIgnoring | Used by BoundingBoxAction to known if bounding box computation should be ignored or not. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsOverlayLassoAnimated | Obsolete. Gets the the lasso animation flag. | |
IsOverride | Returns the state of the override flag. | |
IsPickMatching | Returns pick matching flag. | |
IsSelected(SoNode) | Returns true if the passed node is selected by creating a path to it, then calling OIV.Inventor.Nodes.SoSelection.IsSelected(OIV.Inventor.SoPath). | |
IsSelected(SoPath) | Returns true if the passed path is selected, that is, if it is in the selection list. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
IsUsingFastEditing | Gets whether the lasso is drawn using fast editing. | |
Pick | (Inherited from SoGroup.) | |
RayPick | (Inherited from SoSeparator.) | |
RemoveAllChildren | Removes all children from group. | |
RemoveChild(Int32) | Removes child with given index from group. | |
RemoveChild(SoNode) | Removes first instance of given child from group. | |
ReplaceChild(Int32, SoNode) | Replaces child with given index with new child. | |
ReplaceChild(SoNode, SoNode) | Replaces first instance of given child with new child. | |
Search | (Overrides SoSeparatorSearch(SoSearchAction).) | |
Select(SoNode) | Selects the passed node by creating a path to it, and adding the path to the selection list by calling select(path) . | |
Select(SoPath) | Selects the passed path by adding it to the selection list. | |
Select(SoNode, Int32, SbVec2f, SbViewportRegion, Boolean) | ||
Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SetLassoColor | Obsolete. Sets the lasso color. | |
SetLassoWidth | Obsolete. Sets the lasso line width. | |
SetName | (Inherited from SoBase.) | |
SetOverlayLassoColorIndex | Obsolete. Sets the lasso color index. | |
SetOverlayLassoPattern | Obsolete. Sets the lasso stipple pattern. | |
SetOverride | Turns the override flag on or off. | |
SetPickFilterCallback(SoSelectionPickCB) | Calls SetPickFilterCallback(f, true). (Inherited from SoSelection.) | |
SetPickFilterCallback(SoSelectionPickCB, Boolean) | The pick filter callback is invoked when a pick has occurred and the selection node is about to change the selection list. | |
SetPickMatching | OIV.Inventor.Nodes.SoSelection will pick once on mouse down and once on mouse up, and make sure the picks match before changing the selection list. | |
SetPickRadius | Sets the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
SetSelectionSceneGraph | Sets the scenegraph to be displayed as "lasso" in fast edit mode. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
Toggle(SoNode) | Toggles the selection status of the passed node by creating a path to it, then calling toggle(path) . | |
Toggle(SoPath) | Toggles the selection status of the passed path - if the path is in the selection list, it is removed; if not in the list, it is added. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
UseFastEditing | Calls UseFastEditing(true). | |
UseFastEditing(Boolean) | Sets whether the lasso should be drawn using fast editing. | |
Write | (Inherited from SoGroup.) |
Name | Description | |
---|---|---|
animateLasso | Controls lasso animation. | |
boundingBoxCaching | (Inherited from SoSeparator.) | |
boundingBoxIgnoring | Whether to ignore this node during bounding box traversal. | |
EndSelectionCallback | Sets the callback called when the mouse button is released in selection mode. | |
fastEditing | Specifies the fast edit mode of the separator node. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
Item | Returns the ith path in the selection list. | |
lassoColor | Color of lasso. | |
lassoMode | Specifies the lasso mode (whether ALL_SHAPES or only VISIBLE_SHAPES can be selected). | |
lassoPattern | Stipple pattern. | |
lassoPatternScaleFactor | Stipple pattern scale factor. | |
lassoPolicy | Specifies the lasso policy. | |
lassoType | Specifies lasso type (none, lasso, or rectangle). | |
lassoWidth | Width of lasso. | |
LineSegmentFilterCallback | Sets the line segment filter callback. | |
MovingSelectionCallback | Sets the callback called when the mouse is moved in selection mode. | |
pickCulling | Whether to cull during picking traversal. | |
PointFilterCallback | Sets the point filter callback. | |
policy | Selection policy that is followed in response to user interaction. | |
renderCaching | Obsolete. Whether to cache during rendering traversal. | |
renderCulling | Whether to cull during rendering traversal. | |
renderUnitId | Used during the ScaleViz depth compositing process, this field specifies which render unit (OIRU) will render the sub scene graph below this separator. | |
StartSelectionCallback | Sets the callback called when the mouse button is clicked in selection mode. | |
TriangleFilterCallback | Sets the triangle filter delegate. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
Name | Description | |
---|---|---|
Deselection | (Inherited from SoSelection.) | |
FinishSelection | (Inherited from SoSelection.) | |
OnPreFilter | The ExtSelection will traverse each node of scene graph and test intersection against each nodes. | |
Selection | (Inherited from SoSelection.) | |
StartSelection | (Inherited from SoSelection.) |
This class extends the functionality of OIV.Inventor.Nodes.SoSelection to allow the user to select an object or multiple objects by drawing a lasso around the object(s) to be selected. The lasso can be represented as a rectangle between the mouse up and down positions or as a set of lines that the user draws around the objects, depending on the field OIV.Inventor.Nodes.SoExtSelection.lassoType. When OIV.Inventor.Nodes.SoExtSelection.lassoType is NOLASSO, or when the lasso is empty (the screen coordinates of the button down and button up event are the same), OIV.Inventor.Nodes.SoExtSelection behaves exactly like its parent class OIV.Inventor.Nodes.SoSelection.
See OIV.Inventor.Nodes.SoSelection for more information about managing the selection list and automatically highlighting the selected shape(s).
Objects are selected if they are surrounded by the lasso or if the lasso intersects them, depending on the field OIV.Inventor.Nodes.SoExtSelection.lassoPolicy, as follows:
FULL_BBOX: lasso selects objects whose bounding box is completely contained by the lasso
PART_BBOX: lasso selects objects whose bounding box intersects the lasso (or is contained by the lasso)
FULL: lasso selects objects whose geometry is completely contained by the lasso
PART: lasso selects objects whose geometry intersects the lasso (or is contained by the lasso)
FULL and PART require more computation and are generally slower.
A lasso mode controls whether only visible shapes (front shapes) are selectable, by controlling the selection algorithm used, either geometry-based or pixel-based. A specific lasso mode may also be preferred for performance reasons depending on the scene.
Primitive details for selected parts of shapes can be obtained through dedicated callbacks that can be also used to filter the selection. These primitive filter callbacks can be called for each generated primitive.
When using OIV.Inventor.Nodes.SoExtSelection node, the delegateset by setPickFilterCallback will be called only once per selected shape. Only OIV.Inventor.SoPickedPoint.GetPath() makes sense for the picked point passed to the pick filter delegatein this case. Other OIV.Inventor.SoPickedPoint methods may return undefined results.
Lasso selection can be also be controlled programmatically, without requiring user interaction.
NOTE: Using the FastEdit mode:
FastEdit mode provides the advantages of overlay mode without the overlay hardware support requirement. See OIV.Inventor.Nodes.SoSeparator for more information about the fast editing feature. FastEdit mode can allow the lasso geometry to be redrawn at interactive rates even when the underlying scene takes a long time to redraw. On Windows platforms, it also avoids using GDI to draw the lasso, which conflicts with the "Aero" user interface mode on Windows Vista.
When the application uses fast editing it must call the function useFastEdit(true) first. If it doesn't call this function, operations which require fast edit will output a warning in debug mode.
FastEdit mode also provides some powerful additional features including the option to provide custom (and dynamic) lasso geometry (see the OIV.Inventor.Nodes.SoExtSelection.SetSelectionSceneGraph(OIV.Inventor.Nodes.SoNode) method) and the option to set callbacks on mouse events during selection (see the methods OIV.Inventor.Nodes.SoExtSelection.StartSelectionCallback, OIV.Inventor.Nodes.SoExtSelection.EndSelectionCallback, and OIV.Inventor.Nodes.SoExtSelection.MovingSelectionCallback). The geometry in the selection scene graph can be dynamically updated by the application as the user moves the cursor, using these callbacks. This can useful to display dynamic feedback without actually doing selection. For example to display a "rubber band" line while positioning annotations or measurements. However note that the selection scene graph is always traversed, not just when the user is selecting. It is the application's responsibility to empty the selection scene graph (or hide its contents using an OIV.Inventor.Nodes.SoSwitch) when appropriate.
Note: The geometry in the selection scene graph is not automatically used for selection. (It may not be appropriate.) However the application can use the OIV.Inventor.Nodes.SoExtSelection.Select(OIV.Inventor.Nodes.SoNode, System.Int32, OIV.Inventor.SbVec2f[], OIV.Inventor.SbViewportRegion, System.Boolean) method, if desired, to do a selection using any set of 2D points defining a "lasso".
Finally note that since Open Inventor 8.6, OIV.Inventor.Drawers.SoScreenDrawer and its specialized sub-classes provide a more general mechanism for interactively drawing polylines, rectangles, ellipses, etc in screen space.
Clipping: OIV.Inventor.Nodes.SoExtSelection avoids selecting shapes that are culled by active OIV.Inventor.Nodes.SoClipPlane in both the ALL_SHAPES and VISIBLE Lasso modes. The user can disable this, and restore the legacy behavior of OIV.Inventor.Nodes.SoExtSelection before Open Inventor 9.4.0, by setting the environment variable OIV_SELECTION_USE_CLIPPLANES to 0 (see OIV.Inventor.SoPreferences).
Instancing: When instance nodes of a OIV.Inventor.Nodes.SoMultipleInstance or a OIV.Inventor.Nodes.SoMultipleCopy group are selected, the application can get the instance identifier using the OIV.Inventor.SoPath method getInstanceIndex().
See OIV.Inventor.Nodes.SoSelection for additional information about the selection list and code example.
ExtSelection {
boundingBoxCaching | AUTO |
renderCulling | AUTO |
pickCulling | AUTO |
policy | SHIFT |
lassoType | NOLASSO |
lassoPolicy | FULL_BBOX |
lassoMode | ALL_SHAPES |
fastEditing | DISABLE |