Abstract base class for all actions. More...
#include <Inventor/actions/SoAction.h>
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
This enum is used to determine what the action is being applied to.
This is used to define the way an action is distributed across a cluster.
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.
virtual SoAction::~SoAction | ( | ) | [virtual] |
Destructor.
virtual void SoAction::apply | ( | const SoPathList & | pathList, | |
SbBool | obeysRules = FALSE | |||
) | [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 SoToU3DAction, SoVectorizeAction, SoBevelAction, SoGlobalSimplifyAction, SoGLRenderAction, SoRayPickAction, SoReorganizeAction, SoShapeSimplifyAction, SoSplitGeometryAction, SoToHTMLAction, SoIntersectionDetectionAction, and SoSTLWriteAction.
virtual void SoAction::apply | ( | SoPath * | path | ) | [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.
virtual void SoAction::apply | ( | SoNode * | node | ) | [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, SoToHTMLAction, SoIntersectionDetectionAction, and SoSTLWriteAction.
virtual void SoAction::clearApplyResult | ( | ) | [inline, virtual] |
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.
virtual void SoAction::forwardTraversal | ( | SoPath * | path | ) | [virtual] |
Traverse a path that is not part of the current scenegraph.
Similar to forwardTraversal(SoNode*) but for paths.
Reimplemented in SoCallbackAction.
virtual void SoAction::forwardTraversal | ( | SoNode * | node | ) | [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 SoCallbackAction.
static SoType SoAction::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoTypedObject.
Reimplemented in SoToPDFAction, SoToU3DAction, SoVectorizeAction, SoVectorizeCGMAction, SoVectorizeGDIAction, SoVectorizeHPGLAction, SoVectorizePSAction, SoBevelAction, SoBoxHighlightRenderAction, SoCallbackAction, SoColorHighlightRenderAction, SoDistributeAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoGlobalSimplifyAction, SoGLRenderAction, SoHaloHighlightRenderAction, SoHandleEventAction, SoHighlightRenderAction, SoLineHighlightRenderAction, SoNurbsBREPAction, SoPickAction, SoRayPickAction, SoReorganizeAction, SoSearchAction, SoSearchPathAction, SoSearchStepAction, SoShapeSimplifyAction, SoSimplifyAction, SoSplitGeometryAction, SoToHTMLAction, SoWriteAction, SoIntersectionDetectionAction, and SoSTLWriteAction.
SbBool SoAction::getContinueActionInBranchFlag | ( | ) | const [inline] |
This function indicates if the action must stop in the current branch.
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.
DistribMode SoAction::getDistribMode | ( | ) | const [inline] |
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
Default is LOCAL_ONLY.
virtual const SoEnabledElementsList& SoAction::getEnabledElements | ( | ) | const [virtual] |
Returns the list of enabled elements for a given action subclass.
SoNode* SoAction::getNodeAppliedTo | ( | ) | const [inline] |
Returns the node the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class.
const SoPathList* SoAction::getOriginalPathListAppliedTo | ( | ) | const [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.
SoPath* SoAction::getPathAppliedTo | ( | ) | const [inline] |
Returns the path the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class.
PathCode SoAction::getPathCode | ( | int & | numIndices, | |
const int *& | indices | |||
) | [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.
PathCode SoAction::getPathCodeMI | ( | int & | numIndices, | |
const int *& | indices, | |||
const int *& | instanceIndices | |||
) | [inline] |
const SoPathList* SoAction::getPathListAppliedTo | ( | ) | const [inline] |
Returns the path list the action is being applied to.
Returns NULL if the action is not being applied to the appropriate class.
int SoAction::getPipeId | ( | ) | const [inline] |
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
SoSceneManager* SoAction::getSceneManager | ( | ) | const [inline] |
Return the SoSceneManager associated with this action.
SoState* SoAction::getState | ( | ) | const [inline] |
Gets the state from the action.
AppliedCode SoAction::getWhatAppliedTo | ( | ) | const [inline] |
Returns code indicating what action is being applied to.
SbBool SoAction::hasTerminated | ( | ) | const [inline] |
Returns TRUE if the traversal has reached a termination condition.
virtual void SoAction::invalidateState | ( | ) | [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.
bool SoAction::isBeingApplied | ( | ) | [inline] |
Returns TRUE if this action is currently being applied.
SbBool SoAction::isLastPathListAppliedTo | ( | ) | const [inline] |
Returns TRUE if the current list is the last one from the original.
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.
virtual void SoAction::postDelayedTraversal | ( | ) | [inline, virtual] |
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
virtual bool SoAction::preDelayedTraversal | ( | ) | [inline, virtual] |
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
void SoAction::resetContinueActionInBranchFlag | ( | ) | [inline] |
This function resets the continue action flag.
void SoAction::setPipeId | ( | int | id | ) | [inline] |
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
void SoAction::setSceneManager | ( | SoSceneManager * | mgr | ) | [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).
virtual void SoAction::setUpState | ( | ) | [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.
void SoAction::stopActionInBranch | ( | ) | [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.
void SoAction::traverse | ( | SoNode * | node | ) |
Does traversal of a graph rooted by a node.
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 class SoDB [friend] |
friend class SoMultiPassElement [friend] |