|
| SoGetBoundingBoxAction (const SbViewportRegion &viewportRegion) |
| Constructor takes viewport region to use for picking.
|
|
virtual | ~SoGetBoundingBoxAction () |
| Destructor.
|
|
void | setViewportRegion (const SbViewportRegion &newRegion) |
| Sets/returns current viewport region to use for action.
|
|
const SbViewportRegion & | getViewportRegion () const |
| Sets/returns current viewport region to use for action.
|
|
SbBox3f | getBoundingBox () const |
| Returns computed bounding box in world space.
|
|
SbXfBox3f & | getXfBoundingBox () |
| Returns computed bounding box before transformation into world space.
|
|
const SbVec3f & | getCenter () const |
| Returns computed center point in world space.
|
|
void | setInCameraSpace (bool 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.
|
|
bool | isInCameraSpace () const |
| Returns camera space flag.
|
|
void | setResetPath (const SoPath *path, bool 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.
|
|
const SoPath * | getResetPath () const |
| Returns the current reset path, or NULL.
|
|
bool | isResetPath () const |
| Returns TRUE if the current reset path is not NULL.
|
|
bool | isResetBefore () const |
| Returns TRUE if the resetBefore flag was specified for the reset path.
|
|
SoGetBoundingBoxAction::ResetType | getWhatReset () const |
|
void | checkResetBefore () |
| Call these methods at beginning and end (respectively) of the getBoundingBox action for each node.
|
|
void | checkResetAfter () |
|
void | extendBy (const SbBox3f &box) |
| Extends the current bounding box by the given bounding box, after transforming it by the current value of the SoLocalBBoxMatrixElement.
|
|
void | extendBy (const SbXfBox3f &box) |
|
void | setCenter (const SbVec3f ¢er, bool transformCenter) |
| Sets the center of the bounding box to the given point, which, if transformCenter is TRUE, is first transformed by the current value of the SoLocalBBoxMatrixElement.
|
|
bool | isCenterSet () const |
|
void | resetCenter () |
|
virtual | ~SoAction () |
| Destructor.
|
|
virtual SoType | getTypeId () const =0 |
| Returns the type identifier for a specific instance.
|
|
bool | isOfType (SoType type) const |
| Returns TRUE if this instance is of the type specified in type or is derived from that type.
|
|
virtual void | apply (SoNode *node) |
|
virtual void | apply (SoPath *path) |
|
virtual void | apply (const SoPathList &pathList, bool obeysRules=FALSE) |
| Initiates an action on the graph defined either by a node, path, or list of paths.
|
|
virtual void | invalidateState () |
| Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied.
|
|
AppliedCode | getWhatAppliedTo () const |
| Returns code indicating what action is being applied to.
|
|
SoNode * | getNodeAppliedTo () const |
| These returns a pointer to the node, path, or path list the action is being applied to.
|
|
SoPath * | getPathAppliedTo () const |
|
const SoPathList * | getPathListAppliedTo () const |
| A single path list may be split into several, one for each different head node.
|
|
const SoPathList * | getOriginalPathListAppliedTo () const |
|
bool | isLastPathListAppliedTo () const |
|
PathCode | getPathCode (int &numIndices, const int *&indices) |
| Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.
|
|
void | traverse (SoNode *node) |
| Does traversal of a graph rooted by a node.
|
|
bool | hasTerminated () const |
| Returns TRUE if the traversal has reached a termination condition.
|
|
const SoPath * | getCurPath () |
| Returns a pointer to the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed.
|
|
SoState * | getState () const |
| Get the state from the action.
|
|
PathCode | getCurPathCode () const |
| These methods maintain the current path accumulated so far during traversal.
|
|
void | pushCurPath (int childIndex) |
|
void | popCurPath (PathCode prevPathCode) |
|
virtual SoNode * | getCurPathTail () |
| This is virtual, so that SoCallbackAction can use current node.
|
|
void | usePathCode (int &numIndices, const int *&indices) |
| called by inline getPathCode:
|
|
void | pushCurPath () |
| Optimized versions of push/pop when we know path codes won't change:
|
|
void | popPushCurPath (int childIndex) |
|
void | popCurPath () |
|
const SoLightweightPath & | getCurrentLightweightPath () const |
| Returns the current "light" path.
|
|
void | setCurrentLightweightPath (const SoLightweightPath &path) |
| Sets the current "light" path.
|
|
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).
- See Also
- SbBox3f, SbXfBox3f, SoGetMatrixAction
Definition at line 104 of file SoGetBoundingBoxAction.h.