SoGetBoundingBoxAction(3IV)

SoGetBoundingBoxAction (SoBBoxAct) - computes bounding box of a scene

As shipped in IRIX 6.5.30. Added in IRIX 6.5.22.

NAME
     SoGetBoundingBoxAction (SoBBoxAct) - computes bounding box of a scene

INHERITS FROM
     SoAction > SoGetBoundingBoxAction

SYNOPSIS
     #include <Inventor_c/actions/SoGetBoundingBoxAction.h>

     typedef SoGetBoundingBoxAction
                         SoBBoxAct

     enum SoGetBoundingBoxActionResetType {
          SO_BBOX_ACT_TRANSFORM  Transformation
          SO_BBOX_ACT_BBOX       Bounding Box
          SO_BBOX_ACT_ALL        Both Transform and Bounding Box
     }

          Functions from class SoGetBoundingBoxAction:

     SoGetBoundingBoxAction *  SoBBoxActCreate(const SbViewportRegion
                                    *viewportRegion)
     void                      SoBBoxActSetVPReg(SoBBoxAct *this, const
                                    SbViewportRegion *newRegion)
     const SbViewportRegion *  SoBBoxActGetVPReg(const SoBBoxAct *this)
     SbBox3f                   SoBBoxActGetBBox(const SoBBoxAct *this)
     SbXfBox3f *               SoBBoxActGetXfBBox(SoBBoxAct *this)
     const SbVec3f *           SoBBoxActGetCenter(const SoBBoxAct *this)
     void                      SoBBoxActSetInCamSpace(SoBBoxAct *this, SbBool
                                    flag)
     SbBool                    SoBBoxActIsInCamSpace(const SoBBoxAct *this)
     void                      SoBBoxActSetResetPath(SoBBoxAct *this, const
                                    SoPath *path, SbBool resetBefore = TRUE,
                                    ResetType what = ALL)
     const SoPath *            SoBBoxActGetResetPath(const SoBBoxAct *this)
     SbBool                    SoBBoxActIsResetPath(const SoBBoxAct *this)
     SbBool                    SoBBoxActIsResetBefore(const SoBBoxAct *this)
     SoBBoxActResetType        SoBBoxActGetWhatReset(const SoBBoxAct *this)

          Functions from class SoAction:

     void                SoBBoxActApply(SoBBoxAct *this, SoNode *node)
     void                SoBBoxActApplyPath(SoBBoxAct *this, SoPath *path)
     void                SoBBoxActApplyPathList(SoBBoxAct *this, const
                              SoPathList *pathList, SbBool obeysRules = FALSE)
     SoType              SoBBoxActGetClassTypeId()
     SoType              SoBBoxActGetTypeId(SoBBoxAct *this)
     SbBool              SoBBoxActIsOfType(SoBBoxAct *this, SoType type)
     void                SoBBoxActInvalidateState(SoBBoxAct *this)

DESCRIPTION
     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, SbBox3fIsEmpty() will return TRUE).

FUNCTIONS
     SoGetBoundingBoxAction *  SoBBoxActCreate(const SbViewportRegion
                                    *viewportRegion)
          Constructor takes viewport region to use for picking. Even though
          the bounding box computation may not involve a window per se, some
          nodes need this information to determine their size and placement.

     void                      SoBBoxActSetVPReg(SoBBoxAct *this, const
                                    SbViewportRegion *newRegion)
     const SbViewportRegion *  SoBBoxActGetVPReg(const SoBBoxAct *this)
          Sets/returns current viewport region to use for action.

     SbBox3f                   SoBBoxActGetBBox(const SoBBoxAct *this)
          Returns computed bounding box in world space.

     SbXfBox3f *               SoBBoxActGetXfBBox(SoBBoxAct *this)
          Returns computed bounding box before transformation into world
          space.

     const SbVec3f *           SoBBoxActGetCenter(const SoBBoxAct *this)
          Returns computed center point in world space.

     void                      SoBBoxActSetInCamSpace(SoBBoxAct *this, SbBool
                                    flag)
          Set this flag to TRUE if you want the returned bounding box to be in
          the space of whatever camera is in the graph. Camera space is
          defined to have the viewpoint at the origin, with the direction of
          view along the negative z axis. This space can be used to determine
          distances of objects from the camera.

     SbBool                    SoBBoxActIsInCamSpace(const SoBBoxAct *this)
          Returns camera space flag.

     void                      SoBBoxActSetResetPath(SoBBoxAct *this, const
                                    SoPath *path, SbBool resetBefore = TRUE,
                                    ResetType what = ALL)
          If a non-NULL path is specified, the action will reset the computed
          bounding box to be empty and/or the current transformation to
          identity. The resetBefore flag indicates whether to perform the
          reset before or after the tail node of the path is traversed.

     const SoPath *            SoBBoxActGetResetPath(const SoBBoxAct *this)
          Returns the current reset path, or NULL.

     SbBool                    SoBBoxActIsResetPath(const SoBBoxAct *this)
          Returns TRUE if the current reset path is not NULL.

     SbBool                    SoBBoxActIsResetBefore(const SoBBoxAct *this)
          Returns TRUE if the resetBefore flag was specified for the reset
          path.

     SoBBoxActResetType        SoBBoxActGetWhatReset(const SoBBoxAct *this)
          Returns what flags were specified to be reset for the reset path.


SEE ALSO
     SbBox3f, SbXfBox3f, SoGetMatrixAction