SoNodeKitPath Class Reference
[NodeKits]

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

#include <Inventor/SoNodeKitPath.h>

Inheritance diagram for SoNodeKitPath:
SoPath SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

int getLength () const
SoNodegetTail () const
SoNodegetNode (int i) const
SoNodegetNodeFromTail (int i) const
void truncate (int start)
void pop ()
void append (SoBaseKit *childKit)
void append (const SoNodeKitPath *fromPath)
SbBool containsNode (SoBaseKit *node) const
int findFork (const SoNodeKitPath *path) const

Friends

int operator== (const SoNodeKitPath &p1, const SoNodeKitPath &p2)

Detailed Description

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.

SEE ALSO

SoBaseKit, SoPath, SoRayPickAction, SoSearchAction


Member Function Documentation

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.

Reimplemented from SoPath.

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) .

SbBool SoNodeKitPath::containsNode ( SoBaseKit node  )  const

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.

Reimplemented from SoPath.

int SoNodeKitPath::getLength (  )  const

Returns length of path chain (number of nodekits).

Reimplemented from SoPath.

SoNode* SoNodeKitPath::getNode ( int  i  )  const

Returns the i'th node in the nodekit path.

Reimplemented from SoPath.

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.

Reimplemented from SoPath.

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.

Reimplemented from SoPath.

void SoNodeKitPath::pop (  ) 

Pops the last nodekit off the end of the path.

Reimplemented from SoPath.

void SoNodeKitPath::truncate ( int  start  ) 

Truncates the path chain, removing all nodes from index start on.

Calling truncate(0) empties the path entirely.

Reimplemented from SoPath.


Friends And Related Function Documentation

int operator== ( const SoNodeKitPath p1,
const SoNodeKitPath p2 
) [friend]

Returns TRUE if all nodes in the two nodekit path chains are equal.

Reimplemented from SoPath.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/