Coin
4.0.3
Coin3D core library
|
The SoExtSelection class can be used for extended selection functionality. More...
#include <Inventor/nodes/SoExtSelection.h>
Public Types | |
enum | LassoMode { ALL_SHAPES , VISIBLE_SHAPES } |
enum | LassoPolicy { FULL_BBOX , PART_BBOX , FULL , PART } |
enum | LassoType { NOLASSO , LASSO , RECTANGLE } |
Public Types inherited from SoSelection | |
enum | Policy { SINGLE , TOGGLE , SHIFT , DISABLE } |
Public Types inherited from SoSeparator | |
enum | CacheEnabled { OFF , ON , AUTO } |
Public Types inherited from SoNode | |
enum | NodeType { INVENTOR = 0x0000 , VRML1 = 0x0001 , VRML2 = 0x0002 , INVENTOR_1 = 0x0004 , INVENTOR_2_0 = 0x0008 , INVENTOR_2_1 = 0x0010 , INVENTOR_2_5 = 0x0020 , INVENTOR_2_6 = 0x0040 , COIN_1_0 = 0x0080 , COIN_2_0 = 0x0100 , EXTENSION = 0x0200 , COIN_2_2 = 0x0400 , COIN_2_3 = 0x0800 , COIN_2_4 = 0x1000 , INVENTOR_5_0 = 0x2000 , COIN_2_5 = 0x4000 , COIN_3_0 = 0x8000 , INVENTOR_6_0 = 0x10000 , COIN_4_0 = 0x20000 } |
Static Public Member Functions | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
Static Public Member Functions inherited from SoSelection | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
Static Public Member Functions inherited from SoSeparator | |
static SoType | getClassTypeId (void) |
static int | getNumRenderCaches (void) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
static void | setNumRenderCaches (const int howmany) |
Static Public Member Functions inherited from SoGroup | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
Static Public Member Functions inherited from SoNode | |
static void | audioRenderS (SoAction *action, SoNode *node) |
static void | callbackS (SoAction *action, SoNode *node) |
static int | getActionMethodIndex (const SoType type) |
static void | getBoundingBoxS (SoAction *action, SoNode *node) |
static SoNode * | getByName (const SbName &name) |
static int | getByName (const SbName &name, SoNodeList &l) |
static SoType | getClassTypeId (void) |
static uint32_t | getCompatibilityTypes (const SoType &nodetype) |
static void | getMatrixS (SoAction *action, SoNode *node) |
static SbUniqueId | getNextNodeId (void) |
static void | getPrimitiveCountS (SoAction *action, SoNode *node) |
static void | GLRenderS (SoAction *action, SoNode *node) |
static void | handleEventS (SoAction *action, SoNode *node) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
static void | initClasses (void) |
static void | pickS (SoAction *action, SoNode *node) |
static void | rayPickS (SoAction *action, SoNode *node) |
static void | searchS (SoAction *action, SoNode *node) |
static void | writeS (SoAction *action, SoNode *node) |
Static Public Member Functions inherited from SoFieldContainer | |
static void | addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) |
static SoFieldContainer * | checkCopy (const SoFieldContainer *orig) |
static void | cleanupClass (void) |
static void | copyDone (void) |
static SoFieldContainer * | findCopy (const SoFieldContainer *orig, const SbBool copyconnections) |
static SoType | getClassTypeId (void) |
This static method returns the SoType object associated with objects of this class. | |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
static void | initCopyDict (void) |
Static Public Member Functions inherited from SoBase | |
static void | addName (SoBase *const base, const char *const name) |
static SbBool | connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) |
static void | decrementCurrentWriteCounter (void) |
static SoType | getClassTypeId (void) |
This static method returns the SoType object associated with objects of this class. | |
static SoBase * | getNamedBase (const SbName &name, SoType type) |
static int | getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) |
static SbBool | getTraceRefs (void) |
static void | incrementCurrentWriteCounter (void) |
static void | initClass (void) |
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
static SbBool | read (SoInput *input, SoBase *&base, SoType expectedtype) |
static SbBool | readRoute (SoInput *input) |
static void | removeName (SoBase *const base, const char *const name) |
static void | setInstancePrefix (const SbString &c) |
static void | setTraceRefs (SbBool trace) |
Public Attributes | |
SoSFEnum | lassoMode |
SoSFEnum | lassoPolicy |
SoSFEnum | lassoType |
Public Attributes inherited from SoSelection | |
SoSFEnum | policy |
Public Attributes inherited from SoSeparator | |
SoSFEnum | boundingBoxCaching |
SoSFEnum | pickCulling |
SoSFEnum | renderCaching |
SoSFEnum | renderCulling |
Static Protected Member Functions | |
static const SoFieldData ** | getFieldDataPtr (void) |
Static Protected Member Functions inherited from SoSelection | |
static const SoFieldData ** | getFieldDataPtr (void) |
Static Protected Member Functions inherited from SoSeparator | |
static const SoFieldData ** | getFieldDataPtr (void) |
Static Protected Member Functions inherited from SoGroup | |
static const SoFieldData ** | getFieldDataPtr (void) |
Static Protected Member Functions inherited from SoNode | |
static const SoFieldData ** | getFieldDataPtr (void) |
static int | getNextActionMethodIndex (void) |
static void | incNextActionMethodIndex (void) |
static void | setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) |
static void | setNextActionMethodIndex (int index) |
Static Protected Member Functions inherited from SoBase | |
static uint32_t | getCurrentWriteCounter (void) |
static void | staticDataLock (void) |
static void | staticDataUnlock (void) |
Additional Inherited Members | |
Protected Types inherited from SoBase | |
enum | BaseFlags { IS_ENGINE = 0x01 , IS_GROUP = 0x02 } |
Protected Attributes inherited from SoSelection | |
SbBool | callPickCBOnlyIfSelectable |
SoCallbackList * | changeCBList |
SoCallbackList * | deselCBList |
SoCallbackList * | finishCBList |
SoPath * | mouseDownPickPath |
void * | pickCBData |
SoSelectionPickCB * | pickCBFunc |
SbBool | pickMatching |
SoCallbackList * | selCBList |
SoPathList | selectionList |
SoCallbackList * | startCBList |
Protected Attributes inherited from SoGroup | |
SoChildList * | children |
Protected Attributes inherited from SoNode | |
SbUniqueId | uniqueId |
Protected Attributes inherited from SoFieldContainer | |
SbBool | isBuiltIn |
Static Protected Attributes inherited from SoNode | |
static int | nextActionMethodIndex = 0 |
static SbUniqueId | nextUniqueId = 1 |
The SoExtSelection class can be used for extended selection functionality.
This class enables you to select geometry by specifying a lasso (a polygon) or a rectangle on screen. When objects are selected, you'll receive the same callbacks as for the SoSelection node.
The application programmer interface of this class is somewhat complex, due to its non-trivial functionality. To see an extensive usage example of the SoExtSelection node, we advise you to go look at the "extselection" example application in the "nodes/" directory of the SoGuiExamples Mercurial repository. Further information and links for downloading and building this module should be available at github.com/coin3d/soguiexamples.
This node class is an extension versus the original SGI Inventor v2.1 API. It is based on the API of VSG (was TGS) Inventor's SoExtSelection, and we aim to be fully compatible with this node to enable users to switch between using Coin and VSG Inventor. Please contact us if you find discrepancies between Coin's SoExtSelection and VSG's SoExtSelection node.
FILE FORMAT/DEFAULTS:
Enum for specifying how objects are selected.
Enum for type of lasso selection.
Enumerator | |
---|---|
NOLASSO | Makes this node behave like a normal SoSelection node. |
LASSO | Select objects using a lasso. Selections can be aborted by the end-user by hitting the |
RECTANGLE | Select objects using a rectangle. Selections can be aborted by the end-user by hitting the |
SoExtSelection::SoExtSelection | ( | void | ) |
Constructor.
|
protectedvirtual |
Destructor.
Sets whether the lasso should be animated by scrolling the line pattern.
This static method returns the SoType object associated with objects of this class.
|
protectedvirtual |
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL
.
Reimplemented from SoSelection.
|
staticprotected |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Returns the SoFieldData class which holds information about fields in this node.
Returns lasso coordinates in device coordinates.
This function is currently just stubbed.
Returns lasso coordinates in world coordinates.
This function is currently just stubbed.
float SoExtSelection::getLassoWidth | ( | void | ) |
Returns the lasso line width.
int SoExtSelection::getOverlayLassoColorIndex | ( | void | ) |
Obsoleted in Coin, use SoExtSelection::getLassoColor() instead.
SoSeparator * SoExtSelection::getOverlaySceneGraph | ( | void | ) |
Returns the scene graph for overlay rendering. Will always return NULL in Coin, as this method has been obsoleted.
(It is probably used in TGS Inventor from the SoXt / SoWin libraries' So[Xt|Win]RenderArea class to fetch the overlay graph to draw, and as such should be treated as an internal method.)
const SoPathList & SoExtSelection::getSelectionPathList | ( | ) | const |
Returns a path list containing selected objects.
This function is currently just stubbed.
Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and "downward" casting.
Reimplemented from SoSelection.
|
virtual |
SGI Open Inventor v2.1 obsoleted support for SoGLRenderAction::addMethod(). Instead, GLRender() might be called directly, and to optimize traversal, the SoSeparator node calls GLRenderBelowPath whenever the path code is BELOW_PATH or NO_PATH (path code is guaranteed not to change). To be compatible with SGI's Inventor (and thereby also TGS') we have chosen to follow their implementation in this respect.
SoSeparator::GLRenderBelowPath() does not traverse its children using SoChildList::traverse(), but calls GLRenderBelowPath() directly for all its children.
Reimplemented from SoSeparator.
|
virtual |
Action method for SoHandleEventAction.
Inspects the event data from action, and processes it if it is something which this node should react to.
Nodes influencing relevant state variables for how event handling is done also override this method.
Reimplemented from SoSelection.
SbBool SoExtSelection::isOverlayLassoAnimated | ( | void | ) |
Returns whether the lasso is set to animate or not.
SbBool SoExtSelection::isUsingOverlay | ( | void | ) |
Returns whether overlay planes are used to draw the lasso.
void SoExtSelection::select | ( | SoNode * | root, |
int | numcoords, | ||
SbVec2f * | lasso, | ||
const SbViewportRegion & | vp, | ||
SbBool | shiftpolicy ) |
Simulate lasso selection programmatically.
This function is currently just stubbed.
void SoExtSelection::select | ( | SoNode * | root, |
int | numcoords, | ||
SbVec3f * | lasso, | ||
const SbViewportRegion & | vp, | ||
SbBool | shiftpolicy ) |
Simulate lasso selection programmatically.
This function is currently just stubbed.
void SoExtSelection::setLassoFilterCallback | ( | SoLassoSelectionFilterCB * | f, |
void * | userdata = NULL, | ||
const SbBool | callonlyifselectable = TRUE ) |
The lasso selection filter callback is called when a node is about to be selected, and enables the application programmer to return a new path to be used when selecting. The new returned path should not be ref'd. SoExtSelection will ref() and unref() it.
To cancel the selection, return NULL from the callback.
if callonlyifselectable is TRUE, the callback will only be invoked when the path to the new node pass through the SoExtSelection node.
This method is specific to Coin, and is not part of TGS OIV.
Sets the lasso line width. Default value is 1.0.
void SoExtSelection::setLineSegmentFilterCallback | ( | SoExtSelectionLineSegmentCB * | func, |
void * | userdata = NULL ) |
Sets the callback that will be called for every line segment inside the lasso/rectangle when selecting.
The callback should return FALSE
if it wants to continue being invoked. When the callback returns TRUE
, the object/shape is selected, and no more callbacks will be invoked for the object.
Obsoleted in Coin, use SoExtSelection::setLassoColor() instead.
Sets the lasso line pattern. Default value is 0xf0f0.
void SoExtSelection::setPointFilterCallback | ( | SoExtSelectionPointCB * | func, |
void * | userdata = NULL ) |
Sets the callback that will be called for every point inside the lasso/rectangle when selecting.
The callback should return FALSE
if it wants to continue being invoked. When the user returns TRUE
, the object/shape is selected, and no more callbacks will be invoked for the object.
void SoExtSelection::setTriangleFilterCallback | ( | SoExtSelectionTriangleCB * | func, |
void * | userdata = NULL ) |
Sets the callback that will be called for every triangle inside the lasso/rectangle when selecting.
The callback should return FALSE
if it wants to continue being invoked. When the callback returns TRUE
, the object/shape is selected, and no more callbacks will be invoked for the object.
void SoExtSelection::useOverlay | ( | SbBool | overlay = TRUE | ) |
Specifies whether the overlay planes should be used to render the lasso.
This method has been obsoleted in Coin, as most graphics cards comes without support for overlay rendering. A better strategy is to just "overlay" the lasso graphics on top of the scene after everything else has been rendered – and this is the strategy we apply in Coin.
SbBool SoExtSelection::wasShiftDown | ( | void | ) | const |
Returns whether the SHIFT
key was pressed during the latest user interaction. This is useful if you want to respect the shift policy while selecting primitives.
This method is specific to Coin, and is not part of TGS OIV.
SoSFEnum SoExtSelection::lassoMode |
Field for lasso mode. Default value is ALL_SHAPES.
Set this field to VISIBLE_SHAPES to make only the primitives visible from the current viewpoint be selected.
SoSFEnum SoExtSelection::lassoPolicy |
Field for lasso policy. Default value is FULL_BBOX.
SoSFEnum SoExtSelection::lassoType |
Field for lasso type. Default value is SoExtSelection::NOLASSO.
Selections with type SoExtSelection::RECTANGLE or SoExtSelection::LASSO can be aborted by the end-user by hitting the END
key on the keyboard.