Abstract base class for all actions. More...
#include <Inventor/actions/SoAction.h>
Public Types | |
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 | ~SoAction () |
Destructor. | |
virtual void | apply (SoNode *node) |
Initiates an action on the graph defined by a node. | |
virtual void | apply (SoPath *path) |
Initiates an action on the graph defined by a path. | |
virtual void | apply (const SoPathList &pathList, SbBool obeysRules=FALSE) |
Initiates an action on the graph defined by a list of paths. | |
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. | |
virtual const SoEnabledElementsList & | getEnabledElements () const |
Returns the list of enabled elements for a given action subclass. | |
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 | |
virtual SoType | getTypeId () const =0 |
Returns the type identifier for a specific instance. | |
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 | 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 | SoDB |
class | SoMultiPassElement |
Abstract base class for all actions.
SoAction is the base class for all actions. Classes derived from SoAction define operations to be applied at each node encountered during traversal of a scene graph. The function that gets called to implement the action for a particular node type is determined by a lookup table in the global database.
An action may be applied to a node (SoNode), a path (SoPath) or a list of paths (SoPathList).
Reference counting:
Hidden references:
SoNode, SoPath, SoPathList, SoCallbackAction, SoGLRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction, SoPickAction, SoRayPickAction, SoSearchAction, SoWriteAction
Definition at line 132 of file SoAction.h.
This enum is used to determine what the action is being applied to.
Extender API: available to programmers who wish to extend the toolkit
Enumerator | |
---|---|
NODE | Applied to graph rooted by a node. |
PATH | Applied to graph defined by a path. |
PATH_LIST | Applied to graphs defined by list of paths. |
Definition at line 313 of file SoAction.h.
This is used to define the way an action is distributed across a cluster.
Extender API: available to programmers who wish to extend the toolkit
Enumerator | |
---|---|
LOCAL_ONLY | Action is only applied by the application. |
CLUSTER_ONLY | Action is only applied by OIRU of the cluster. |
ALL | Both application and cluster apply the action. |
Definition at line 286 of file SoAction.h.
enum SoAction::PathCode |
This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed.
Extender API: available to programmers who wish to extend the toolkit
Enumerator | |
---|---|
NO_PATH | Not traversing a path. |
IN_PATH | In middle of path chain (not tail node) |
BELOW_PATH | Tail node of path or below tail node. |
OFF_PATH | None of the above (Probably to the left) |
Definition at line 327 of file SoAction.h.
|
virtual |
Destructor.
|
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 in SoGlobalSimplifyAction, SoReorganizeAction, SoShapeSimplifyAction, SoSplitGeometryAction, SoToHTMLAction, SoToU3DAction, SoVectorizeAction, SoBevelAction, SoGLRenderAction, SoRayPickAction, SoIntersectionDetectionAction, and SoSTLWriteAction.
|
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 in SoToU3DAction, SoVectorizeAction, SoBevelAction, SoBoxHighlightRenderAction, SoGlobalSimplifyAction, SoGLRenderAction, SoHighlightRenderAction, SoRayPickAction, SoReorganizeAction, SoShapeSimplifyAction, SoSplitGeometryAction, SoIntersectionDetectionAction, SoSTLWriteAction, and SoToHTMLAction.
|
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 in SoToU3DAction, SoVectorizeAction, SoBevelAction, SoGlobalSimplifyAction, SoGLRenderAction, SoRayPickAction, SoReorganizeAction, SoShapeSimplifyAction, SoSplitGeometryAction, SoToHTMLAction, SoIntersectionDetectionAction, and SoSTLWriteAction.
|
inlinevirtual |
When applied, an action may reference nodes or create objects (e.g.
SoPath) that reference nodes. This is especially true for SoSearchAction and SoRayPickAction. These references will prevent the nodes from being destroyed and so may appear to be a "memory leak".
All references are cleared when the action is destroyed or re-applied. However it may be useful to clear them explicitly to remove references to nodes.
Reimplemented in SoGlobalSimplifyAction, SoHandleEventAction, SoHighlightRenderAction, SoRayPickAction, and SoSearchAction.
Definition at line 189 of file SoAction.h.
|
virtual |
Traverse a node that is not part of the current scenegraph.
Like an SoNodeKit, the contents of the specified sub-scenegraph won't be visible as an SoPath. Casting the path to a SoFullPath allows access to the whole path.
This method can be used to delegate an action to an internal/private scene graph. So a node can have an internal scene graph without actually being a "group" node. This is a convenient way to implement "composite" nodes that create their behavior using other Open Inventor nodes.
The node parameter can be of any type. Sensors may still be attached directly to nodes and fields in the internal scene graph.
This method must not be called from a node derived from SoGroup or SoBaseKit. This method should not be called on nodes that are part of the public/visible scene graph.
Reimplemented in SoToU3DAction.
|
virtual |
Traverse a path that is not part of the current scenegraph.
Similar to forwardTraversal(SoNode*) but for paths.
Reimplemented in SoToU3DAction.
|
static |
Returns the type identifier for this class.
|
inline |
This function indicates if the action must stop in the current branch.
Definition at line 212 of file SoAction.h.
const SoPath * SoAction::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.
Extender API: available to programmers who wish to extend the toolkit
|
inline |
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
Default is LOCAL_ONLY. Extender API: available to programmers who wish to extend the toolkit
Definition at line 300 of file SoAction.h.
|
virtual |
Returns the list of enabled elements for a given action subclass.
Extender API: available to programmers who wish to extend the toolkit
|
inline |
Returns the node the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class. Extender API: available to programmers who wish to extend the toolkit
Definition at line 349 of file SoAction.h.
|
inline |
Returns the original path list the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class.
Definition at line 377 of file SoAction.h.
|
inline |
Returns the path the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class. Extender API: available to programmers who wish to extend the toolkit
Definition at line 356 of file SoAction.h.
|
inline |
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.
If this returns IN_PATH, indices is set to point to an array of indices corresponding to the children that must be traversed for a correct traversal of all the paths to which the action is being applied. numIndices is set to the number of such children. Extender API: available to programmers who wish to extend the toolkit
Definition at line 402 of file SoAction.h.
|
inline |
Extender API: available to programmers who wish to extend the toolkit
Definition at line 412 of file SoAction.h.
|
inline |
Returns the path list the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class.
Definition at line 366 of file SoAction.h.
|
inline |
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
Extender API: available to programmers who wish to extend the toolkit
Definition at line 483 of file SoAction.h.
|
inline |
Return the SoSceneManager associated with this action.
Definition at line 248 of file SoAction.h.
|
inline |
Gets the state from the action.
Definition at line 446 of file SoAction.h.
|
inline |
Returns code indicating what action is being applied to.
Extender API: available to programmers who wish to extend the toolkit
Definition at line 342 of file SoAction.h.
|
inline |
Returns TRUE if the traversal has reached a termination condition.
Extender API: available to programmers who wish to extend the toolkit
Definition at line 430 of file SoAction.h.
|
virtual |
Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied.
This is typically unnecessary in most applications.
Reimplemented in SoGLRenderAction.
|
inline |
Returns TRUE if this action is currently being applied.
Extender API: available to programmers who wish to extend the toolkit
Definition at line 490 of file SoAction.h.
|
inline |
Returns TRUE if the current list is the last one from the original.
Definition at line 387 of file SoAction.h.
SbBool SoAction::isUsingAlternateRep | ( | ) | const |
Returns TRUE if current action is using alternate representations.
Default is FALSE.
Null action method that can be stored in lookup table when desired.
Extender API: available to programmers who wish to extend the toolkit
|
inlinevirtual |
Method called by SoMultiPassManager after delayed pass traversals.
Overriding this method can be useful for actions that want to apply some post processing after all delayed pass traversals. Since Open Inventor 9.1 Extender API: available to programmers who wish to extend the toolkit
Definition at line 509 of file SoAction.h.
|
inlinevirtual |
Method called by SoMultiPassManager before delayed pass traversals.
Overriding this method can be useful for actions that want to skip the traversal of all delayed passes. Returning false skips the delayed pass traversals. Since Open Inventor 9.1 Extender API: available to programmers who wish to extend the toolkit
Definition at line 499 of file SoAction.h.
|
inline |
This function resets the continue action flag.
Definition at line 218 of file SoAction.h.
|
inline |
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
Extender API: available to programmers who wish to extend the toolkit
Definition at line 475 of file SoAction.h.
|
inline |
Set the scene manager associated with this action (if any ).
When appropriate, this allows the action to query information like the OpenGL rendering context. The SoSCeneManager class calls this method automatically for the actions that it creates (SoHandleEventAction, SoRayPickAction, etc).
Definition at line 242 of file SoAction.h.
|
virtual |
Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created.
Automatically called by the apply() methods, but can be useful for application to get a non-null state pointer to "pre-load" certain elements. Extender API: available to programmers who wish to extend the toolkit
|
inline |
This function stops the action in the current Scene Graph branch.
Note: It doesn't mean we kill the action!
It is mainly used to stop the GetBoundingBox action in the SoBBox node.
Definition at line 204 of file SoAction.h.
void SoAction::traverse | ( | SoNode * | node | ) |
Does traversal of a graph rooted by a node.
Extender API: available to programmers who wish to extend the toolkit
void SoAction::useAlternateRep | ( | const SbBool | enable | ) |
Tell the action to use alternate representations during traversal when available.
See SoNode::getAternateRep(). Default is FALSE. When true, it is the responsibility of each SoNode derived object to choose to provide or not an alternate representation for a given action.
|
friend |
Definition at line 800 of file SoAction.h.
|
friend |
Definition at line 801 of file SoAction.h.