'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoGetBoundingBoxAction(3IV) .SH NAME SoGetBoundingBoxAction \(em computes bounding box of a scene .SH INHERITS FROM SoAction > SoGetBoundingBoxAction .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 0.5i \*(Crenum \*(CbResetType\*(Cr { .in 1i .ta 29m .in 1.5i+29n .ti 1i .ta 29m .ds Pt \*(CbSoGetBoundingBoxAction::TRANSFORM\f1 .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} Transformation .br .in 1.5i+29n .ti 1i .ta 29m .ds Pt \*(CbSoGetBoundingBoxAction::BBOX\f1 .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} Bounding Box .br .in 1.5i+29n .ti 1i .ta 29m .ds Pt \*(CbSoGetBoundingBoxAction::ALL\f1 .ie \w'\*(Pt'>=29n \{\ .ne 3 \*(Pt .ti 1i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} Both Transform and Bounding Box .br .in 0.5i \*(Cr} .sp .in 1i \f1Methods from class SoGetBoundingBoxAction: .in 0.5i .sp .ta 26m .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoGetBoundingBoxAction\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetViewportRegion\*(Cr(const SbViewportRegion &newRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbViewportRegion & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetViewportRegion\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBox3f .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBoundingBox\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbXfBox3f & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetXfBoundingBox\*(Cr() .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbVec3f & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCenter\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetInCameraSpace\*(Cr(SbBool flag) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisInCameraSpace\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetResetPath\*(Cr(const SoPath *path, SbBool resetBefore = TRUE, ResetType what = ALL) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SoPath * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetResetPath\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisResetPath\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisResetBefore\*(Cr() const .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSoGetBoundingBoxAction::ResetType .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWhatReset\*(Cr() const .sp .in 1i \f1Methods from class SoAction: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(SoNode *node) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(SoPath *path) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(const SoPathList &pathList, SbBool obeysRules = FALSE) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassTypeId\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTypeId\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisOfType\*(Cr(SoType type) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbinvalidateState\*(Cr() .sp .SH 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 \*(CbSoFaceSet\f1 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. .sp Each bounding box is \&calculated as a \*(CbSbXfBox3f\f1, where the transformation matrix is defined so that the bounding box can be stored in the object space of the \*(CbSoShape\f1. 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 \*(CbSbXfBox3f\f1 or as a world-space-aligned \*(CbSbBox3f\f1. .sp To calculate the bounding box of a subgraph bounded \&by two paths, specify the left edge of the subgraph with \*(CbsetResetPath()\f1, 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. .sp If the subgraph being traversed does not contain any shapes, the returned bounding box will be empty (that is, \*(Cbbox.isEmpty()\f1 will return TRUE). .SH METHODS .ta 26m .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Cr .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoGetBoundingBoxAction\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i \f1Constructor 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. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetViewportRegion\*(Cr(const SbViewportRegion &newRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbViewportRegion & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetViewportRegion\*(Cr() const .br .in 1i \f1Sets/returns current viewport region to use for action. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBox3f .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBoundingBox\*(Cr() const .br .in 1i \f1Returns computed bounding box in world space. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbXfBox3f & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetXfBoundingBox\*(Cr() .br .in 1i \f1Returns computed bounding box before transformation into world space. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbVec3f & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetCenter\*(Cr() const .br .in 1i \f1Returns computed center point in world space. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetInCameraSpace\*(Cr(SbBool flag) .br .in 1i \f1Set 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. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisInCameraSpace\*(Cr() const .br .in 1i \f1Returns camera space flag. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetResetPath\*(Cr(const SoPath *path, SbBool resetBefore = TRUE, ResetType what = ALL) .br .in 1i \f1If 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 \*(CrresetBefore\f1 flag indicates whether to perform the reset before or after \&the tail node of the path is traversed. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SoPath * .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetResetPath\*(Cr() const .br .in 1i \f1Returns the current reset path, or NULL. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisResetPath\*(Cr() const .br .in 1i \f1Returns TRUE if the current reset path is not NULL. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisResetBefore\*(Cr() const .br .in 1i \f1Returns TRUE if the \*(CrresetBefore\f1 flag was specified for the reset path. .sp .in 0.5i .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(CrSoGetBoundingBoxAction::ResetType .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetWhatReset\*(Cr() const .br .in 1i \f1Returns what flags were specified to be reset for the reset path. .sp .in 0.5i .SH SEE ALSO \*(CbSbBox3f, SbXfBox3f, SoGetMatrixAction