Selection node that supports lasso selection. More...
#include <Inventor/nodes/SoExtSelection.h>
Classes | |
struct | PreFilterEventArg |
Structure given to callback when an event is raised. More... | |
Public Types | |
enum | LassoType { NOLASSO , LASSO , RECTANGLE , ELLIPSE } |
Lasso type. More... | |
enum | LassoPolicy { FULL_BBOX , PART_BBOX , FULL , PART } |
Lasso policy. More... | |
enum | LassoMode { VISIBLE_SHAPES , ALL_SHAPES } |
Lasso mode More... | |
enum | ReturnType { NOSELECT_CONTINUE , SELECT_RETURN , SELECT_CONTINUE , NOSELECT_RETURN } |
Return type. More... | |
typedef SbBool | SoExtSelectionTriangleCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3) |
typedef SbBool | SoExtSelectionLineSegmentCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2) |
typedef SbBool | SoExtSelectionPointCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1) |
typedef SbBool | SelectionEventCallback(const SbVec2s &position, const SbVec3f &scenePosition, SoExtSelection *selection, void *userData) |
This is the declaration to use for selection event callback functions. | |
Public Types inherited from SoSelection | |
enum | Policy { SINGLE , TOGGLE , SHIFT , DISABLE } |
typedef void | SoSelectionPathCB(void *userData, SoPath *path) |
typedef void | SoSelectionClassCB(void *userData, SoSelection *sel) |
typedef SoPath * | SoSelectionPickCB(void *userData, const SoPickedPoint *pick) |
Public Types inherited from SoSeparator | |
enum | CacheEnabled { OFF , ON , AUTO } |
Possible values for caching. More... | |
enum | FastEditing { DISABLE = 0x01 , KEEP_ZBUFFER = 0x02 , CLEAR_ZBUFFER = 0x03 } |
Fast editing policy enumeration values. More... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoExtSelection () | |
Constructor. | |
void | useFastEditing (SbBool flg=TRUE) |
Sets whether the lasso should be drawn using fast editing. | |
SbBool | isUsingFastEditing () |
Gets whether the lasso is drawn using fast editing. | |
SoSeparator * | getOverlaySceneGraph () |
Returns the scene graph that should be passed to the render area function setOverlaySceneGraph . | |
void | select (SoNode *root, int numCoord, SbVec2f *lassoCoord, const SbViewportRegion &viewport, SbBool shiftPressed) |
Simulates interactive selection starting from the root node with the given lasso contour, updating the selection list and triggering any associated callback . | |
virtual void | addChild (SoNode *child) |
Adds a child at the end of the list of children. | |
virtual void | setSelectionSceneGraph (SoNode *sceneGraph) |
Sets the scenegraph to be displayed as "lasso" in fast edit mode. | |
virtual SoNode * | getSelectionSceneGraph () const |
Returns the scenegraph displayed as "lasso" in fast edit mode. | |
virtual void | setStartSelectionCallback (SelectionEventCallback *callback, void *userData=NULL) |
Sets the callback called when the mouse button is clicked in selection mode. | |
virtual void | setEndSelectionCallback (SelectionEventCallback *callback, void *userData=NULL) |
Sets the callback called when the mouse button is released in selection mode. | |
virtual void | setMovingSelectionCallback (SelectionEventCallback *callback, void *userData=NULL) |
Sets the callback called when the mouse is moved in selection mode. | |
void | setTriangleFilterCallback (SoExtSelectionTriangleCB *cb, void *userData=NULL) |
Sets the triangle filter callback . | |
void | setLineSegmentFilterCallback (SoExtSelectionLineSegmentCB *cb, void *userData=NULL) |
Sets the line segment filter callback. | |
void | setPointFilterCallback (SoExtSelectionPointCB *cb, void *userData=NULL) |
Sets the point filter callback. | |
const SbVec2s * | getLassoCoordsDC (int &numCoords) |
Returns the lasso coordinates in device coordinates. | |
const SbVec3f * | getLassoCoordsWC (int &numCoords) |
Returns the lasso coordinates in world coordinates. | |
const SoPathList & | getSelectionPathList () const |
Returns paths list of selected objects. | |
Deprecated | |
SoDEPRECATED void | setOverlayLassoColorIndex (int index) |
Sets the lasso color index. | |
SoDEPRECATED int | getOverlayLassoColorIndex () |
Gets the lasso color index. | |
SoDEPRECATED void | setLassoColor (SbColor c) |
Sets the lasso color. | |
SoDEPRECATED SbColor | getLassoColor () |
Gets the lasso color. | |
SoDEPRECATED void | setLassoWidth (float width) |
Sets the lasso line width. | |
SoDEPRECATED float | getLassoWidth () |
Gets the lasso line width. | |
SoDEPRECATED void | setOverlayLassoPattern (unsigned short pattern) |
Sets the lasso stipple pattern. | |
SoDEPRECATED unsigned short | getOverlayLassoPattern () |
Gets the lasso stipple pattern. | |
SoDEPRECATED void | animateOverlayLasso (SbBool flg=TRUE) |
Sets the the lasso animation flag. | |
SoDEPRECATED SbBool | isOverlayLassoAnimated () |
Gets the the lasso animation flag. | |
Public Member Functions inherited from SoSelection | |
SoSelection () | |
Creates a selection node with the default settings. | |
SoSelection (int nChildren) | |
Constructor that specifies the approximate number of children. | |
void | select (const SoPath *path) |
Selects the passed path by adding it to the selection list. | |
void | select (SoNode *node) |
Selects the passed node by creating a path to it, and adding the path to the selection list by calling select(path) . | |
void | deselect (const SoPath *path) |
Deselects the passed path by removing it from the selection list. | |
void | deselect (int which) |
Deselects a path by removing it from the selection list. | |
void | deselect (SoNode *node) |
Deselects the passed node by creating a path to it, and removing the node from the selection list by calling deselect(path) . | |
void | toggle (const SoPath *path) |
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. | |
void | toggle (SoNode *node) |
Toggles the selection status of the passed node by creating a path to it, then calling toggle(path) . | |
SbBool | isSelected (const SoPath *path) const |
Returns TRUE if the passed path is selected, that is, if it is in the selection list. | |
SbBool | isSelected (SoNode *node) const |
Returns TRUE if the passed node is selected by creating a path to it, then calling isSelected(). | |
SbBool | isSelected (const SoNode *node) const |
Returns TRUE if the passed node is selected by creating a path to it, then calling isSelected(). | |
void | deselectAll () |
Deselects all paths in the selection list, that is, clear the list. | |
int | getNumSelected () const |
Returns the number of paths in the selection list. | |
const SoPathList * | getList () const |
Returns the list of selected paths. | |
SoPath * | getPath (int index) const |
Returns the ith path in the selection list. | |
SoPath * | operator[] (int i) const |
Returns the ith path in the selection list. | |
void | setPickRadius (float radiusInPixels) |
Sets the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
float | getPickRadius () const |
Returns the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
void | addSelectionCallback (SoSelectionPathCB *f, void *userData=NULL) |
Adds selection callback. | |
void | removeSelectionCallback (SoSelectionPathCB *f, void *userData=NULL) |
Removes selection callback. | |
void | addDeselectionCallback (SoSelectionPathCB *f, void *userData=NULL) |
Adds deselection callback. | |
void | removeDeselectionCallback (SoSelectionPathCB *f, void *userData=NULL) |
Removes deselection callback. | |
void | addStartCallback (SoSelectionClassCB *f, void *userData=NULL) |
Adds start callback. | |
void | removeStartCallback (SoSelectionClassCB *f, void *userData=NULL) |
Removes start callback. | |
void | addFinishCallback (SoSelectionClassCB *f, void *userData=NULL) |
Adds finish callback. | |
void | removeFinishCallback (SoSelectionClassCB *f, void *userData=NULL) |
Removes finish callback. | |
void | setPickFilterCallback (SoSelectionPickCB *f, void *userData=NULL, SbBool callOnlyIfSelectable=TRUE) |
The pick filter callback is invoked when a pick has occurred and the selection node is about to change the selection list. | |
void | setPickMatching (SbBool pickTwice) |
SoSelection will pick once on mouse down and once on mouse up, and make sure the picks match before changing the selection list. | |
SbBool | isPickMatching () const |
Returns pick matching flag. | |
Public Member Functions inherited from SoSeparator | |
SoSeparator () | |
Creates a separator node with default settings. | |
SoSeparator (int nChildren) | |
Constructor that takes approximate number of children. | |
Public Member Functions inherited from SoGroup | |
SoGroup () | |
Creates an empty group node. | |
SoGroup (int nChildren) | |
Constructor that takes approximate number of children. | |
virtual void | insertChild (SoNode *child, int newChildIndex) |
Adds a child so that it becomes the one with the given index. | |
virtual SoNode * | getChild (int index) const |
Returns pointer the child node with the given index. | |
virtual int | findChild (const SoNode *child) const |
Finds index of given child within group. | |
virtual int | getNumChildren () const |
Returns number of children. | |
virtual void | removeChild (int index) |
Removes child with given index from group. | |
virtual void | removeChild (SoNode *child) |
Removes first instance of given child from group. | |
virtual void | removeAllChildren () |
Removes all children from group. | |
virtual void | replaceChild (int index, SoNode *newChild) |
Replaces child with given index with new child. | |
virtual void | replaceChild (SoNode *oldChild, SoNode *newChild) |
Replaces first instance of given child with new child. | |
Public Member Functions inherited from SoNode | |
virtual void | setOverride (const SbBool state) |
Turns the override flag on or off. | |
virtual SbBool | isOverride () const |
Returns the state of the override flag. | |
virtual SoNode * | copy (SbBool copyConnections=FALSE) const |
Creates and returns an exact copy of the node. | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
Public Member Functions inherited from SoFieldContainer | |
void | setToDefaults () |
Sets all fields in this object to their default values. | |
SbBool | hasDefaultValues () const |
Returns TRUE if all of the object's fields have their default values. | |
SbBool | fieldsAreEqual (const SoFieldContainer *fc) const |
Returns TRUE if this object's fields are exactly equal to fc's fields. | |
void | copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE) |
Copies the contents of fc's fields into this object's fields. | |
SoNONUNICODE SbBool | set (const char *fieldDataString) |
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. | |
SbBool | set (const SbString &fieldDataString) |
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. | |
void | get (SbString &fieldDataString) |
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
virtual int | getFields (SoFieldList &list) const |
Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
virtual int | getAllFields (SoFieldList &list) const |
Returns a list of fields, including the eventIn's and eventOut's. | |
virtual SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (const SbName &fieldName) const |
Returns the eventOut with the given name. | |
SbBool | getFieldName (const SoField *field, SbName &fieldName) const |
Returns the name of the given field in the fieldName argument. | |
SbBool | enableNotify (SbBool flag) |
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE). | |
SbBool | isNotifyEnabled () const |
Notification is the process of telling interested objects that this object has changed. | |
virtual void | setUserData (void *data) |
Sets application data. | |
void * | getUserData (void) const |
Gets user application data. | |
Public Member Functions inherited from SoBase | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoSelection | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoSeparator | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoGroup | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoNode | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static SoNode * | getByName (const SbName &name) |
A node's name can be set using SoBase::setName(). | |
static int | getByName (const SbName &name, SoNodeList &list) |
A node's name can be set using SoBase::setName(). | |
Static Public Member Functions inherited from SoFieldContainer | |
static SoType | getClassTypeId () |
Returns the type of this class. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Public Attributes | |
SoSFEnum | lassoType |
Specifies lasso type (none, lasso, or rectangle). | |
SoSFEnum | lassoPolicy |
Specifies the lasso policy. | |
SoSFEnum | lassoMode |
Specifies the lasso mode (whether ALL_SHAPES or only VISIBLE_SHAPES can be selected). | |
SoSFBool | animateLasso |
Controls lasso animation. | |
SoSFColor | lassoColor |
Color of lasso. | |
SoSFFloat | lassoWidth |
Width of lasso. | |
SoSFUShort | lassoPattern |
Stipple pattern. | |
SoSFInt32 | lassoPatternScaleFactor |
Stipple pattern scale factor. | |
SbEventHandler< PreFilterEventArg & > | onPreFilter |
The ExtSelection will traverse each node of scene graph and test intersection against each nodes. | |
Public Attributes inherited from SoSelection | |
SoSFEnum | policy |
Selection policy that is followed in response to user interaction. | |
Public Attributes inherited from SoSeparator | |
SoSFEnum | boundingBoxCaching |
Whether to cache during bounding box traversal. | |
SoSFEnum | renderCulling |
Whether to cull during rendering traversal. | |
SoSFEnum | pickCulling |
Whether to cull during picking traversal. | |
SoSFEnum | fastEditing |
Specifies the fast edit mode of the separator node. | |
SoSFInt32 | renderUnitId |
Used during the ScaleViz depth compositing process, this field specifies which render unit (OIRU) will render the sub scene graph below this separator. | |
SoDEPRECATED SoSFEnum | renderCaching |
Whether to cache during rendering traversal. | |
Public Attributes inherited from SoGroup | |
SoSFBool | boundingBoxIgnoring |
Whether to ignore this node during bounding box traversal. | |
Additional Inherited Members | |
Related Symbols inherited from SoSeparator | |
#define | SO_RENDERUNITID_NONE (-1) |
Don't traverse any children. | |
#define | SO_RENDERUNITID_INHERIT (-2) |
Inherit value from state. | |
#define | SO_RENDERUNITID_ALL (-3) |
Traverse all children. | |
Selection node that supports lasso selection.
This class extends the functionality of 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 lassoType. When lassoType is NOLASSO, or when the lasso is empty (the screen coordinates of the button down and button up event are the same), SoExtSelection behaves exactly like its parent class SoSelection.
See 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 lassoPolicy, as follows:
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 SoExtSelection node, the callback set by setPickFilterCallback will be called only once per selected shape. Only SoPickedPoint::getPath() makes sense for the picked point passed to the pick filter callback in this case. Other 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 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 setSelectionSceneGraph() method) and the option to set callbacks on mouse events during selection (see the methods setStartSelectionCallback(), setEndSelectionCallback(), and setMovingSelectionCallback()). 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 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 select() method, if desired, to do a selection using any set of 2D points defining a "lasso".
Finally note that since Open Inventor 8.6, SoScreenDrawer and its specialized sub-classes provide a more general mechanism for interactively drawing polylines, rectangles, ellipses, etc in screen space.
Clipping:
SoExtSelection avoids selecting shapes that are culled by active SoClipPlane(s) in both the ALL_SHAPES and VISIBLE Lasso modes. The user can disable this, and restore the legacy behavior of SoExtSelection before Open Inventor 9.4.0, by setting the environment variable OIV_SELECTION_USE_CLIPPLANES to 0 (see SoPreferences).
Instancing:
When instance nodes of a SoMultipleInstance or a SoMultipleCopy group are selected, the application can get the instance identifier using the SoPath method getInstanceIndex().
See SoSelection for additional information about the selection list and code example.
boundingBoxCaching | AUTO |
renderCulling | AUTO |
pickCulling | AUTO |
policy | SHIFT |
lassoType | NOLASSO |
lassoPolicy | FULL_BBOX |
lassoMode | ALL_SHAPES |
fastEditing | DISABLE |
SoRayPickAction, SoSelection, SoWinRenderArea, SoBoxHighlightRenderAction, SoHaloHighlightRenderAction, SoLineHighlightRenderAction
Definition at line 187 of file SoExtSelection.h.
typedef SbBool SoExtSelection::SelectionEventCallback(const SbVec2s &position, const SbVec3f &scenePosition, SoExtSelection *selection, void *userData) |
This is the declaration to use for selection event callback functions.
See setStartSelectionCallback(), setEndSelectionCallback(), and setMovingSelectionCallback(). These callbacks are useful to modify the selection scene graph (see setSelectionSceneGraph) to implement dynamically changing selection feedback.
Note: These callbacks can only be used in FastEdit mode.
position | The position of the event in pixel coordinates (0,0 is lower left corner). |
scenePosition | The position of the event in normalized -1..1 3D coordinates. |
selection | The selection node that called the function. |
userData | Optional pointer specified when the callback was set. |
Definition at line 505 of file SoExtSelection.h.
typedef SbBool SoExtSelection::SoExtSelectionLineSegmentCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2) |
Definition at line 477 of file SoExtSelection.h.
typedef SbBool SoExtSelection::SoExtSelectionPointCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1) |
Definition at line 485 of file SoExtSelection.h.
typedef SbBool SoExtSelection::SoExtSelectionTriangleCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3) |
Definition at line 468 of file SoExtSelection.h.
Lasso mode
Definition at line 220 of file SoExtSelection.h.
Lasso policy.
Enumerator | |
---|---|
FULL_BBOX | Full bounding box (default) |
PART_BBOX | Partial bounding box. |
FULL | Full. |
PART | Partial. |
Definition at line 208 of file SoExtSelection.h.
Lasso type.
Enumerator | |
---|---|
NOLASSO | No lasso (default) |
LASSO | Lasso. |
RECTANGLE | Rectangle. |
ELLIPSE | Ellipse. |
Definition at line 196 of file SoExtSelection.h.
Return type.
Definition at line 319 of file SoExtSelection.h.
SoExtSelection::SoExtSelection | ( | ) |
Constructor.
|
virtual |
Adds a child at the end of the list of children.
It redefines the SoSeparator::addChild function just to ensure that the selection scenegraph is always the last child in the list.
Reimplemented from SoGroup.
SoDEPRECATED void SoExtSelection::animateOverlayLasso | ( | SbBool | flg = TRUE | ) |
Sets the the lasso animation flag.
This controls whether the lasso is animated (its line pattern changes) or not. Default is FALSE.
|
static |
Returns the type identifier for this class.
SoDEPRECATED SbColor SoExtSelection::getLassoColor | ( | ) |
Gets the lasso color.
Applies only if the lasso is not drawn in the overlay plane.
const SbVec2s * SoExtSelection::getLassoCoordsDC | ( | int & | numCoords | ) |
Returns the lasso coordinates in device coordinates.
const SbVec3f * SoExtSelection::getLassoCoordsWC | ( | int & | numCoords | ) |
Returns the lasso coordinates in world coordinates.
SoDEPRECATED float SoExtSelection::getLassoWidth | ( | ) |
Gets the lasso line width.
SoDEPRECATED int SoExtSelection::getOverlayLassoColorIndex | ( | ) |
Gets the lasso color index.
Applies only if the lasso is drawn in the overlay plane.
SoDEPRECATED unsigned short SoExtSelection::getOverlayLassoPattern | ( | ) |
Gets the lasso stipple pattern.
Values can range from 0 (invisible) to 0xffff (solid).
SoSeparator * SoExtSelection::getOverlaySceneGraph | ( | ) |
Returns the scene graph that should be passed to the render area function setOverlaySceneGraph .
Applies only if the lasso is drawn in the overlay plane.
const SoPathList & SoExtSelection::getSelectionPathList | ( | ) | const |
Returns paths list of selected objects.
|
virtual |
Returns the scenegraph displayed as "lasso" in fast edit mode.
Note: This function is available only in FastEdit mode, returns NULL otherwise.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoSelection.
SoDEPRECATED SbBool SoExtSelection::isOverlayLassoAnimated | ( | ) |
Gets the the lasso animation flag.
SbBool SoExtSelection::isUsingFastEditing | ( | ) |
Gets whether the lasso is drawn using fast editing.
void SoExtSelection::select | ( | SoNode * | root, |
int | numCoord, | ||
SbVec2f * | lassoCoord, | ||
const SbViewportRegion & | viewport, | ||
SbBool | shiftPressed | ||
) |
Simulates interactive selection starting from the root node with the given lasso contour, updating the selection list and triggering any associated callback .
Even though the selection operation may not involve a window per se, some nodes need the viewport information to determine their size and placement.
NOTE: The root node must be the root of a scene graph that includes the camera node. For example, when using an Open Inventor viewer, use getSceneManager()->getSceneGraph().
Setting shiftPressed true simulates the effect of pressing the shift key while selecting, consistent with the SoSelection::Shift policy.
The lasso type can be set using the lassoType field, but the lasso will not be drawn when using this method. The lasso coordinates are given in normalized device coordinates ranging from -1 to +1 in the X and Y directions.
Note: When the lassoType is set to LASSO the objects are selected according to the points defined by the lasso coordinates so the segments between those points are not part of the lasso!.
|
virtual |
Sets the callback called when the mouse button is released in selection mode.
Note: This function is available only in FastEdit mode.
SoDEPRECATED void SoExtSelection::setLassoColor | ( | SbColor | c | ) |
Sets the lasso color.
Applies only if the lasso is not drawn in the overlay plane. This function sets the color in FastEdit mode also. Default is red (1,0,0).
SoDEPRECATED void SoExtSelection::setLassoWidth | ( | float | width | ) |
Sets the lasso line width.
This function sets the width in FastEdit mode also. Default is 1.
void SoExtSelection::setLineSegmentFilterCallback | ( | SoExtSelectionLineSegmentCB * | cb, |
void * | userData = NULL |
||
) |
Sets the line segment filter callback.
See setTriangleFilterCallback() for details.
|
virtual |
Sets the callback called when the mouse is moved in selection mode.
The callback is only called while the mouse button is down.
Note: This function is available only in FastEdit mode.
SoDEPRECATED void SoExtSelection::setOverlayLassoColorIndex | ( | int | index | ) |
Sets the lasso color index.
Applies only if the lasso is drawn in the overlay plane.
SoDEPRECATED void SoExtSelection::setOverlayLassoPattern | ( | unsigned short | pattern | ) |
Sets the lasso stipple pattern.
Values can range from 0 (invisible) to 0xffff (solid). This specifies how dashed or dotted lasso lines will be drawn. This function actually sets the line pattern in all cases, not just overlay. Default is 0xffff (solid).
void SoExtSelection::setPointFilterCallback | ( | SoExtSelectionPointCB * | cb, |
void * | userData = NULL |
||
) |
Sets the point filter callback.
See setTriangleFilterCallback() for details.
|
virtual |
Sets the scenegraph to be displayed as "lasso" in fast edit mode.
Note: This function is available only in FastEdit mode.
The geometry in this scene graph can be dynamically updated by the application as the user moves the cursor. See the methods setStartSelectionCallback(), setMovingSelectionCallback(), etc. This can useful to display dynamic feedback without actually doing selection. For example to display a "rubber band" line while positioning annotation or measurements.
Note: The geometry in this scene graph is not automatically used for selection! (It may not be appropriate.) The application can use the select() method, if desired, to do a selection using any set of 2D points defining a "lasso".
|
virtual |
Sets the callback called when the mouse button is clicked in selection mode.
Note: This function is available only in FastEdit mode.
void SoExtSelection::setTriangleFilterCallback | ( | SoExtSelectionTriangleCB * | cb, |
void * | userData = NULL |
||
) |
Sets the triangle filter callback .
The primitive filter callbacks can be used to retrieve information about the selected primitives of traversed shape nodes - points, line segments, or triangles - and to filter the shape selection based on the selected primitives. These callbacks are called while traversing the scene graph shapes with an SoCallbackAction started by the SoExtSelection node. Whenever a shape primitive is surrounded by the lasso, the callback is called and receives as argument the action and the primitive. Depending on the shape type, the point, line or triangle callback will be called. See SoCallbackAction.
When a callback returns TRUE, the corresponding shape is selected according to the selection policy. Then the selection stops processing the current shape's primitives and continues with the next shape in the scene graph. When a callback returns FALSE, the action continues normally to process the remaining shape's primitives, allowing you to filter or collect additional primitives.
The primitive filter callbacks are called only when the lassoPolicy is set to SoExtSelection::PART and the lassoMode is set to SoExtSelection::ALL_SHAPES.
It is the responsibility of the application to manage the primitive selection policy. Exactly like SoSelection, the node selection list can only handle paths to nodes and cannot store primitive detail information.
void SoExtSelection::useFastEditing | ( | SbBool | flg = TRUE | ) |
Sets whether the lasso should be drawn using fast editing.
When the application uses the FastEdit mode it must call this function first before calling any other function in this class. See also SoGLRenderAction::setFastEditSavePolicy for possible limitations. Default is FALSE.
SoSFBool SoExtSelection::animateLasso |
Controls lasso animation.
Default is FALSE. NOTE: field available since Open Inventor 10.0
Definition at line 274 of file SoExtSelection.h.
SoSFColor SoExtSelection::lassoColor |
Color of lasso.
Default value is red (1,0,0). NOTE: field available since Open Inventor 10.0
Definition at line 280 of file SoExtSelection.h.
SoSFEnum SoExtSelection::lassoMode |
Specifies the lasso mode (whether ALL_SHAPES or only VISIBLE_SHAPES can be selected).
Use enum LassoMode. Default is ALL_SHAPES. It applies only when the lasso policy is FULL or PART. When the lasso mode is VISIBLE_SHAPES, you will only select visible shapes. That is, if a shape is within (or partially within) the lasso volume, but is hidden by another shape, it will not be selected. VISIBLE_SHAPES mode provides faster performance than ALL_SHAPES (the default).
The algorithm for the ALL_SHAPES mode is based on geometry projection while the VISIBLE_SHAPES mode uses offscreen rendering.
When using VISIBLE_SHAPES, none of the primitive selection callback nodes can be called. This means that you cannot retrieve selection details using this mode.
Unlike the ALL_SHAPES mode or the picking action, the VISIBLE_SHAPES mode does not allow you to select multiple overlapping shapes. You cannot select a shape obscured by another.
Definition at line 268 of file SoExtSelection.h.
SoSFUShort SoExtSelection::lassoPattern |
Stipple pattern.
This specifies how dashed or dotted lasso will be drawn. The pattern is a 16-bit series of 0s and 1s and is repeated as necessary to stipple a given line. A 1 indicates that drawing occurs, and a 0 that it does not, on a pixel-by-pixel basis, starting with the low-order bits of the pattern. Values can range from 0 (invisible) to 0xffff (solid). Default is 0xe0e0, corresponding to small dashes.
The line pattern can be stretched using the lassoPatternScaleFactor field. NOTE: field available since Open Inventor 10.0
Definition at line 308 of file SoExtSelection.h.
SoSFInt32 SoExtSelection::lassoPatternScaleFactor |
Stipple pattern scale factor.
It stretches the lasso pattern (see lassoPattern) by multiplying each subseries of consecutive 1s and 0s. Scale factors are clamped to lie between 1 and 255. Default is 1. NOTE: field available since Open Inventor 10.0
Definition at line 316 of file SoExtSelection.h.
SoSFEnum SoExtSelection::lassoPolicy |
Specifies the lasso policy.
See description above. Use enum LassoPolicy. Default is FULL_BBOX.
Definition at line 242 of file SoExtSelection.h.
SoSFEnum SoExtSelection::lassoType |
Specifies lasso type (none, lasso, or rectangle).
Use enum LassoType. Default is NOLASSO.
Definition at line 236 of file SoExtSelection.h.
SoSFFloat SoExtSelection::lassoWidth |
Width of lasso.
The default line width is 0, meaning to use the default OpenGL value (1). Line widths greater than zero are considered to be specified in printer's points, where 1 inch = 72 printer's points. However the default pixels-per-inch value (managed by SbViewportRegion) is also 72. So effectively line width is specified in pixels unless the application sets a different pixels-per-inch value.
Please see the notes in the class description for more information. NOTE: field available since Open Inventor 10.0
Definition at line 293 of file SoExtSelection.h.
SbEventHandler<PreFilterEventArg&> SoExtSelection::onPreFilter |
The ExtSelection will traverse each node of scene graph and test intersection against each nodes.
The event is called before doing intersection test and can be used to skip a particular node to avoid doing costly computation. To skip a node, call the method SoExtSelection::PreFilterEventArg::skipNode() inside your callback.
Definition at line 562 of file SoExtSelection.h.