Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoFullPath Class Reference

Path that allows access to hidden children. More...

#include <Inventor/SoPath.h>

+ Inheritance diagram for SoFullPath:

Public Member Functions

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.
 
SoNodegetTail () const
 Returns the last node in a path chain.
 
SoNodegetNodeFromTail (int i) const
 Returns the i'th node (within its parent) in the chain, counting backward from the tail node.
 
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
 get instance Index from tail
 
int getLength () const
 Returns length of path chain (number of nodes).
 
- 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.
 
SoNodegetHead () const
 Returns the first node in a path chain.
 
SoNodegetTail () const
 Returns the last node in a path chain.
 
SoNodegetNode (int i) const
 Returns the i'th node (within its parent) in the chain.
 
SoNodegetNode (const SoType type, int &i) const
 Returns the first node and its index, from the head of the given type in the chain.
 
SoNodegetNodeFromTail (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.
 
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.
 
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

class SoTempPath
 

Additional Inherited Members

- Static Public Member Functions inherited from SoPath
static SoType getClassTypeId ()
 Returns type identifier for SoPath class.
 
static SoPathgetByName (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.
 

Detailed Description

Path that allows access to hidden children.

This class allows expert users to examine "hidden" children in paths. For example children inside a nodeKit. SoPath allows access from the head node down to the first node with hidden children, but no further. Casting an SoPath to an SoFullPath (which is always guaranteed to be safe) allows you to access hidden children. SoFullPath overrides some SoPath methods to make this possible.

You need SoFullPath, for example, to get the actual tail of the pick path (the geometry node) when picking geometry in node kits. For example:

SoPath* pPath = ...
SoNode* pTail = ((SoFullPath*)pPath)->getTail();
Path that allows access to hidden children.
Definition SoPath.h:604
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
SoNode * getTail() const
Returns the last node in a path chain.

NOTE: Applying an action on an SoFullPath may not give the expected result.
When applying an action on an SoFullPath, the "hidden" children will not be traversed. If you want to apply an action on all the children in the path, use the following technique:

SoPath* path = ...
SoRef<SoPath> tempPath = ((SoFullPath*)path)->copy();
action.apply( tempPath );
tempPath = NULL;
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.

FILE FORMAT/DEFAULT

    SoPath {
    [head node]
    [number of remaining indices]
    [index]
    &...
    [index]
    }

SEE ALSO

SoPath

Definition at line 604 of file SoPath.h.

Member Function Documentation

◆ getIndexFromTail()

int SoFullPath::getIndexFromTail ( int  i) const
inline

Returns the index of the i'th node (within its parent) in the chain, counting backward from the tail node.

Passing 0 for i returns the index of the tail node.

Definition at line 623 of file SoPath.h.

◆ getInstanceIndexFromTail()

int SoFullPath::getInstanceIndexFromTail ( int  i) const
inline

get instance Index from tail

Definition at line 629 of file SoPath.h.

◆ getLength()

int SoFullPath::getLength ( ) const
inline

Returns length of path chain (number of nodes).

Definition at line 635 of file SoPath.h.

◆ getNodeFromTail()

SoNode * SoFullPath::getNodeFromTail ( int  i) const
inline

Returns the i'th node (within its parent) in the chain, counting backward from the tail node.

Passing 0 for i returns the tail node.

Definition at line 619 of file SoPath.h.

◆ getTail()

SoNode * SoFullPath::getTail ( ) const
inline

Returns the last node in a path chain.

Definition at line 615 of file SoPath.h.

◆ pop()

void SoFullPath::pop ( )
inline

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.

Definition at line 611 of file SoPath.h.

Friends And Related Symbol Documentation

◆ SoTempPath

friend class SoTempPath
friend

Definition at line 642 of file SoPath.h.


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