Open Inventor Reference
SoPickAction Class Reference

Abstract base class for picking objects in a scene. More...

#include <Inventor/actions/SoPickAction.h>

Inheritance diagram for SoPickAction:
SoAction SoRayPickAction

Public Member Functions

void setViewportRegion (const SbViewportRegion &newRegion)
 Sets current viewport region to use for action.
 
const SbViewportRegiongetViewportRegion () const
 Returns current viewport region to use for action.
 
void enableCulling (bool flag)
 Setting this flag to FALSE disables any pick culling that might take place (as in SoSeparators).
 
bool isCullingEnabled () const
 
- Public Member Functions inherited from SoAction
virtual ~SoAction ()
 Destructor.
 
virtual SoType getTypeId () const =0
 Returns the type identifier for a specific instance.
 
bool isOfType (SoType type) const
 Returns TRUE if this instance is of the type specified in type or is derived from that type.
 
virtual void apply (SoNode *node)
 
virtual void apply (SoPath *path)
 
virtual void apply (const SoPathList &pathList, bool obeysRules=FALSE)
 Initiates an action on the graph defined either by a node, path, or list of paths.
 
virtual void invalidateState ()
 Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied.
 
AppliedCode getWhatAppliedTo () const
 Returns code indicating what action is being applied to.
 
SoNodegetNodeAppliedTo () const
 These returns a pointer to the node, path, or path list the action is being applied to.
 
SoPathgetPathAppliedTo () const
 
const SoPathListgetPathListAppliedTo () const
 A single path list may be split into several, one for each different head node.
 
const SoPathListgetOriginalPathListAppliedTo () const
 
bool isLastPathListAppliedTo () const
 
PathCode getPathCode (int &numIndices, const int *&indices)
 Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.
 
void traverse (SoNode *node)
 Does traversal of a graph rooted by a node.
 
bool hasTerminated () const
 Returns TRUE if the traversal has reached a termination condition.
 
const SoPathgetCurPath ()
 Returns a pointer to the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed.
 
SoStategetState () const
 Get the state from the action.
 
PathCode getCurPathCode () const
 These methods maintain the current path accumulated so far during traversal.
 
void pushCurPath (int childIndex)
 
void popCurPath (PathCode prevPathCode)
 
virtual SoNodegetCurPathTail ()
 This is virtual, so that SoCallbackAction can use current node.
 
void usePathCode (int &numIndices, const int *&indices)
 called by inline getPathCode:
 
void pushCurPath ()
 Optimized versions of push/pop when we know path codes won't change:
 
void popPushCurPath (int childIndex)
 
void popCurPath ()
 
const SoLightweightPathgetCurrentLightweightPath () const
 Returns the current "light" path.
 
void setCurrentLightweightPath (const SoLightweightPath &path)
 Sets the current "light" path.
 

Static Public Member Functions

static void initClass ()
 
- Static Public Member Functions inherited from SoAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void nullAction (SoAction *, SoNode *)
 Null action method that can be stored in lookup table when desired.
 
static void initClass ()
 
static void initClasses ()
 Initialize ALL Inventor action classes.
 

Protected Member Functions

 SoPickAction (const SbViewportRegion &viewportRegion)
 Constructor takes viewport region.
 
virtual ~SoPickAction ()
 Destructor.
 
virtual void beginTraversal (SoNode *node)
 Initiates action on graph.
 
- Protected Member Functions inherited from SoAction
 SoAction ()
 Constructor.
 
virtual const SoEnabledElementsListgetEnabledElements () const
 Returns the list of enabled elements for a given action subclass.
 
virtual void beginTraversal (SoNode *node)
 Begins traversal of an action at the given node.
 
void setTerminated (bool flag)
 Allows subclass instance to indicate that traversal has reached a termination condition.
 
virtual bool shouldCompactPathLists () const
 This method is used when applying an action to an SoPathList.
 

Protected Attributes

SbViewportRegion vpRegion
 Current viewport region.
 
- Protected Attributes inherited from SoAction
SoStatestate
 Traversal state.
 
SoActionMethodListtraversalMethods
 The list of what to do when.
 

Additional Inherited Members

- Public Types inherited from SoAction
enum  AppliedCode { NODE , PATH , PATH_LIST }
 This enum is used to determine what the action is being applied to. More...
 
enum  PathCode { NO_PATH , IN_PATH , BELOW_PATH , OFF_PATH }
 This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More...
 
- Static Protected Attributes inherited from SoAction
static SoEnabledElementsListenabledElements
 Holds list of enabled elements for the SoAction class.
 
static SoActionMethodListmethods
 ... and the methods
 

Detailed Description

This is an abstract base class for all picking actions. Currently, the only supported subclass is the SoRayPickAction.

See Also
SoRayPickAction

Definition at line 77 of file SoPickAction.h.

Constructor & Destructor Documentation

◆ SoPickAction()

SoPickAction::SoPickAction ( const SbViewportRegion viewportRegion)
protected

See comments for the setViewportRegion() method.

◆ ~SoPickAction()

virtual SoPickAction::~SoPickAction ( )
protectedvirtual

Member Function Documentation

◆ beginTraversal()

virtual void SoPickAction::beginTraversal ( SoNode node)
protectedvirtual

Reimplemented from SoAction.

Reimplemented in SoRayPickAction.

◆ enableCulling()

void SoPickAction::enableCulling ( bool  flag)
inline

This can be used for nodes (such as SoArray and SoMultipleCopy) that traverse their children multiple times in different locations, thereby avoiding computing bounding boxes each time. (This problem is very severe when each bounding box traversal also traverses the children N times.) The default setting is TRUE.

Definition at line 99 of file SoPickAction.h.

◆ getViewportRegion()

const SbViewportRegion & SoPickAction::getViewportRegion ( ) const
inline

Definition at line 89 of file SoPickAction.h.

◆ initClass()

static void SoPickAction::initClass ( )
static

◆ isCullingEnabled()

bool SoPickAction::isCullingEnabled ( ) const
inline

Definition at line 100 of file SoPickAction.h.

◆ setViewportRegion()

void SoPickAction::setViewportRegion ( const SbViewportRegion newRegion)

Even though the picking operation may not involve a window per se, some nodes need this information to determine their size and placement.

Member Data Documentation

◆ vpRegion

SbViewportRegion SoPickAction::vpRegion
protected

Definition at line 106 of file SoPickAction.h.


The documentation for this class was generated from the following file: