188 {
return classTypeId; }
222 bool obeysRules =
FALSE);
263 {
return appliedTo.pathList; }
265 {
return appliedTo.origPathList; }
267 {
return appliedTo.isLastPathList; }
276 {
if (appliedTo.curPathCode == IN_PATH) {
277 usePathCode(numIndices, indices);
279 return appliedTo.curPathCode;
324 { curPath.append(-1); }
326 { curPath.setTail(childIndex);}
379 static SoType classTypeId;
410 int enabledElementsCounter;
426 void splitPathList(
const SoPathList &sortedList,
432 bool isLastPathList);
445#define SO_ENABLE(actionClass, elementClass) \
446 actionClass::enableElement(elementClass::getClassTypeId(), \
447 elementClass::getClassStackIndex())
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
void(* SoActionMethod)(SoAction *, SoNode *)
List of generic (void *) pointers.
void *& operator[](int i) const
Returns pointer with given index.
void setUp()
This MUST be called before using the list.
void addMethod(SoType nodeType, SoActionMethod method)
Add a method to the appropriate place in the list.
SoActionMethodList(SoActionMethodList *parentList)
Constructor. Pass in list from parent action.
Abstract base class for all actions.
bool hasTerminated() const
Returns TRUE if the traversal has reached a termination condition.
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)
@ BELOW_PATH
Tail node of path or below tail node.
bool isLastPathListAppliedTo() const
void setTerminated(bool flag)
Allows subclass instance to indicate that traversal has reached a termination condition.
AppliedCode getWhatAppliedTo() const
Returns code indicating what action is being applied to.
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.
bool isOfType(SoType type) const
Returns TRUE if this instance is of the type specified in type or is derived from that type.
const SoPath * getCurPath()
Returns a pointer to the path accumulated during traversal, i.e., the chain of nodes from the root of...
SoNode * getNodeAppliedTo() const
These returns a pointer to the node, path, or path list the action is being applied to.
void pushCurPath()
Optimized versions of push/pop when we know path codes won't change:
SoState * getState() const
Get the state from the action.
static SoActionMethodList * methods
... and the methods
virtual void apply(SoNode *node)
virtual void beginTraversal(SoNode *node)
Begins traversal of an action at the given node.
const SoPathList * getOriginalPathListAppliedTo() const
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 ...
SoState * state
Traversal state.
void setCurrentLightweightPath(const SoLightweightPath &path)
Sets the current "light" path.
virtual ~SoAction()
Destructor.
virtual void apply(const SoPathList &pathList, bool obeysRules=FALSE)
Initiates an action on the graph defined either by a node, path, or list of paths.
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...
virtual bool shouldCompactPathLists() const
This method is used when applying an action to an SoPathList.
PathCode getCurPathCode() const
These methods maintain the current path accumulated so far during traversal.
void pushCurPath(int childIndex)
static SoType getClassTypeId()
Returns the type identifier for this class.
virtual SoType getTypeId() const =0
Returns the type identifier for a specific instance.
SoPath * getPathAppliedTo() const
void traverse(SoNode *node)
Does traversal of a graph rooted by a node.
void usePathCode(int &numIndices, const int *&indices)
called by inline getPathCode:
const SoLightweightPath & getCurrentLightweightPath() const
Returns the current "light" path.
virtual SoNode * getCurPathTail()
This is virtual, so that SoCallbackAction can use current node.
static SoEnabledElementsList * enabledElements
Holds list of enabled elements for the SoAction class.
static void nullAction(SoAction *, SoNode *)
Null action method that can be stored in lookup table when desired.
static void initClasses()
Initialize ALL Inventor action classes.
void popPushCurPath(int childIndex)
void popCurPath(PathCode prevPathCode)
virtual void apply(SoPath *path)
const SoPathList * getPathListAppliedTo() const
A single path list may be split into several, one for each different head node.
SoActionMethodList * traversalMethods
The list of what to do when.
This class represents a list of paths (like an SoPathList) in a more compact form.
Scene graph database class.
void merge(const SoEnabledElementsList &list)
Enables all elements from the given list that are not already enabled in this one.
static int getCounter()
Returns the current setting of the global counter used to determine when lists are out of date.
SoEnabledElementsList(SoEnabledElementsList *parentList)
Constructor.
const SoTypeList & getElements() const
Returns list of elements.
void enable(SoType elementType, int stackIndex)
Adds an element to the list if it's not already in it.
A SoLightweightPath is a light-weight version of an SoTempPath, intended to be used just to keep trac...
Abstract base class for all database nodes.
Maintains a list of pointers to paths.
Path that points to a list of hierarchical nodes.
An SoState collects and holds state while traversing a scene graph.
This class is internal to Inventor.
Maintains a list of SoTypes.
SoType has no virtual functions to keep it small...