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