57#include <Inventor/STL/cassert>
62class SoEnabledElementsList;
63class SoActionMethodList;
65class SoMultiPassManager;
71#pragma warning(disable:4251)
205 { m_continueInBranchFlag =
FALSE; }
213 {
return m_continueInBranchFlag; }
219 { m_continueInBranchFlag =
TRUE; }
243 { m_sceneManager = mgr; }
249 {
return m_sceneManager; }
301 {
return m_distribMode; }
367 {
return appliedTo.pathList; }
378 {
return appliedTo.origPathList; }
388 {
return appliedTo.isLastPathList; }
403 {
if (appliedTo.curPathCode ==
IN_PATH) {
404 usePathCode(numIndices, indices);
406 return appliedTo.curPathCode;
414 if (appliedTo.curPathCode ==
IN_PATH) {
415 usePathCodeMI(numIndices, indices, instanceIndices);
417 return appliedTo.curPathCode;
513 static void initClass();
514 static void exitClass();
517 static void initClasses();
518 static void exitClasses();
521 virtual bool isEnabledElement(
const SoType& )
const;
530 PathCode getCurPathCode()
const {
return appliedTo.curPathCode;}
535 void pushCurPath(
int childIndex,
int &lastFound);
540 void pushCurPathMI(
int childIndex,
int &lastFound,
int instanceIndex);
541 void popCurPath(
PathCode prevPathCode);
543 virtual SoNode * getCurPathTail();
546 bool isForwardTraversing()
const {
return appliedTo.isForwardTraversing; }
549 SoNode* getForwardTraversalCaller()
const {
return appliedTo.forwardTraversalCaller.ptr(); }
552 void usePathCode(
int &numIndices,
const int *&indices);
554 void usePathCodeMI(
int &numIndices,
const int *&indices,
const int *&instanceIndices);
559 { curPath.append(-1); }
560 void popPushCurPath(
int childIndex)
561 { curPath.setTail(childIndex);}
563 void popPushCurPathMI(
int childIndex,
int instanceIndex)
564 { curPath.setTail(childIndex, instanceIndex);}
570 SbBool hasChangedState()
const
571 {
return m_hasStateChanged; }
577 virtual void switchToNodeTraversal(
SoNode* node );
583 void switchToPathTraversal(
SoPath* path )
595 { m_criticalSection->
lock(); }
599 { m_criticalSection->
unlock(); }
609 inline bool isAbortable()
const
610 {
return m_isAbortable; }
615 inline void setAbortable(
bool flag)
616 { m_isAbortable = flag; }
622 bool shouldAbort()
const;
641 bool isAborted()
const;
654 virtual void beginTraversal(
SoNode *node);
658 virtual void endTraversal(
SoNode *) { ; }
662 void setTerminated(
SbBool flag) { terminated = flag; }
672 virtual SbBool shouldCompactPathLists()
const;
679 { m_distribMode = mode; }
684 static SoEnabledElementsList *enabledElements;
687 static SoActionMethodList *methods;
689 SoLightPath* getCurLightPath()
694 virtual SoActionMethodList* getActionMethods();
695 SbBool getUseAlternateRep()
const
696 {
return m_useAlternatRep; }
698 SbBool isForcedUseAlternateRep()
const
699 {
return m_forceUseAlternateRep; }
701 SoMultiPassManager* getMultiPassManager()
const
702 {
return m_multiPassManager; }
704 bool isApplyingDelayed()
const;
706 SoActionImpl* getImpl() {
return m_impl; }
713 static SoType classTypeId;
714 static bool s_defaultAlternateRepUsage;
720 SbBool m_continueInBranchFlag;
742 bool isForwardTraversing;
751 bool m_isBeingApplied;
759 SbBool m_forceUseAlternateRep;
768 int enabledElementsCounter;
782 void splitPathList(
const SoPathList &sortedList,
794 SoMultiPassManager* m_multiPassManager;
798 SoActionImpl* m_impl;
804#ifndef HIDDEN_FROM_DOC
813#define SO_ENABLE(actionClass, elementClass) \
814 if ( elementClass::getClassTypeId().isBad() ) \
815 elementClass::initClass(); \
816 actionClass::enableElement(elementClass::getClassTypeId(), \
817 elementClass::getClassStackIndex())
#define TRUE
Possible value of SbBool.
#define FALSE
Possible value of SbBool.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
int lock()
Locks the current thread on this mutex.
int unlock()
Relinquishes ownership of this mutex.
Abstract base class for all actions.
virtual void setUpState()
Creates state if it is NULL or it is no longer valid because new elements have been enabled since it ...
PathCode
This enum may be used during traversal of nodes to indicate where the node is with respect to the pat...
@ NO_PATH
Not traversing a path.
@ IN_PATH
In middle of path chain (not tail node)
@ OFF_PATH
None of the above (Probably to the left)
@ BELOW_PATH
Tail node of path or below tail node.
AppliedCode getWhatAppliedTo() const
Returns code indicating what action is being applied to.
void setSceneManager(SoSceneManager *mgr)
Set the scene manager associated with this action (if any ).
SbBool getContinueActionInBranchFlag() const
This function indicates if the action must stop in the current branch.
AppliedCode
This enum is used to determine what the action is being applied to.
@ 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.
virtual void clearApplyResult()
When applied, an action may reference nodes or create objects (e.g.
const SoPath * getCurPath()
Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traverse...
virtual bool preDelayedTraversal()
Method called by SoMultiPassManager before delayed pass traversals.
SoNode * getNodeAppliedTo() const
Returns the node the action is being applied to.
SoState * getState() const
Gets the state from the action.
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
SoSceneManager * getSceneManager() const
Return the SoSceneManager associated with this action.
PathCode getPathCodeMI(int &numIndices, const int *&indices, const int *&instanceIndices)
Extender API: available to programmers who wish to extend the toolkit
friend class SoMultiPassElement
const SoPathList * getOriginalPathListAppliedTo() const
Returns the original path list the action is being applied to.
virtual const SoEnabledElementsList & getEnabledElements() const
Returns the list of enabled elements for a given action subclass.
virtual void invalidateState()
Invalidates the current traversal state in the action, forcing it to be recreated when the action is ...
DistribMode getDistribMode() const
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
virtual ~SoAction()
Destructor.
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 res...
void setPipeId(int id)
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Mu...
void useAlternateRep(const SbBool enable)
Tell the action to use alternate representations during traversal when available.
virtual void apply(const SoPathList &pathList, SbBool obeysRules=FALSE)
Initiates an action on the graph defined by a list of paths.
int getPipeId() const
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Mu...
virtual void postDelayedTraversal()
Method called by SoMultiPassManager after delayed pass traversals.
void stopActionInBranch()
This function stops the action in the current Scene Graph branch.
static SoType getClassTypeId()
Returns the type identifier for this class.
DistribMode
This is used to define the way an action is distributed across a cluster.
@ ALL
Both application and cluster apply the action.
@ CLUSTER_ONLY
Action is only applied by OIRU of the cluster.
@ LOCAL_ONLY
Action is only applied by the application.
virtual void forwardTraversal(SoNode *node)
Traverse a node that is not part of the current scenegraph.
SbBool isLastPathListAppliedTo() const
Returns TRUE if the current list is the last one from the original.
SoPath * getPathAppliedTo() const
Returns the path the action is being applied to.
void traverse(SoNode *node)
Does traversal of a graph rooted by a node.
void resetContinueActionInBranchFlag()
This function resets the continue action flag.
static void nullAction(SoAction *, SoNode *)
Null action method that can be stored in lookup table when desired.
bool isBeingApplied()
Returns TRUE if this action is currently being applied.
SbBool isUsingAlternateRep() const
Returns TRUE if current action is using alternate representations.
SbBool hasTerminated() const
Returns TRUE if the traversal has reached a termination condition.
virtual void apply(SoPath *path)
Initiates an action on the graph defined by a path.
virtual void forwardTraversal(SoPath *path)
Traverse a path that is not part of the current scenegraph.
const SoPathList * getPathListAppliedTo() const
Returns the path list the action is being applied to.
Scene graph database class.
Abstract base class for all database nodes.
Path that points to a list of hierarchical nodes.
Maintains a list of pointers to paths.
Smart pointer for any class inheriting SoRefCounter.
Manages scene graph rendering and event handling.
Stores runtime type information.
Base class for object storing runtime type information.