Path that points to a list of hierarchical nodekits. More...
#include <Inventor/SoNodeKitPath.h>
Public Member Functions | |
int | getLength () const |
Returns length of path chain (number of nodekits). | |
SoNode * | getTail () const |
Return the last nodekit in a path chain. | |
SoNode * | getNode (int i) const |
Returns the i'th node in the nodekit path. | |
SoNode * | getNodeFromTail (int i) const |
Returns the i'th nodekit in the chain, counting backward from the tail nodekit. | |
void | truncate (int start) |
Truncates the path chain, removing all nodes from index start on. | |
void | pop () |
Pops the last nodekit off the end of the path. | |
void | append (SoBaseKit *childKit) |
Adds childKit to end of chain; uses first occurrence of childKit as a part within current last nodekit. | |
void | append (const SoNodeKitPath *fromPath) |
Adds all nodekits in fromPath's chain to end of chain; the head node of fromPath must be the same as or a child of the current tail node. | |
SbBool | containsNode (SoBaseKit *node) const |
Returns TRUE if the passed nodekit is found anywhere in the path chain. | |
int | findFork (const SoNodeKitPath *path) const |
If the two paths have different head nodes, this returns -1. | |
Public Member Functions inherited from SoPath | |
SoPath () | |
Constructs an empty path. | |
SoPath (int approxLength) | |
Constructs a path with a hint to length (number of nodes in chain). | |
SoPath (SoNode *node) | |
Constructs a path and sets the head node to the given node. | |
void | setHead (SoNode *node) |
Sets head node (first node in chain). | |
void | append (int childIndex) |
Adds node to end of chain; the node is the childIndex'th child of the current tail node. | |
void | append (SoNode *childNode) |
Adds node to end of chain; uses the first occurrence of childNode as child of current tail node. | |
void | append (const SoPath *fromPath) |
Adds all nodes in fromPath's chain to end of chain; the head node of fromPath must be the same as or a child of the current tail node. | |
void | push (int childIndex) |
The push() and pop() methods allow a path to be treated as a stack; they push a node at the end of the chain and pop the last node off. | |
void | pop () |
The push() and pop() methods allow a path to be treated as a stack; they push a node at the end of the chain and pop the last node off. | |
SoNode * | getHead () const |
Returns the first node in a path chain. | |
SoNode * | getTail () const |
Returns the last node in a path chain. | |
SoNode * | getNode (int i) const |
Returns the i'th node (within its parent) in the chain. | |
SoNode * | getNode (const SoType type, int &i) const |
Returns the first node and its index, from the head of the given type in the chain. | |
SoNode * | getNodeFromTail (int i) const |
Returns the i'th node (within its parent) in the chain, counting backward from the tail node. | |
int | getIndex (int i) const |
Returns the index of the i'th node (within its parent) in the chain. | |
int | getInstanceIndex (int i) const |
Returns the index of the instance inside the parent SoMultipleInstance, SoMultipleCopy or SoArray group. | |
int | getIndexFromTail (int i) const |
Returns the index of the i'th node (within its parent) in the chain, counting backward from the tail node. | |
int | getInstanceIndexFromTail (int i) const |
Returns the index of the i'th node instance (within its parent, if it is a SoMultipleInstance, SoMultipleCopy or SoArray group in the chain, counting backward from the tail node. | |
int | getLength () const |
Returns length of path chain (number of nodes). | |
void | truncate (int start) |
Truncates the path chain, removing all nodes from index start on. | |
SbBool | containsNode (const SoNode *node) const |
Returns TRUE if the node is found anywhere in the path chain. | |
SbBool | containsNode (const SoType type) const |
Returns TRUE if the node type is found anywhere in the path chain. | |
SbBool | containsPath (const SoPath *path) const |
Returns TRUE if the nodes in the chain in the passed path are contained (in consecutive order) in this path chain. | |
int | findFork (const SoPath *path) const |
If the two paths have different head nodes, this returns -1. | |
SoPath * | copy (int startFromNodeIndex=0, int numNodes=0) const |
Creates and returns a new path that is a copy of some or all of this path. | |
virtual SoType | getTypeId () const |
Returns type identifier for path instance. | |
Public Member Functions inherited from SoBase | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Friends | |
int | operator== (const SoNodeKitPath &p1, const SoNodeKitPath &p2) |
Returns TRUE if all nodes in the two nodekit path chains are equal. | |
Additional Inherited Members | |
Static Public Member Functions inherited from SoPath | |
static SoType | getClassTypeId () |
Returns type identifier for SoPath class. | |
static SoPath * | getByName (const SbName &name) |
Method to return a path with a given name. | |
static int | getByName (const SbName &name, SoPathList &list) |
Method to return paths with a given name. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Path that points to a list of hierarchical nodekits.
SoNodeKitPath is a subclass of SoPath that lets you look at nodekits below the top nodekit in the path. Since nodekits have hidden children, when you call getTail() on a regular path, it returns the top-most nodekit on the path. This occurs even though the path might contain extra internal information leading to a node far deeper in the scene graph. For example, when picking an object inside an SoSceneKit, the regular path would end at the scenekit. But a nodekit path would continue further down listing the other nodekits below it in the path.
Intermediary (private) nodes between nodekits are not included in the nodekit path.
Note that there is no constructor for an SoNodeKitPath, so you can not create one. Rather, you cast an (SoPath *) into an (SoNodeKitPath *), which returns nodekit-style values from all the same questions as SoPath.
Also, some methods of SoPath may not be called on an SoNodeKitPath. Any methods which take a regular SoNode as an argument (except for setHead()) are not accessible, and replaced by methods that take an SoBaseKit as an argument instead. Methods which allow the programmer to refer to the child index of a node beneath its parent are also inaccessible; since an SoNodeKitPath only shows nodekits and hides any private parts, successive nodekits in the path may not actually be parent and child.
SoBaseKit, SoPath, SoRayPickAction, SoSearchAction
Definition at line 112 of file SoNodeKitPath.h.
void SoNodeKitPath::append | ( | const SoNodeKitPath * | fromPath | ) |
Adds all nodekits in fromPath's chain to end of chain; the head node of fromPath must be the same as or a child of the current tail node.
void SoNodeKitPath::append | ( | SoBaseKit * | childKit | ) |
Adds childKit to end of chain; uses first occurrence of childKit as a part within current last nodekit.
If the path is empty, this is equivalent to setHead(childKit) .
Returns TRUE if the passed nodekit is found anywhere in the path chain.
int SoNodeKitPath::findFork | ( | const SoNodeKitPath * | path | ) | const |
If the two paths have different head nodes, this returns -1.
Otherwise, it returns the path chain index of the last nodekit (starting at the head) that is the same for both paths.
int SoNodeKitPath::getLength | ( | ) | const |
Returns length of path chain (number of nodekits).
SoNode * SoNodeKitPath::getNode | ( | int | i | ) | const |
Returns the i'th node in the nodekit path.
SoNode * SoNodeKitPath::getNodeFromTail | ( | int | i | ) | const |
Returns the i'th nodekit in the chain, counting backward from the tail nodekit.
Passing 0 for i returns the tail nodekit.
SoNode * SoNodeKitPath::getTail | ( | ) | const |
Return the last nodekit in a path chain.
Note that getHead() is not redefined from SoPath, since an SoNodeKitPath need not begin with a nodekit; the restriction is placed only on successive nodes on the path.
void SoNodeKitPath::pop | ( | ) |
Pops the last nodekit off the end of the path.
void SoNodeKitPath::truncate | ( | int | start | ) |
Truncates the path chain, removing all nodes from index start on.
Calling truncate(0) empties the path entirely.
|
friend |
Returns TRUE if all nodes in the two nodekit path chains are equal.