Open Inventor Reference
SoChildList Class Reference

This class maintains a list of child nodes for any node. More...

#include <Inventor/misc/SoChildList.h>

Inheritance diagram for SoChildList:
SoNodeList SoBaseList SbPList

Public Member Functions

 SoChildList (SoNode *parentNode)
 Constructors and destructor. More...
 
 SoChildList (SoNode *parentNode, int size)
 
 SoChildList (SoNode *parentNode, const SoChildList &l)
 
 ~SoChildList ()
 
void append (SoNode *child)
 All of these override the standard SoBaseList methods so they can maintain auditors correctly. More...
 
void insert (SoNode *child, int addBefore)
 
void remove (int which)
 
void truncate (int start)
 
void copy (const SoChildList &l)
 
void set (int i, SoNode *child)
 
void traverse (SoAction *action)
 Traverses all children to apply action. More...
 
void traverse (SoAction *action, int childIndex)
 Traverses just one child. More...
 
void traverse (SoAction *action, int firstChild, int lastChild)
 Traverses all children between two indices, inclusive. More...
 
void addPathAuditor (SoPath *p)
 SoPath calls these to be notified of changes in scene graph topology: More...
 
void removePathAuditor (SoPath *p)
 
- Public Member Functions inherited from SoNodeList
 SoNodeList ()
 
 SoNodeList (int size)
 
 SoNodeList (const SoNodeList &l)
 
 ~SoNodeList ()
 Destructor. More...
 
void append (SoNode *ptr)
 Adds a pointer to the end of the list. More...
 
SoNodeListoperator= (const SoNodeList &l)
 Copies a list, keeping all reference counts correct. More...
 
SoNodeoperator[] (int i) const
 
- Public Member Functions inherited from SoBaseList
 SoBaseList ()
 Constructor. More...
 
 SoBaseList (int size)
 Constructor that pre-allocates storage for size pointers. More...
 
 SoBaseList (const SoBaseList &l)
 Constructor that copies the contents of another list. More...
 
 ~SoBaseList ()
 Destructor. More...
 
void append (SoBase *ptr)
 Adds a pointer to the end of the list. More...
 
void insert (SoBase *ptr, int addBefore)
 Inserts given pointer in list before pointer with given index. More...
 
void remove (int which)
 Removes pointer with given index. More...
 
void truncate (int start)
 Removes all pointers after one with given index, inclusive. More...
 
void copy (const SoBaseList &l)
 Copies a list, keeping all reference counts correct. More...
 
SoBaseListoperator= (const SoBaseList &l)
 Copies a list, keeping all reference counts correct. More...
 
SoBaseoperator[] (int i) const
 Access an element of a list. More...
 
void set (int i, SoBase *ptr)
 Sets an element of a list. More...
 
void addReferences (bool flag)
 Indicates whether to call ref() and unref() for bases in the list when adding/removing them. More...
 
- Public Member Functions inherited from SbPList
 SbPList ()
 Constructor. More...
 
 SbPList (int initSize)
 initSize specifies an initial size for the list, which is useful as an optimization if you can estimate the length of the list before you construct it. More...
 
 SbPList (const SbPList &pl)
 Copy constructor. More...
 
 ~SbPList ()
 Destructor. More...
 
void append (void *ptr)
 Adds given pointer to end of list. More...
 
int find (const void *ptr) const
 Returns index of given pointer in list, or -1 if not found. More...
 
void insert (void *ptr, int addBefore)
 Inserts given pointer in list before pointer with given index. More...
 
void remove (int which)
 Removes pointer with given index. More...
 
int getLength () const
 Returns number of pointers in list. More...
 
void truncate (int start)
 Removes all pointers after one with given index, inclusive. More...
 
void copy (const SbPList &pl)
 Copy a list. More...
 
SbPListoperator= (const SbPList &pl)
 Assignment operator; copies list into this list. More...
 
void *& operator[] (int i) const
 Returns pointer with given index. More...
 
bool operator== (const SbPList &pl) const
 Equality and inequality operators. More...
 
bool operator!= (const SbPList &pl) const
 Equality and inequality operators. More...
 
void * get (int i) const
 Internal versions of [] that do not check for bounds: More...
 
void set (int i, void *j)
 

Detailed Description

It allows children to be added, removed, replaced, and accessed. The SoGroup class has an instance of this class and provides public methods for dealing with children. Other classes can also have an instance of this class and may choose to publicize whatever methods they wish for dealing with them. The SoNode::getChildren() method returns the child list for any node class.

SoChildList automatically maintains the auditor list for parent nodes. That is, when a child is added to the list, the parent node is automatically added as a parent auditor of the child. To make this possible, the parent node must be passed in to the constructors of the SoChildList class.

Definition at line 83 of file SoChildList.h.

Constructor & Destructor Documentation

◆ SoChildList() [1/3]

SoChildList::SoChildList ( SoNode parentNode)

◆ SoChildList() [2/3]

SoChildList::SoChildList ( SoNode parentNode,
int  size 
)

◆ SoChildList() [3/3]

SoChildList::SoChildList ( SoNode parentNode,
const SoChildList l 
)

◆ ~SoChildList()

SoChildList::~SoChildList ( )

Member Function Documentation

◆ addPathAuditor()

void SoChildList::addPathAuditor ( SoPath p)
inline

Definition at line 118 of file SoChildList.h.

◆ append()

void SoChildList::append ( SoNode child)

◆ copy()

void SoChildList::copy ( const SoChildList l)

◆ insert()

void SoChildList::insert ( SoNode child,
int  addBefore 
)

◆ remove()

void SoChildList::remove ( int  which)

◆ removePathAuditor()

void SoChildList::removePathAuditor ( SoPath p)
inline

Definition at line 119 of file SoChildList.h.

◆ set()

void SoChildList::set ( int  i,
SoNode child 
)

◆ traverse() [1/3]

void SoChildList::traverse ( SoAction action)
inline

Stops if action's termination condition is reached

Definition at line 103 of file SoChildList.h.

References SbPList::getLength().

◆ traverse() [2/3]

void SoChildList::traverse ( SoAction action,
int  childIndex 
)
inline

Definition at line 107 of file SoChildList.h.

◆ traverse() [3/3]

void SoChildList::traverse ( SoAction action,
int  firstChild,
int  lastChild 
)

Stops if action's termination condition is reached.

◆ truncate()

void SoChildList::truncate ( int  start)

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