Class to detect intersections. More...
#include <Inventor/collision/SoIntersectionDetectionAction.h>
Public Types | |
enum | Resp { NEXT_PRIMITIVE , NEXT_SHAPE , ABORT } |
Types definitions. More... | |
enum | Axis { X_AXIS = 1 , Y_AXIS = 2 , Z_AXIS = 4 } |
Axis. More... | |
enum | Position { BEGIN , END } |
Position. More... | |
typedef Resp | SoIntersectionCB(void *userData, const SoIntersectingPrimitive *, const SoIntersectingPrimitive *) |
Public Types inherited from SoAction | |
enum | DistribMode { LOCAL_ONLY , CLUSTER_ONLY , ALL } |
This is used to define the way an action is distributed across a cluster. More... | |
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... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoIntersectionDetectionAction () | |
Constructor. | |
~SoIntersectionDetectionAction () | |
Destructor. | |
void | apply (SoNode *node) |
Initiates an action on the graph defined by a node. | |
void | apply (SoPath *path) |
Initiates an action on the graph defined by a path. | |
void | apply (const SoPathList &pathList, SbBool obeysRules=FALSE) |
Initiates an action on the graph defined by a list of paths. | |
void | setFilterCallback (SoIntersectionFilterCB *newFilterCB, void *data=NULL) |
Sets a filter which allow the user to continue or not the intersection finding for a pair of shapes. | |
void | addIntersectionCallback (SoIntersectionCB *f, void *userData=NULL) |
Adds a callback to be called when there is an intersection. | |
void | removeIntersectionCallback (SoIntersectionCB *f, void *userData=NULL) |
Removes a callback to be called when there is an intersection. | |
Public Member Functions inherited from SoAction | |
virtual | ~SoAction () |
Destructor. | |
virtual void | clearApplyResult () |
When applied, an action may reference nodes or create objects (e.g. | |
virtual void | invalidateState () |
Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
void | stopActionInBranch () |
This function stops the action in the current Scene Graph branch. | |
SbBool | getContinueActionInBranchFlag () const |
This function indicates if the action must stop in the current branch. | |
void | resetContinueActionInBranchFlag () |
This function resets the continue action flag. | |
void | useAlternateRep (const SbBool enable) |
Tell the action to use alternate representations during traversal when available. | |
SbBool | isUsingAlternateRep () const |
Returns TRUE if current action is using alternate representations. | |
void | setSceneManager (SoSceneManager *mgr) |
Set the scene manager associated with this action (if any ). | |
SoSceneManager * | getSceneManager () const |
Return the SoSceneManager associated with this action. | |
virtual void | forwardTraversal (SoNode *node) |
Traverse a node that is not part of the current scenegraph. | |
virtual void | forwardTraversal (SoPath *path) |
Traverse a path that is not part of the current scenegraph. | |
DistribMode | getDistribMode () const |
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
AppliedCode | getWhatAppliedTo () const |
Returns code indicating what action is being applied to. | |
SoNode * | getNodeAppliedTo () const |
Returns the node the action is being applied to. | |
SoPath * | getPathAppliedTo () const |
Returns the path the action is being applied to. | |
const SoPathList * | getPathListAppliedTo () const |
Returns the path list the action is being applied to. | |
const SoPathList * | getOriginalPathListAppliedTo () const |
Returns the original path list the action is being applied to. | |
SbBool | isLastPathListAppliedTo () const |
Returns TRUE if the current list is the last one from the original. | |
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. | |
PathCode | getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices) |
Extender API: available to programmers who wish to extend the toolkit | |
void | traverse (SoNode *node) |
Does traversal of a graph rooted by a node. | |
SbBool | hasTerminated () const |
Returns TRUE if the traversal has reached a termination condition. | |
const SoPath * | getCurPath () |
Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
SoState * | getState () const |
Gets the state from the action. | |
virtual void | setUpState () |
Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
void | setPipeId (int id) |
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
int | getPipeId () const |
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
bool | isBeingApplied () |
Returns TRUE if this action is currently being applied. | |
virtual bool | preDelayedTraversal () |
Method called by SoMultiPassManager before delayed pass traversals. | |
virtual void | postDelayedTraversal () |
Method called by SoMultiPassManager after delayed pass traversals. | |
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 void | setIntersectEpsilon (float epsilon) |
Sets epsilon (small value) to be used in the collision computation. | |
static float | getIntersectEpsilon () |
Queries epsilon (small value) to be used in the collision computation. | |
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 Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Friends | |
class | SoCollisionManager |
Class to detect intersections.
This action allows the programmer to analyze a scene graph to know which pairs of objects within the scene intersect.
The action first detects intersections between pairs of bounding boxes. If such an intersection occurs, the programmer can abort the action or allow it to determine if the primitives of the objects actually collide.
The algorithm can call programmer-supplied callbacks when there is an intersection between two objects.
SoCollisionManager, SoWinCollisionViewer
Definition at line 105 of file SoIntersectionDetectionAction.h.
typedef Resp SoIntersectionDetectionAction::SoIntersectionCB(void *userData, const SoIntersectingPrimitive *, const SoIntersectingPrimitive *) |
Definition at line 126 of file SoIntersectionDetectionAction.h.
Axis.
Enumerator | |
---|---|
X_AXIS | X. |
Y_AXIS | Y. |
Z_AXIS | Z. |
Definition at line 165 of file SoIntersectionDetectionAction.h.
Position.
Enumerator | |
---|---|
BEGIN | Begin. |
END | End. |
Definition at line 175 of file SoIntersectionDetectionAction.h.
Types definitions.
Enumerator | |
---|---|
NEXT_PRIMITIVE | Next primitive. |
NEXT_SHAPE | Next shape. |
ABORT | Abort. |
Definition at line 113 of file SoIntersectionDetectionAction.h.
SoIntersectionDetectionAction::SoIntersectionDetectionAction | ( | ) |
Constructor.
SoIntersectionDetectionAction::~SoIntersectionDetectionAction | ( | ) |
Destructor.
void SoIntersectionDetectionAction::addIntersectionCallback | ( | SoIntersectionCB * | f, |
void * | userData = NULL |
||
) |
Adds a callback to be called when there is an intersection.
|
virtual |
Initiates an action on the graph defined by a list of paths.
TRUE can be passed for the obeysRules flag if the given path list has the following 4 properties:
These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.
Reimplemented from SoAction.
|
virtual |
Initiates an action on the graph defined by a node.
Warning: Most actions call ref() on the node before traversing the scene graph, then call unref() after traversal. If the node's reference count was zero (the default), the call to apply() will cause it to be destroyed.
Reimplemented from SoAction.
|
virtual |
Initiates an action on the graph defined by a path.
Warning: Most actions call ref() on the path before traversing the scene graph, then call unref() after traversal. If the path's reference count was zero (the default), the call to apply() will cause it to be destroyed.
Reimplemented from SoAction.
|
static |
Returns the type identifier for this class.
|
static |
Queries epsilon (small value) to be used in the collision computation.
|
virtual |
Returns the type identifier for this specific instance.
Implements SoTypedObject.
void SoIntersectionDetectionAction::removeIntersectionCallback | ( | SoIntersectionCB * | f, |
void * | userData = NULL |
||
) |
Removes a callback to be called when there is an intersection.
void SoIntersectionDetectionAction::setFilterCallback | ( | SoIntersectionFilterCB * | newFilterCB, |
void * | data = NULL |
||
) |
Sets a filter which allow the user to continue or not the intersection finding for a pair of shapes.
If the callback returns TRUE, the action search for real intersections, else it goes to the next shape pair.
|
static |
Sets epsilon (small value) to be used in the collision computation.
If the distance between two objects is less than epsilon, the objects are considered to have collided.
|
friend |
Definition at line 222 of file SoIntersectionDetectionAction.h.