SONODEKITPATH(3iv)

πŸ’– SoNodeKitPath πŸ’–

okay bestie, welcome to SoNodeKitPath(3IV) β€” the manual page you didn't know you needed but absolutely do 🫢


🌸 NAME 🌸

SoNodeKitPath β€” a path that points to a list of hierarchical nodekits. it's giving "scenic route through your scene graph" fr fr ✨


πŸ¦‹ INHERITS FROM πŸ¦‹

SoBase > SoPath > SoNodeKitPath

so yes she's a whole descendant, a legacy, a bloodline πŸ‘‘


⭐ SYNOPSIS ⭐

#include <Inventor/SoNodeKitPath.h>

methods from class SoNodeKitPath:

void                append(SoBaseKit *childKit)
void                append(const SoNodeKitPath *fromPath)
void                pop()
SoNode *            getTail() const
SoNode *            getNode(int i) const
SoNode *            getNodeFromTail(int i) const
int                 getLength() const
void                truncate(int start)
SbBool              containsNode(const SoNodeKit *nodeKit) const
int                 findFork(const SoNodeKitPath *path) const
friend int          operator ==(const SoNodeKitPath &p1, const
                         SoNodeKitPath &p2)

methods from class SoPath:

void                setHead(SoNode *node)
SoNode *            getHead() const
SbBool              containsPath(const SoPath *path) const
SoPath *            copy(int startFromNodeIndex = 0, int numNodes = 0)
                         const
static SoPath *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoPathList &list)

methods from class SoBase:

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
static SoType       getClassTypeId()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ’… DESCRIPTION πŸ’…

so. SoNodeKitPath is a subclass of SoPath that lets you look at nodekits below the top nodekit in the path. why does that matter, you ask? because nodekits have hidden children, bestie. so when you call getTail() on a regular path, it just returns the top-most nodekit on the path. 😭

and like β€” that happens 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. main character energy honestly 🌈

intermediary (private) nodes between nodekits are not included in the nodekit path. we don't do plus-ones here πŸ™ˆ

⚠️ note that there is no constructor for an SoNodeKitPath, so you can not create one. periodt. instead, you cast an (SoPath *) into an (SoNodeKitPath *), which returns nodekit-style values from all the same questions as SoPath. it's giving glow-up via casting ✨

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. and methods which allow the programmer to refer to the child index of a node beneath its parent are also inaccessible β€” because a SoNodeKitPath only shows nodekits and hides any private parts, successive nodekits in the path may not actually be parent and child. the family tree is a vibe, not a strict hierarchy πŸ’€


✨ METHODS ✨

  • void 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). πŸŽ€
  • 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. no cutting the line, bestie 🚫
  • void pop() β€” pops the last nodekit off the end of the path. bye bitch πŸ’…
  • SoNode *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. πŸ‘‘
  • SoNode *getNode(int i) const β€” returns a pointer to the i'th node in the nodekit path.
  • SoNode *getNodeFromTail(int i) const β€” returns a pointer to the i'th nodekit in the chain, counting backward from the tail nodekit. passing 0 for i returns the tail nodekit. backwards is the new forwards fr fr πŸ”„
  • int getLength() const β€” returns length of path chain (number of nodekits).
  • void truncate(int start) β€” truncates the path chain, removing all nodes from index start on. calling truncate(0) empties the path entirely. full reset, she's gone 😭
  • SbBool containsNode(const SoNodeKit *nodeKit) 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. otherwise, it returns the path chain index of the last nodekit (starting at the head) that is the same for both paths. the fork in the road moment 🌸
  • friend int operator ==(const SoNodeKitPath &p1, const SoNodeKitPath &p2) β€” returns TRUE if all node pointers in the two nodekit path chains are equal. twin flames check βœ…

πŸŽ€ SEE ALSO πŸŽ€

SoBaseKit, SoPath, SoRayPickAction, SoSearchAction


and that's the whole page bestie, no cap, every single flag and signature accounted for πŸ’– this was SoNodeKitPath(3IV)() β€” go forth and cast responsibly, ily, bye πŸ¦‹βœ¨