Open Inventor Reference
SoNodeKitPath Class Reference

Path that points to a list of hierarchical nodekits. More...

#include <Inventor/SoNodeKitPath.h>

Inheritance diagram for SoNodeKitPath:
SoPath SoBase

Public Member Functions

int getLength () const
 Returns length of path chain (number of nodekits). More...
 
SoNodegetTail () const
 Return the last nodekit in a path chain. More...
 
SoNodegetNode (int i) const
 Returns a pointer to the i'th node in the nodekit path. More...
 
SoNodegetNodeFromTail (int i) const
 Returns a pointer to the i'th nodekit in the chain, counting backward from the tail nodekit. More...
 
void truncate (int start)
 Truncates the path chain, removing all nodes from index start on. More...
 
void pop ()
 Pops the last nodekit off the end of the path. More...
 
void append (SoBaseKit *childKit)
 Adds childKit to end of chain; uses first occurrence of childKit as a part within current last nodekit. More...
 
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. More...
 
bool containsNode (SoBaseKit *node) const
 Returns TRUE if the passed nodekit is found anywhere in the path chain. More...
 
int findFork (const SoNodeKitPath *path) const
 If the two paths have different head nodes, this returns -1. More...
 
- Public Member Functions inherited from SoPath
 SoPath ()
 Constructs an empty path. More...
 
 SoPath (int approxLength)
 Constructs a path with a hint to length (number of nodes in chain). More...
 
 SoPath (SoNode *node)
 Constructs a path and sets the head node to the given node. More...
 
void setHead (SoNode *node)
 Sets head node (first node in chain). More...
 
void append (int childIndex)
 Adds node to end of chain; the node is the childIndex'th child of the current tail node. More...
 
void append (SoNode *childNode)
 Adds node to end of chain; uses the first occurrence of childNode as child of current tail node. More...
 
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. More...
 
void push (int childIndex)
 These 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. More...
 
void pop ()
 These 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. More...
 
SoNodegetHead () const
 These return the first and last nodes in a path chain. More...
 
SoNodegetTail () const
 These return the first and last nodes in a path chain. More...
 
SoNodegetNode (int i) const
 Returns a pointer to the i'th node in the chain. More...
 
SoNodegetNodeFromTail (int i) const
 Returns a pointer to the i'th node. More...
 
int getIndex (int i) const
 Return the index of the i'th node (within its parent) in the chain. More...
 
int getIndexFromTail (int i) const
 Return the index of the i'th node (within its parent) in the chain, counting backward from the tail node. More...
 
int getLength () const
 Returns length of path chain (number of nodes). More...
 
void truncate (int start)
 Truncates the path chain, removing all nodes from index start on. More...
 
bool containsNode (const SoNode *node) const
 Returns TRUE if the node is found anywhere in the path chain. More...
 
bool 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. More...
 
int findFork (const SoPath *path) const
 If the two paths have different head nodes, this returns -1. More...
 
SoPathcopy (int startFromNodeIndex=0, int numNodes=0) const
 Creates and returns a new path that is a copy of some or all of this path. More...
 
virtual SoType getTypeId () const
 Returns type identifier for path instance. More...
 
void insertIndex (SoNode *parent, int newIndex)
 This is called when a node in the path chain has a child added. More...
 
void removeIndex (SoNode *parent, int oldIndex)
 This is called when a node in the path chain has a child removed. More...
 
void replaceIndex (SoNode *parent, int index, SoNode *newChild)
 This is called when a node in the path chain replaces a child. More...
 
virtual void write (SoWriteAction *writeAction) const
 Writes path using given write action. More...
 
bool isRelevantNotification (SoNotList *list) const
 Returns TRUE if the given notification list involves a change to a node that affects the path. More...
 
- Public Member Functions inherited from SoBase
void ref () const
 Adds and removes a reference to an instance. More...
 
void unref () const
 
void unrefNoDelete () const
 
void touch ()
 Marks an instance as modified, simulating a change to it. More...
 
bool isOfType (SoType type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type. More...
 
virtual SbName getName () const
 Returns the name of an instance. More...
 
virtual void setName (const SbName &name)
 Sets the name of an instance. More...
 
virtual void startNotify ()
 Initiates notification from an instance. More...
 
virtual void notify (SoNotList *list)
 Propagates modification notification through an instance. More...
 
void addAuditor (void *auditor, SoNotRec::Type type)
 Adds/removes an auditor to/from list. More...
 
void removeAuditor (void *auditor, SoNotRec::Type type)
 
const SoAuditorListgetAuditors ()
 Returns auditor list– used by SoField and SoEngineOutput to trace forward connections. More...
 
int getRefCount () const
 Returns current reference count. More...
 
virtual void addWriteReference (SoOutput *out, bool isFromField=FALSE)
 Adds a reference to the instance when writing. More...
 
bool shouldWrite ()
 Returns TRUE if the instance should be written, based on the write-reference info already accumulated. More...
 

Protected Member Functions

 SoNodeKitPath (int approxLength)
 Hide the constructor. More...
 
virtual ~SoNodeKitPath ()
 Destructor. More...
 
- Protected Member Functions inherited from SoPath
void auditPath (bool flag)
 Allows internal SoTempPath subclass to forego auditor overhead. More...
 
 ~SoPath ()
 
- Protected Member Functions inherited from SoBase
 SoBase ()
 Constructor is protected - this is an abstract class. More...
 
virtual ~SoBase ()
 Virtual destructor so that subclasses are deleted properly. More...
 
virtual void destroy ()
 Actually deletes an instance. More...
 
bool hasMultipleWriteRefs () const
 Returns TRUE if the instance has multiple write references. More...
 
bool writeHeader (SoOutput *out, bool isGroup, bool isEngine) const
 Writes a header (name, open brace) or footer (close brace) to file defined by SoOutput. More...
 
void writeFooter (SoOutput *out) const
 
virtual const char * getFileFormatName () const
 Unknown nodes and engines write a different name for themselves than their typeId; this virtual method lets them do that (by default the typeId name is returned) More...
 

Friends

bool operator== (const SoNodeKitPath &p1, const SoNodeKitPath &p2)
 Comparison operator: returns TRUE if all nodes on the nodekit path are equal. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SoPath
static SoType getClassTypeId ()
 Returns type identifier for SoPath class. More...
 
static SoPathgetByName (const SbName &name)
 
static int getByName (const SbName &name, SoPathList &list)
 These methods lookup and return paths with a given name. More...
 
static void initClass ()
 Initializes path class. More...
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class. More...
 
static void initClass ()
 Setup type information. More...
 
static void incrementCurrentWriteCounter ()
 Increments the current write counter at the start of a write operation. More...
 
static void decrementCurrentWriteCounter ()
 Decrements the current write counter after a write operation, in some rare cases. More...
 
static void addName (SoBase *, const char *)
 Internal methods used to maintain the global name dictionary. More...
 
static void removeName (SoBase *, const char *)
 
static SoBasegetNamedBase (const SbName &, SoType)
 Helper routines used to get stuff out of nameDict. More...
 
static int getNamedBases (const SbName &, SoBaseList &, SoType)
 
static bool read (SoInput *in, SoBase *&base, SoType expectedType)
 Reads one instance of some subclass of SoBase. More...
 
static void setInstancePrefix (const SbString &c)
 This defaults to "+" and is used when naming nodes that are DEF's and USE'd. More...
 
- Static Public Attributes inherited from SoBase
static bool traceRefs
 Turns on/off reference count tracing (for debugging) More...
 
- Protected Types inherited from SoBase
enum  BaseFlags { IS_ENGINE = 1 , IS_GROUP = 2 }
 This set of enums is used when reading and writing the base. More...
 
- Static Protected Member Functions inherited from SoBase
static uint32_t getCurrentWriteCounter ()
 Returns current write counter. More...
 

Detailed Description

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 a SoNodeKitPath only shows nodekits and hides any private parts, successive nodekits in the path may not actually be parent and child.

See Also
SoBaseKit, SoPath, SoRayPickAction, SoSearchAction

Definition at line 105 of file SoNodeKitPath.h.

Constructor & Destructor Documentation

◆ SoNodeKitPath()

SoNodeKitPath::SoNodeKitPath ( int  approxLength)
inlineprotected

Definition at line 159 of file SoNodeKitPath.h.

◆ ~SoNodeKitPath()

virtual SoNodeKitPath::~SoNodeKitPath ( )
protectedvirtual

Member Function Documentation

◆ append() [1/2]

void SoNodeKitPath::append ( const SoNodeKitPath fromPath)

◆ append() [2/2]

void SoNodeKitPath::append ( SoBaseKit childKit)

If the path is empty, this is equivalent to setHead(childKit).

◆ containsNode()

bool SoNodeKitPath::containsNode ( SoBaseKit node) const

◆ findFork()

int SoNodeKitPath::findFork ( const SoNodeKitPath path) const

Otherwise, it returns the path chain index of the last nodekit (starting at the head) that is the same for both paths.

◆ getLength()

int SoNodeKitPath::getLength ( ) const

◆ getNode()

SoNode* SoNodeKitPath::getNode ( int  i) const

◆ getNodeFromTail()

SoNode* SoNodeKitPath::getNodeFromTail ( int  i) const

Passing 0 for i returns the tail nodekit.

◆ getTail()

SoNode* SoNodeKitPath::getTail ( ) const

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.

◆ pop()

void SoNodeKitPath::pop ( )

◆ truncate()

void SoNodeKitPath::truncate ( int  start)

Calling truncate(0) empties the path entirely.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const SoNodeKitPath p1,
const SoNodeKitPath p2 
)
friend

The documentation for this class was generated from the following file: