SoGroup — base class for all group nodes
Contents
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.
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/Defaults
Group{}Inherits From
SoBase > SoFieldContainer > SoNode > SoGroup
Methods
SoGroup()
Creates an empty group node.
SoGroup(intnChildren)
Constructor that takes approximate number of children. Space is allocated for pointers to the
children, but the group does not contain any actual child nodes.
voidaddChild(SoNode*child)
Adds a child as last one in group.
voidinsertChild(SoNode*child,intnewChildIndex)
Adds a child so that it becomes the one with the given index.
SoNode*getChild(intindex)const
Returns pointer to child node with the given index.
intfindChild(constSoNode*child)const
Finds index of given child within group. Returns -1 if not found.
intgetNumChildren()const
Returns number of children.
voidremoveChild(intindex)
Removes child with given index from group.
voidremoveChild(SoNode*child)
Removes first instance of given child from group.
voidremoveAllChildren()
Removes all children from group.
voidreplaceChild(intindex,SoNode*newChild)
Replaces child with given index with new child.
voidreplaceChild(SoNode*oldChild,SoNode*newChild)
Replaces first instance of given child with new child.
staticSoTypegetClassTypeId()
Returns type identifier for this class.
Name
SoGroup — base class for all group nodes
See Also
SoArray,SoLevelOfDetail,SoMultipleCopy,SoPathSwitch,SoSeparator,SoSwitchSoGroup(3IV)()
Synopsis
#include<Inventor/nodes/SoGroup.h>
Methods from class SoGroup:
SoGroup()SoGroup(intnChildren)voidaddChild(SoNode*child)voidinsertChild(SoNode*child,intnewChildIndex)SoNode*getChild(intindex)constintfindChild(constSoNode*child)constintgetNumChildren()constvoidremoveChild(intindex)voidremoveChild(SoNode*child)voidremoveAllChildren()voidreplaceChild(intindex,SoNode*newChild)voidreplaceChild(SoNode*oldChild,SoNode*newChild)staticSoTypegetClassTypeId()
Methods from class SoNode:
voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)
Methods from class SoFieldContainer:
voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)
Methods from class SoBase:
voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const