1 #ifndef COIN_SOACTION_H
2 #define COIN_SOACTION_H
27 #include <Inventor/SbBasic.h>
28 #include <Inventor/SoType.h>
29 #include <Inventor/misc/SoTempPath.h>
30 #include <Inventor/tools/SbPimplPtr.h>
35 #include <Inventor/lists/SoActionMethodList.h>
36 #include <Inventor/lists/SoEnabledElementsList.h>
39 #ifdef COIN_UNDEF_IN_PATH_HACK
40 #include <sys/unistd.h>
46 #endif // COIN_UNDEF_IN_PATH_HACK
53 #define SO_ENABLE(action, element) \
55 assert(!element::getClassTypeId().isBad()); \
56 action::enableElement(element::getClassTypeId(), \
57 element::getClassStackIndex()); \
70 static void initClass(
void);
71 static void initClasses(
void);
74 enum PathCode { NO_PATH = 0, IN_PATH = 1, BELOW_PATH = 2, OFF_PATH = 3 };
78 static SoType getClassTypeId(
void);
79 virtual SoType getTypeId(
void)
const = 0;
80 virtual SbBool isOfType(
SoType type)
const;
82 virtual void apply(
SoNode * root);
83 virtual void apply(
SoPath * path);
84 virtual void apply(
const SoPathList & pathlist, SbBool obeysrules = FALSE);
86 virtual void invalidateState(
void);
90 AppliedCode getWhatAppliedTo(
void)
const;
91 SoNode * getNodeAppliedTo(
void)
const;
92 SoPath * getPathAppliedTo(
void)
const;
93 const SoPathList * getPathListAppliedTo(
void)
const;
94 const SoPathList * getOriginalPathListAppliedTo(
void)
const;
96 SbBool isLastPathListAppliedTo(
void)
const;
98 PathCode getPathCode(
int & numindices,
const int * & indices);
100 void traverse(
SoNode *
const node);
101 SbBool hasTerminated(
void)
const;
103 const SoPath * getCurPath(
void);
104 SoState * getState(
void)
const;
106 PathCode getCurPathCode(
void)
const;
107 virtual SoNode * getCurPathTail(
void);
108 void usePathCode(
int & numindices,
const int * & indices);
110 void pushCurPath(
const int childindex,
SoNode * node = NULL);
111 void popCurPath(
const PathCode prevpathcode);
112 void pushCurPath(
void);
114 void popPushCurPath(
const int childindex,
SoNode * node = NULL);
115 void popCurPath(
void);
118 void switchToPathTraversal(
SoPath * path);
119 void switchToNodeTraversal(
SoNode * node);
124 virtual void beginTraversal(
SoNode * node);
125 virtual void endTraversal(
SoNode * node);
126 void setTerminated(
const SbBool flag);
129 virtual SbBool shouldCompactPathList(
void)
const;
141 static SoType classTypeId;
146 static void atexit_cleanup(
void);
153 SbPimplPtr<SoActionP> pimpl;
165 return this->currentpathcode;
168 #endif // !COIN_SOACTION_H
PathCode getCurPathCode(void) const
Definition: SoAction.h:163
The SoPathList class is a container for pointers to SoPath objects.As this class inherits SoBaseList...
Definition: SoPathList.h:31
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
AppliedCode
Definition: SoAction.h:73
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
The SoTempPath class is used to store temporary paths.The path simply turns off auditing in the const...
Definition: SoTempPath.h:29
SoActionMethodList * traversalMethods
Definition: SoAction.h:132
The SoEnabledElementsList class is a container for type info for element types that are enabled in ac...
Definition: SoEnabledElementsList.h:29
PathCode
Definition: SoAction.h:74
SoState * state
Definition: SoAction.h:131
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50
The SoActionMethodList class contains function pointers for action methods.An SoActionMethodList cont...
Definition: SoActionMethodList.h:35