SoAction

Langue: en

Autres versions - même langue

Version: 323831 (ubuntu - 08/07/09)

Section: 3 (Bibliothèques de fonctions)

Sommaire

NAME

SoAction -

SYNOPSIS


#include <Inventor/actions/SoAction.h>

Inherited by SoAudioRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoGLRenderAction, SoHandleEventAction, SoIntersectionDetectionAction, SoPickAction, SoSearchAction, SoSimplifyAction, SoToVRMLAction, and SoWriteAction.

Detailed Description

The SoAction class is the base class for all traversal actions.

Applying actions is the basic mechanism in Coin for executing various operations on scene graphs or paths within scene graphs, including search operations, rendering, interaction through picking, etc.

The basic operation is to instantiate an action, set it up with miscellaneous parameters if necessary, then call it's apply() method on the root node of the scenegraph (or sub-graph of a scenegraph). The action then traverses the scenegraph from the root node, depth-first and left-to-right, applying it's specific processing at the nodes where it is applicable.

(The SoAction and it's derived classes in Coin is an implementation of the design pattern commonly known as the 'Visitor' pattern.)

Here's a simple example that shows how to use the SoWriteAction to dump a scenegraph in the Inventor format to a file:

    int write_scenegraph(const char * filename, SoNode * root)
    {
      SoOutput output;
      if (output.openFile(filename)) return 0;
 
      // This is where the action is.  ;-)
      SoWriteAction wa(&output);
      wa.apply(root);
 
      return 1;
    }
 

After traversal, some action types have stored information about the (sub-)scenegraph that was traversed, which you can then inquire about through methods like SoGetBoundingBoxAction::getBoundingBox(), SoRayPickAction::getPickedPoint(), SoGetPrimitiveCountAction::getTriangleCount(), etc etc.

See the various built-in actions for further information (ie the subclasses of this class), or look at the example code applications of the Coin library to see how actions are generally used.

For extending the Coin library with your own classes, we strongly recommend that you make yourself acquainted with the excellent «The Inventor Toolmaker» book (ISBN 0-201-62493-1), which describes the tasks involved in detail. This book was written by the original SGI Inventor designers and explains many of the underlying design ideas, aswell as having lots of hands-on examples on how to extend the Coin toolkit in ways that are true to the fundamental design ideas. («The Inventor Toolmaker» is also available at SGI's online library, at no cost. See Download The Inventor Toolmaker.) Reading the sourcecode of the built-in classes in Coin should also provide very helpful.

The following example shows the basic outline on how to set up your own extension action class:

   // This is sample code on how you can get progress indication on Coin
   // export operations by extending the library with your own action
   // class. The new class inherits SoWriteAction. The code is presented
   // as a stand-alone example.
   //
   // The general technique is to inherit SoWriteAction and override it's
   // 'entry point' into each node of the scenegraph. The granularity of
   // the progress callbacks is on a per-node basis, which should usually
   // be good enough.
   
   #include <Inventor/SoDB.h>
   #include <Inventor/actions/SoWriteAction.h>
   #include <Inventor/nodes/SoSeparator.h>
   
   
 
   class MyWriteAction : public SoWriteAction {
     SO_ACTION_HEADER(SoWriteAction);
   
   public:
     MyWriteAction(SoOutput * out);
     virtual ~MyWriteAction();
   
     static void initClass(void);
   
   protected:
     virtual void beginTraversal(SoNode * node);
   
   private:
     static void actionMethod(SoAction *, SoNode *);
     int nrnodes;
     int totalnrnodes;
   };
   
 
   SO_ACTION_SOURCE(MyWriteAction);
   
   MyWriteAction::MyWriteAction(SoOutput * out)
     : SoWriteAction(out)
   {
     SO_ACTION_CONSTRUCTOR(MyWriteAction);
   }
   
   MyWriteAction::~MyWriteAction()
   {
   }
   
   void
   MyWriteAction::initClass(void)
   {
     SO_ACTION_INIT_CLASS(MyWriteAction, SoWriteAction);
   
     SO_ACTION_ADD_METHOD(SoNode, MyWriteAction::actionMethod);
   }
   
   void
   MyWriteAction::beginTraversal(SoNode * node)
   {
     this->nrnodes = 0;
     this->totalnrnodes = 0;
     SoWriteAction::beginTraversal(node);
   }
   
   void
   MyWriteAction::actionMethod(SoAction * a, SoNode * n)
   {
     // To abort the export process in mid-writing, we could just avoid
     // calling in to the SoNode::writeS() method.
     SoNode::writeS(a, n);
   
     MyWriteAction * mwa = (MyWriteAction *)a;
     SoOutput * out = mwa->getOutput();
     if (out->getStage() == SoOutput::COUNT_REFS) {
       mwa->totalnrnodes++;
     }
     else { //  (out->getStage() == SoOutput::WRITE)
       mwa->nrnodes++;
       SbString s;
       s.sprintf(' # wrote node %p (%d/%d) , n, mwa->nrnodes, mwa->totalnrnodes);
       out->write(s.getString());
     }
   }
   
 
   int
   main(int argc, char ** argv)
   {
     if (argc < 2) {
       (void)fprintf(stderr, 'nUsage: %s <filename>n', argv[0]);
       exit(1);
     }
   
     SoDB::init();
     MyWriteAction::initClass();
   
     SoInput in;
     if (!in.openFile(argv[1])) { exit(1); }
   
     SoSeparator * root = SoDB::readAll(&in);
     if (!root) { exit(1); }
   
     root->ref();
   
     SoOutput out;
     MyWriteAction mwa(&out);
     mwa.apply(root);
   
     root->unref();
   
     return 0;
   }
 


 

Public Types


enum AppliedCode { NODE = 0, PATH = 1, PATH_LIST = 2 }

enum PathCode { NO_PATH = 0, IN_PATH = 1, BELOW_PATH = 2, OFF_PATH = 3 }

Public Member Functions


virtual ~SoAction ()

virtual SoType getTypeId (void) const =0

virtual SbBool isOfType (SoType type) const

virtual void apply (SoNode *root)

virtual void apply (SoPath *path)

virtual void apply (const SoPathList &pathlist, SbBool obeysrules=0)

void apply (SoAction *beingApplied)

virtual void invalidateState (void)

AppliedCode getWhatAppliedTo (void) const

SoNode * getNodeAppliedTo (void) const

SoPath * getPathAppliedTo (void) const

const SoPathList * getPathListAppliedTo (void) const

const SoPathList * getOriginalPathListAppliedTo (void) const

SbBool isLastPathListAppliedTo (void) const

PathCode getPathCode (int &numindices, const int *&indices)

void traverse (SoNode *const node)

SbBool hasTerminated (void) const

const SoPath * getCurPath (void)

SoState * getState (void) const

PathCode getCurPathCode (void) const

virtual SoNode * getCurPathTail (void)

void usePathCode (int &numindices, const int *&indices)

void pushCurPath (const int childindex, SoNode *node=NULL)

void popCurPath (const PathCode prevpathcode)

void pushCurPath (void)

void popPushCurPath (const int childindex, SoNode *node=NULL)

void popCurPath (void)

void switchToPathTraversal (SoPath *path)

void switchToNodeTraversal (SoNode *node)

Static Public Member Functions


static void initClass (void)

static void initClasses (void)

static SoType getClassTypeId (void)

static void nullAction (SoAction *action, SoNode *node)

Protected Member Functions


SoAction (void)

virtual void beginTraversal (SoNode *node)

virtual void endTraversal (SoNode *node)

void setTerminated (const SbBool flag)

virtual const SoEnabledElementsList & getEnabledElements (void) const

virtual SbBool shouldCompactPathList (void) const

Static Protected Member Functions


static SoEnabledElementsList * getClassEnabledElements (void)

static SoActionMethodList * getClassActionMethods (void)

Protected Attributes


SoState * state

SoActionMethodList * traversalMethods

Member Enumeration Documentation

enum SoAction::AppliedCode

Enumerated values for what the action was applied to.

enum SoAction::PathCode

Enumerated values for how the action is applied to a scene graph.

Constructor & Destructor Documentation

SoAction::~SoAction (void) [virtual]

Destructor, free resources.

SoAction::SoAction (void) [protected]

Default constructor, does all necessary toplevel initialization.

Member Function Documentation

void SoAction::initClass (void) [static]

Initializes the run-time type system for this class, and sets up the enabled elements and action method list.

Reimplemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

References SoType::badType(), SoType::createType(), SoEnabledElementsList::enable(), SoOverrideElement::getClassStackIndex(), SoOverrideElement::getClassTypeId(), and initClasses().

Referenced by SoDB::init().

void SoAction::initClasses (void) [static]

Initialize all the SoAction subclasses. Automatically called from SoAction::initClass().

References SoReorganizeAction::initClass(), SoSimplifyAction::initClass(), SoToVRML2Action::initClass(), SoToVRMLAction::initClass(), SoIntersectionDetectionAction::initClass(), SoAudioRenderAction::initClass(), SoWriteAction::initClass(), SoSearchAction::initClass(), SoRayPickAction::initClass(), SoPickAction::initClass(), SoHandleEventAction::initClass(), SoGetPrimitiveCountAction::initClass(), SoGetMatrixAction::initClass(), SoGetBoundingBoxAction::initClass(), SoLineHighlightRenderAction::initClass(), SoBoxHighlightRenderAction::initClass(), SoGLRenderAction::initClass(), and SoCallbackAction::initClass().

Referenced by initClass().

SoType SoAction::getClassTypeId (void) [static]

Returns the run-time type object associated with instances of this class.

Reimplemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

SoType SoAction::getTypeId (void) const [pure virtual]

Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and 'downward' casting.

Usage example:

   void bar(SoAction * action)
   {
     if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
       // safe downward cast, know the type
       SoGLRenderAction * glrender = (SoGLRenderAction *)action;
     }
     return; // ignore if not renderaction
   }
 

For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR.

For more information on writing Coin extensions, see the SoAction class documentation.

Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.

Implemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

Referenced by apply(), SoNode::audioRenderS(), SoNode::getMatrixS(), SoNode::handleEventS(), SoShape::invokeTriangleCallbacks(), isOfType(), SoNode::pickS(), SoNode::rayPickS(), SoNode::searchS(), and SoNode::writeS().

SbBool SoAction::isOfType (SoType type) const [virtual]

Returns TRUE if the type of this object is either of the same type or a subclass of type.

References getTypeId(), and SoType::isDerivedFrom().

Referenced by SoShape::getBoundingBoxCache().

void SoAction::apply (SoNode * root) [virtual]

Applies the action to the scene graph rooted at root.

Note that you should not apply an action to a node with a zero reference count. The behavior in that case is undefined.

Reimplemented in SoBoxHighlightRenderAction, SoLineHighlightRenderAction, SoToVRMLAction, SoToVRML2Action, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, and SoVectorizeAction.

References beginTraversal(), endTraversal(), getEnabledElements(), SoBase::getRefCount(), getState(), getTypeId(), SoDebugError::postWarning(), SoDB::readlock(), SoDB::readunlock(), SoBase::ref(), SoActionMethodList::setUp(), state, traversalMethods, and SoBase::unrefNoDelete().

Referenced by SoNodeKitPath::append(), SoVectorizeAction::apply(), SoSimplifyAction::apply(), SoLineHighlightRenderAction::apply(), SoIntersectionDetectionAction::apply(), SoBoxHighlightRenderAction::apply(), apply(), SoVRMLTransform::combineLeft(), SoTransform::combineLeft(), SoWriteAction::continueToApply(), SoSceneManager::render(), SoDebug::write(), and SoDebug::writeToFile().

void SoAction::apply (SoPath * path) [virtual]

Applies the action to the parts of the graph defined by path.

Note that an SoPath will also contain all nodes that may influence e.g. geometry nodes in the path. So for instance applying an SoGLRenderAction on an SoPath will render that path as expected in the view, where geometry will get its materials, textures, and other appearance settings correctly.

If the path ends in an SoGroup node, the action will also traverse the tail node's children.

Reimplemented in SoBoxHighlightRenderAction, SoLineHighlightRenderAction, SoToVRMLAction, SoToVRML2Action, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, and SoVectorizeAction.

References beginTraversal(), endTraversal(), getEnabledElements(), SoPath::getFullLength(), SoPath::getLength(), SoPath::getNode(), SoBase::getRefCount(), getState(), SoDebugError::postWarning(), SoDB::readlock(), SoDB::readunlock(), SoBase::ref(), SoActionMethodList::setUp(), state, traversalMethods, and SoBase::unrefNoDelete().

void SoAction::apply (const SoPathList & pathlist, SbBool obeysrules = 0) [virtual]

Applies action to the graphs defined by pathlist. If obeysrules is set to TRUE, pathlist must obey the following four conditions (which is the case for path lists returned from search actions for non-group nodes and path lists returned from picking actions):

All paths must start at the same head node. All paths must be sorted in traversal order. The paths must be unique. No path can continue through the end point of another path.

See also:

SoAction::apply(SoPath * path)

Reimplemented in SoBoxHighlightRenderAction, SoLineHighlightRenderAction, SoToVRMLAction, SoToVRML2Action, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, and SoVectorizeAction.

References SoPathList::append(), beginTraversal(), endTraversal(), getEnabledElements(), SbPList::getLength(), getState(), hasTerminated(), SoDB::readlock(), SoDB::readunlock(), SoActionMethodList::setUp(), shouldCompactPathList(), SoPathList::sort(), state, traversalMethods, SoBaseList::truncate(), and SoPathList::uniquify().

void SoAction::apply (SoAction * beingApplied)

Applies this action object to the same as beingApplied is being applied to.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since:

Coin 2.1

References apply(), getNodeAppliedTo(), getOriginalPathListAppliedTo(), getPathAppliedTo(), and getWhatAppliedTo().

void SoAction::invalidateState (void) [virtual]

Invalidates the state, forcing it to be recreated at the next apply() invocation.

Reimplemented in SoGLRenderAction.

References state.

Referenced by SoGLRenderAction::invalidateState(), and SoSceneManager::setAudioRenderAction().

void SoAction::nullAction (SoAction * action, SoNode * node) [static]

This method is used for filling up the lookup tables with void methods.

Referenced by SoActionMethodList::setUp().

SoAction::AppliedCode SoAction::getWhatAppliedTo (void) const

Returns a code indicating what (node, path, or pathlist) the action instance is being applied to.

Referenced by apply(), SoCallbackAction::invokePostCallbacks(), SoCallbackAction::invokePreCallbacks(), pushCurPath(), and usePathCode().

SoNode * SoAction::getNodeAppliedTo (void) const

Returns a pointer to the node the action is being applied to.

If action is not being applied to a node (but a path or a pathlist), the method returns NULL.

Referenced by apply().

SoPath * SoAction::getPathAppliedTo (void) const

Returns the pointer to the path the action is being applied to. The path is managed by the action instance and should not be destroyed or modified by the caller.

If action is not being applied to a path (but a node or a pathlist), the method returns NULL.

Referenced by apply(), SoCallbackAction::invokePostCallbacks(), and SoCallbackAction::invokePreCallbacks().

const SoPathList * SoAction::getPathListAppliedTo (void) const

Returns the pointer to the path list the action is currently being applied to. The path list is managed by the action instance and should not be destroyed or modified by the caller.

If action is not being applied to a path list (but a node or a path), the method returns NULL.

The returned pathlist pointer need not be equal to the list apply() was called with, as the action may have reorganized the path list for efficiency reasons.

See also:

void SoAction::apply(const SoPathList &, SbBool)

const SoPathList * SoAction::getOriginalPathListAppliedTo (void) const

Returns a pointer to the original path list the action is being applied to.

If the action is not being applied to a path list (but a node or a path), the method returns NULL.

Referenced by apply().

SbBool SoAction::isLastPathListAppliedTo (void) const

This method is not supported in Coin. It should probably have been private in OIV.

SoAction::PathCode SoAction::getPathCode (int & numindices, const int *& indices)

Returns a code that indicates where the current node lies with respect to the path(s) the action is being applied to. The arguments indices and numindices are only set if the method returns IN_PATH.

References usePathCode().

Referenced by SoNodeKitListPart::affectsState(), SoSeparator::audioRender(), SoVRMLGroup::audioRender(), SoVRMLAppearance::callback(), SoWWWInline::getChildren(), SoFile::getChildren(), SoVRMLInline::getReadAsSoFile(), SoBaseKit::GLRender(), SoLOD::initClass(), SoTransformSeparator::pick(), SoVRMLLOD::replaceLevel(), and SoVRMLAppearance::~SoVRMLAppearance().

void SoAction::traverse (SoNode *const node)

Traverses a scene graph rooted at node, invoking the action methods of the nodes in the graph.

References SoNode::getActionMethodIndex(), SoBase::getTypeId(), and traversalMethods.

Referenced by SoWriteAction::beginTraversal(), SoSearchAction::beginTraversal(), SoHandleEventAction::beginTraversal(), SoGetPrimitiveCountAction::beginTraversal(), SoGetMatrixAction::beginTraversal(), SoCallbackAction::beginTraversal(), SoAudioRenderAction::beginTraversal(), beginTraversal(), switchToNodeTraversal(), switchToPathTraversal(), SoChildList::traverse(), and SoChildList::traverseInPath().

SbBool SoAction::hasTerminated (void) const

Returns TRUE if the action was prematurely terminated.

Note that the termination flag will be FALSE if the action simply completed its run over the scene graph in the 'ordinary' fashion, i.e. was not explicitly aborted from any of the nodes in the graph.

See also:

setTerminated()

Referenced by SoGLRenderAction::abortNow(), apply(), SoNode::callbackS(), SoVRMLCollision::GLRender(), SoVRMLAppearance::GLRender(), SoSeparator::GLRenderInPath(), SoLOD::GLRenderInPath(), SoVRMLLOD::GLRenderInPath(), SoVRMLGroup::GLRenderInPath(), SoVRMLBillboard::GLRenderInPath(), SoSearchAction::isFound(), SoHandleEventAction::isHandled(), SoChildList::traverse(), and SoChildList::traverseInPath().

const SoPath * SoAction::getCurPath (void)

Returns a pointer to the path generated during traversal, from the root of the traversed graph to the current node.

Referenced by SoGLRenderAction::abortNow(), SoRayPickAction::addIntersection(), SoPathSwitch::audioRender(), SoGetBoundingBoxAction::checkResetAfter(), SoGetBoundingBoxAction::checkResetBefore(), SoPathSwitch::doAction(), SoPathSwitch::getBoundingBox(), SoPathSwitch::GLRender(), SoVRMLTouchSensor::handleEvent(), SoPathSwitch::handleEvent(), SoLocateHighlight::handleEvent(), SoGLRenderAction::handleTransparency(), SoPathSwitch::initClass(), SoPathSwitch::pick(), and SoNode::search().

SoState * SoAction::getState (void) const

Returns a pointer to the state of the action instance. The state contains the current set of elements used during traversal.

References SoEnabledElementsList::getCounter(), getEnabledElements(), and state.

Referenced by SoGLRenderAction::addDelayedPath(), SoMultipleCopy::affectsState(), SoVRMLShape::affectsState(), apply(), SoVRMLTransform::audioRender(), SoSeparator::audioRender(), SoVRMLGroup::audioRender(), SoRayPickAction::beginTraversal(), SoPickAction::beginTraversal(), SoHandleEventAction::beginTraversal(), SoGetBoundingBoxAction::beginTraversal(), SoCallbackAction::beginTraversal(), SoVRMLTextureCoordinate::callback(), SoUnits::callback(), SoTransformSeparator::callback(), SoLevelOfDetail::callback(), SoVRMLShape::callback(), SoVRMLAppearance::callback(), SoGetBoundingBoxAction::checkResetAfter(), SoGetBoundingBoxAction::checkResetBefore(), SoTransparencyType::doAction(), SoTransformSeparator::doAction(), SoTextureCoordinateSphere::doAction(), SoTextureCoordinateEnvironment::doAction(), SoTextureCoordinateDefault::doAction(), SoTextureCoordinateCylinder::doAction(), SoTextureCoordinateCube::doAction(), SoSeparator::doAction(), SoPickStyle::doAction(), SoMaterialBinding::doAction(), SoLightModel::doAction(), SoFontStyle::doAction(), SoCoordinate4::doAction(), SoCoordinate3::doAction(), SoBumpMapCoordinate::doAction(), SoVRMLNormal::doAction(), SoVRMLCoordinate::doAction(), SoGetBoundingBoxAction::extendBy(), SoShape::finishVertexArray(), SoVRMLIndexedFaceSet::generateDefaultNormals(), SoTriangleStripSet::generatePrimitives(), SoQuadMesh::generatePrimitives(), SoLineSet::generatePrimitives(), SoFaceSet::generatePrimitives(), SoProfileCoordinate2::getBoundingBox(), SoProfile::getBoundingBox(), SoLineSet::getBoundingBox(), SoCoordinate4::getBoundingBox(), SoComplexity::getBoundingBox(), SoVRMLIndexedLineSet::getBoundingBox(), SoShape::getBoundingBoxCache(), SoMultipleCopy::getMatrix(), SoGeoSeparator::getMatrix(), SoDragger::getMatrix(), SoArray::getMatrix(), SoVRMLGroup::getNumRenderCaches(), SoTriangleStripSet::getPrimitiveCount(), SoTransformSeparator::getPrimitiveCount(), SoLineSet::getPrimitiveCount(), SoImage::getPrimitiveCount(), SoFaceSet::getPrimitiveCount(), SoCallbackAction::getViewportRegion(), SoRayPickAction::getViewVolume(), SoVRMLVisibilitySensor::GLRender(), SoVertexProperty::GLRender(), SoUnits::GLRender(), SoTriangleStripSet::GLRender(), SoTransparencyType::GLRender(), SoTransformSeparator::GLRender(), SoTextureScalePolicy::GLRender(), SoTextureCoordinateBinding::GLRender(), SoTextureCoordinate2::GLRender(), SoTabPlaneDragger::GLRender(), SoQuadMesh::GLRender(), SoNormalBinding::GLRender(), SoMaterialBinding::GLRender(), SoMaterial::GLRender(), SoLineSet::GLRender(), SoLightModel::GLRender(), SoGeoLocation::GLRender(), SoFaceSet::GLRender(), SoBumpMapTransform::GLRender(), SoBaseColor::GLRender(), SoVRMLInline::GLRender(), SoSeparator::GLRenderInPath(), SoVRMLGroup::GLRenderInPath(), SoVRMLBillboard::GLRenderInPath(), SoNode::GLRenderS(), SoGLRenderAction::handleTransparency(), SoTranslation::initClass(), SoTextureCoordinateDefault::initClass(), SoText3::initClass(), SoText2::initClass(), SoSpotLight::initClass(), SoSphere::initClass(), SoShadowStyle::initClass(), SoShadowCulling::initClass(), SoScale::initClass(), SoRotationXYZ::initClass(), SoRotation::initClass(), SoResetTransform::initClass(), SoPointLight::initClass(), SoNurbsCurve::initClass(), SoGeoSeparator::initClass(), SoGeoLocation::initClass(), SoGeoCoordinate::initClass(), SoDirectionalLight::initClass(), SoCube::initClass(), SoColorIndex::initClass(), SoArray::initClass(), SoSurroundScale::invalidate(), SoShape::invokeTriangleCallbacks(), SoComplexity::pick(), SoVRMLPixelTexture::rayPick(), SoVRMLImageTexture::rayPick(), SoTabPlaneDragger::reallyAdjustScaleTabSize(), SoLocateHighlight::redrawHighlighted(), SoVRMLSwitch::replaceChoice(), SoVRMLBillboard::search(), SoVRMLAnchor::setFetchURLCallBack(), SoShape::startVertexArray(), SoDragger::write(), SoGeometryShader::~SoGeometryShader(), SoListener::~SoListener(), SoVRMLBillboard::~SoVRMLBillboard(), SoVRMLBox::~SoVRMLBox(), SoVRMLCollision::~SoVRMLCollision(), SoVRMLColor::~SoVRMLColor(), SoVRMLCone::~SoVRMLCone(), SoVRMLCoordinate::~SoVRMLCoordinate(), SoVRMLCylinder::~SoVRMLCylinder(), SoVRMLDirectionalLight::~SoVRMLDirectionalLight(), SoVRMLExtrusion::~SoVRMLExtrusion(), SoVRMLMaterial::~SoVRMLMaterial(), SoVRMLNormal::~SoVRMLNormal(), SoVRMLPointLight::~SoVRMLPointLight(), SoVRMLPointSet::~SoVRMLPointSet(), SoVRMLSphere::~SoVRMLSphere(), SoVRMLSpotLight::~SoVRMLSpotLight(), SoVRMLTextureCoordinate::~SoVRMLTextureCoordinate(), and SoVRMLTextureTransform::~SoVRMLTextureTransform().

SoAction::PathCode SoAction::getCurPathCode (void) const [inline]

Returns the current traversal path code.

Referenced by SoLOD::audioRender(), SoVRMLLOD::callback(), SoVRMLBillboard::callback(), SoGroup::GLRender(), SoVRMLCollision::GLRender(), SoVRMLAppearance::GLRender(), SoNode::GLRenderS(), SoSwitch::handleEvent(), SoAnnotation::initClass(), SoChildList::traverse(), and SoChildList::traverseInPath().

SoNode * SoAction::getCurPathTail (void) [virtual]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Reimplemented in SoCallbackAction.

void SoAction::usePathCode (int & numindices, const int *& indices)

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

References SbList< Type >::append(), SoPath::containsPath(), SbList< Type >::getArrayPtr(), SoPath::getFullLength(), SoPath::getIndex(), SbList< Type >::getLength(), SbPList::getLength(), getWhatAppliedTo(), and SbList< Type >::truncate().

Referenced by getPathCode().

void SoAction::pushCurPath (const int childindex, SoNode * node = NULL)

Get ready to traverse the childindex'th child. Use this method if the path code might change as a result of this.

This method is very internal. Do not use unless you know what you're doing.

References SoPath::containsPath(), SoPath::getFullLength(), SbPList::getLength(), SoBase::getName(), SbName::getString(), and getWhatAppliedTo().

Referenced by SoVRMLLOD::audioRender(), SoGroup::GLRender(), SoVRMLCollision::GLRender(), SoVRMLAppearance::GLRender(), SoSeparator::GLRenderInPath(), SoLOD::GLRenderInPath(), SoVRMLLOD::GLRenderInPath(), SoVRMLGroup::GLRenderInPath(), SoVRMLBillboard::GLRenderInPath(), SoChildList::traverse(), and SoChildList::traverseInPath().

void SoAction::popCurPath (const PathCode prevpathcode) [inline]

Pops the current path, and sets the path code to prevpathcode.

This method is very internal. Do not use unless you know what you're doing.

Referenced by SoGroup::GLRender(), SoVRMLCollision::GLRender(), SoVRMLAppearance::GLRender(), SoSeparator::GLRenderInPath(), SoLOD::GLRenderInPath(), SoVRMLLOD::GLRenderInPath(), SoVRMLGroup::GLRenderInPath(), SoVRMLBillboard::GLRenderInPath(), SoChildList::traverse(), and SoChildList::traverseInPath().

void SoAction::pushCurPath (void)

Pushes a NULL node onto the current path. Use this before traversing all children when you know that the path code will not change while traversing children.

This method is very internal. Do not use unless you know what you're doing.

void SoAction::popPushCurPath (const int childindex, SoNode * node = NULL)

Get ready to traverse the childindex'th child. Use this method if you know the path code will not change as a result of this.

This method is very internal. Do not use unless you know what you're doing.

Referenced by SoChildList::traverse().

void SoAction::popCurPath (void)

Pops of the last child in the current path. Use this if you know the path code hasn't changed since the current path was pushed.

This method is very internal. Do not use unless you know what you're doing.

void SoAction::switchToPathTraversal (SoPath * path)

Store our state, traverse the given path, restore our state and continue traversal.

References SoPath::getNode(), and traverse().

void SoAction::switchToNodeTraversal (SoNode * node)

Store our state, traverse the subgraph rooted at the given node, restore our state and continue traversal.

References traverse().

void SoAction::beginTraversal (SoNode * node) [protected, virtual]

This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal.

It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.

Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal.

Reimplemented in SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, and SoSimplifyAction.

References traverse().

Referenced by apply(), SoSimplifyAction::beginTraversal(), SoPickAction::beginTraversal(), SoGLRenderAction::beginTraversal(), and SoGetBoundingBoxAction::beginTraversal().

void SoAction::endTraversal (SoNode * node) [protected, virtual]

This virtual method can be overridden to execute code after the scene graph traversal. Default method does nothing.

Reimplemented in SoGLRenderAction.

Referenced by apply(), and SoGLRenderAction::endTraversal().

void SoAction::setTerminated (const SbBool flag) [protected]

Set the termination flag.

Typically set to TRUE from nodes upon special conditions being met during scene graph traversal -- like the correct node being found when doing SoSearchAction traversal or when grabbing the event from an SoHandleEventAction.

See also:

hasTerminated()

Referenced by SoGLRenderAction::abortNow(), SoCallbackAction::invokePostCallbacks(), SoCallbackAction::invokePreCallbacks(), SoSearchAction::setFound(), and SoHandleEventAction::setHandled().

const SoEnabledElementsList & SoAction::getEnabledElements (void) const [protected, virtual]

Returns a list of the elements used by action instances of this class upon traversal operations.

Reimplemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

Referenced by apply(), and getState().

SbBool SoAction::shouldCompactPathList (void) const [protected, virtual]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Referenced by apply().

SoEnabledElementsList * SoAction::getClassEnabledElements (void) [static, protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

This method not available in the original OIV API, see SoSubAction.h for explanation.

Reimplemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

SoActionMethodList * SoAction::getClassActionMethods (void) [static, protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

This method not available in the original OIV API, see SoSubAction.h for explanation.

Reimplemented in SoBoxHighlightRenderAction, SoCallbackAction, SoGLRenderAction, SoAudioRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoGetPrimitiveCountAction, SoHandleEventAction, SoLineHighlightRenderAction, SoPickAction, SoRayPickAction, SoSearchAction, SoToVRMLAction, SoToVRML2Action, SoWriteAction, SoReorganizeAction, SoSimplifyAction, SoIntersectionDetectionAction, SoVectorizeAction, and SoVectorizePSAction.

Member Data Documentation

SoAction::state [protected]

Pointer to the traversal state instance of the action.

Referenced by SoRayPickAction::addIntersection(), apply(), SoRayPickAction::beginTraversal(), SoGetMatrixAction::beginTraversal(), SoRayPickAction::computeWorldSpaceRay(), SoGetBoundingBoxAction::extendBy(), SoCallbackAction::getComplexity(), SoCallbackAction::getComplexityType(), SoCallbackAction::getCoordinate3(), SoCallbackAction::getCoordinate4(), SoCallbackAction::getCreaseAngle(), SoCallbackAction::getDecimationPercentage(), SoCallbackAction::getDecimationType(), SoCallbackAction::getDrawStyle(), SoCallbackAction::getFaceType(), SoCallbackAction::getFocalDistance(), SoCallbackAction::getFontName(), SoCallbackAction::getFontSize(), SoCallbackAction::getLightAttenuation(), SoCallbackAction::getLightModel(), SoCallbackAction::getLinePattern(), SoCallbackAction::getLineWidth(), SoCallbackAction::getMaterial(), SoCallbackAction::getMaterialBinding(), SoCallbackAction::getModelMatrix(), SoCallbackAction::getNormal(), SoCallbackAction::getNormalBinding(), SoCallbackAction::getNumCoordinates(), SoCallbackAction::getNumNormals(), SoCallbackAction::getNumProfileCoordinates(), SoCallbackAction::getNumTextureCoordinates(), SoCallbackAction::getPickStyle(), SoCallbackAction::getPointSize(), SoCallbackAction::getProfile(), SoCallbackAction::getProfileCoordinate2(), SoCallbackAction::getProfileCoordinate3(), SoCallbackAction::getProjectionMatrix(), SoCallbackAction::getShapeType(), getState(), SoCallbackAction::getSwitch(), SoCallbackAction::getTextureBlendColor(), SoCallbackAction::getTextureCoordinate2(), SoCallbackAction::getTextureCoordinate3(), SoCallbackAction::getTextureCoordinate4(), SoCallbackAction::getTextureCoordinateBinding(), SoCallbackAction::getTextureImage(), SoCallbackAction::getTextureMatrix(), SoCallbackAction::getTextureModel(), SoCallbackAction::getTextureWrapR(), SoCallbackAction::getTextureWrapS(), SoCallbackAction::getTextureWrapT(), SoCallbackAction::getUnits(), SoCallbackAction::getVertexOrdering(), SoCallbackAction::getViewingMatrix(), SoCallbackAction::getViewVolume(), invalidateState(), SoRayPickAction::isBetweenPlanes(), SoGetBoundingBoxAction::setCenter(), and SoRayPickAction::setObjectSpace().

SoAction::traversalMethods [protected]

Stores the list of 'nodetype to actionmethod' mappings for the particular action instance.

Referenced by apply(), SoGetMatrixAction::beginTraversal(), and traverse().

Author

Generated automatically by Doxygen for Coin from the source code.