Open Inventor Reference
SoGroup Class Reference

Base class for all group nodes. More...

#include <Inventor/nodes/SoGroup.h>

Inheritance diagram for SoGroup:
SoNode SoFieldContainer SoBase SoArray SoLevelOfDetail SoLOD SoMultipleCopy SoPathSwitch SoSeparator SoSwitch SoTransformSeparator SoUnknownNode SoUpgrader

List of all members.

Public Member Functions

 SoGroup ()
 Creates an empty group node.
 SoGroup (int nChildren)
 Constructor that takes approximate number of children.
void addChild (SoNode *child)
 Adds a child as last one in group.
void insertChild (SoNode *child, int newChildIndex)
 Adds a child so that it becomes the one with the given index.
SoNodegetChild (int index) const
 Returns pointer to child node with the given index.
int findChild (const SoNode *child) const
 Finds index of given child within group. Returns -1 if not found.
int getNumChildren () const
 Returns number of children.
void removeChild (int index)
 Removes child with given index from group.
void removeChild (SoNode *child)
 Removes first instance of given child from group.
void removeAllChildren ()
 Removes all children from group.
void replaceChild (int index, SoNode *newChild)
 Replaces child with given index with new child.
void replaceChild (SoNode *oldChild, SoNode *newChild)
 Replaces first instance of given child with new child.
virtual void doAction (SoAction *action)
 Implement actions.
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void pick (SoPickAction *action)
virtual void search (SoSearchAction *action)
virtual void write (SoWriteAction *action)
virtual SoChildListgetChildren () const
 Returns pointer to children.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Protected Member Functions

virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads stuff into instance of SoGroup. Returns FALSE on error.
virtual SbBool readChildren (SoInput *in)
 Reads just the children into instance of SoGroup. Returns FALSE on error.
virtual ~SoGroup ()
virtual void copyContents (const SoFieldContainer *fromFC, SbBool copyConnections)
 Copies the contents of the given node into this instance.

Protected Attributes

SoChildListchildren

Detailed Description

This node defines the base class for all group nodes. SoGroup is a node that contains an ordered list of child nodes. The ordering of the child nodes represents the traversal order for all operations (for example, rendering, picking, and so on). This node is simply a container for the child nodes and does not alter the traversal state in any way. During traversal, state accumulated for a child is passed on to each successive child and then to the parents of the group (SoGroup does not push or pop traversal state as SoSeparator does).

File Format/Default
Group {
}
Action Behavior
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoHandleEventAction, SoRayPickAction
Traverses each child in order.
SoGetMatrixAction
Does nothing unless the group is in the middle of the path chain the action is being applied to. If so, the children up to and including the next node in the chain are traversed.
SoSearchAction
If searching for group nodes, compares with this group. Otherwise, continues to search children.
SoWriteAction
Writes out the group node. This method also deals with any field data associated with the group node. As a result, this method is used for most subclasses of SoGroup as well.
See Also
SoArray, SoLevelOfDetail, SoMultipleCopy, SoPathSwitch, SoSeparator, SoSwitch

Definition at line 104 of file SoGroup.h.


Constructor & Destructor Documentation

SoGroup::SoGroup ( )
SoGroup::SoGroup ( int  nChildren)

Space is allocated for pointers to the children, but the group does not contain any actual child nodes.

virtual SoGroup::~SoGroup ( ) [protected, virtual]

Member Function Documentation

void SoGroup::addChild ( SoNode child)
virtual void SoGroup::callback ( SoCallbackAction action) [virtual]
virtual void SoGroup::copyContents ( const SoFieldContainer fromFC,
SbBool  copyConnections 
) [protected, virtual]

Reimplemented from SoNode.

Reimplemented in SoUnknownNode.

virtual void SoGroup::doAction ( SoAction action) [virtual]
int SoGroup::findChild ( const SoNode child) const
virtual void SoGroup::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]
SoNode* SoGroup::getChild ( int  index) const
virtual SoChildList* SoGroup::getChildren ( ) const [virtual]

Reimplemented from SoNode.

virtual void SoGroup::getMatrix ( SoGetMatrixAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoArray, SoMultipleCopy, SoPathSwitch, SoSeparator, SoSwitch, and SoTransformSeparator.

int SoGroup::getNumChildren ( ) const
virtual void SoGroup::GLRender ( SoGLRenderAction action) [virtual]
virtual void SoGroup::handleEvent ( SoHandleEventAction action) [virtual]
void SoGroup::insertChild ( SoNode child,
int  newChildIndex 
)
virtual void SoGroup::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoArray, SoMultipleCopy, SoPathSwitch, SoSwitch, and SoTransformSeparator.

virtual SbBool SoGroup::readChildren ( SoInput in) [protected, virtual]
virtual SbBool SoGroup::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Reimplemented from SoFieldContainer.

Reimplemented in SoSeparator, and SoUnknownNode.

void SoGroup::removeAllChildren ( )
void SoGroup::removeChild ( SoNode child) [inline]

Definition at line 137 of file SoGroup.h.

References removeChild().

Referenced by removeChild().

void SoGroup::removeChild ( int  index)
void SoGroup::replaceChild ( SoNode oldChild,
SoNode newChild 
) [inline]

Definition at line 147 of file SoGroup.h.

References replaceChild().

Referenced by replaceChild().

void SoGroup::replaceChild ( int  index,
SoNode newChild 
)
virtual void SoGroup::search ( SoSearchAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoArray, SoMultipleCopy, SoPathSwitch, SoSeparator, SoSwitch, and SoUnknownNode.

virtual void SoGroup::write ( SoWriteAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoBlinker, SoSwitch, and SoUnknownNode.


Member Data Documentation

Definition at line 169 of file SoGroup.h.


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