Class SoGroup

All Implemented Interfaces:
SafeDisposable
Direct Known Subclasses:
SoArray, SoGeoLOD, SoLevelOfDetail, SoLOD, SoMultiPathSwitch, SoMultipleCopy, SoMultipleInstanceBase, SoMultiSwitch, SoNurbsGroup, SoOverlayGroup, SoPathSwitch, SoSeparator, SoShadowGroup, SoSwitch, SoTransformSeparator, SoVolumeClippingGroup, SoVolumeMaskGroup

public class SoGroup extends SoNode
Base class for all group nodes. 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:
  • Field Details

    • boundingBoxIgnoring

      public final SoSFBool boundingBoxIgnoring
      Whether to ignore this node during bounding box traversal. Default is false.
  • Constructor Details

    • SoGroup

      public SoGroup()
      Creates an empty group node.
    • SoGroup

      public SoGroup(int nChildren)
      Constructor that takes approximate number of children. Space is allocated to contain the specified number of children, but the group does not contain any actual child nodes.
  • Method Details

    • getNumChildren

      public int getNumChildren()
      Returns number of children.
    • replaceChild

      public void replaceChild(SoNode oldChild, SoNode newChild)
      Replaces first instance of given child with new child.
    • getChild

      public SoNode getChild(int index)
      Returns pointer the child node with the given index.
    • findChild

      public int findChild(SoNode child)
      Finds index of given child within group. Returns -1 if not found.
    • replaceChild

      public void replaceChild(int index, SoNode newChild)
      Replaces child with given index with new child.
    • removeAllChildren

      public void removeAllChildren()
      Removes all children from group.
    • removeChild

      public void removeChild(SoNode child)
      Removes first instance of given child from group.
    • addChild

      public void addChild(SoNode child)
      Adds a child as last one in group.
    • insertChild

      public void insertChild(SoNode child, int newChildIndex)
      Adds a child so that it becomes the one with the given index.
    • removeChild

      public void removeChild(int index)
      Removes child with given index from group.