This class is used to compute a 3D bounding box enclosing objects defined by a scene graph. The box is a rectangular prism. The action also computes the center point, which is defined differently for different
objects. (For example, the center of an
SoFaceSet is the average of its vertices' coordinates.) For a group, the center point is defined as the average of the centers of all shapes in it.
Each bounding box is
calculated as a
SbXfBox3f, where the transformation matrix is defined so that the bounding box can be stored in the object space of the
SoShape. When two bounding boxes are combined by a group node, the combination is
performed so as to produce the smaller untransformed box. The result of the calculation by the action can be returned as an
SbXfBox3f or as a world-space-aligned
SbBox3f.
To calculate the bounding box of a subgraph bounded
by two paths, specify the left edge of the subgraph with
setResetPath(), and apply the action to the path that defines the right edge of the subgraph. The accumulated bounding box and transformation will be reset when
the tail of the reset path is traversed.
If the subgraph being traversed does not contain any shapes, the returned bounding box will be empty (that is,
box.isEmpty() will return TRUE).