Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoGetBoundingBoxAction Class Reference

The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs. More...

#include <Inventor/actions/SoGetBoundingBoxAction.h>

Inheritance diagram for SoGetBoundingBoxAction::

SoAction List of all members.

Public Types

enum  ResetType { TRANSFORM = 0x1, BBOX = 0x2, ALL = TRANSFORM | BBOX }

Public Methods

 SoGetBoundingBoxAction (const SbViewportRegion &vp)
virtual ~SoGetBoundingBoxAction ()
void setViewportRegion (const SbViewportRegion &newregion)
const SbViewportRegiongetViewportRegion (void) const
SbBox3f getBoundingBox (void) const
SbXfBox3fgetXfBoundingBox (void)
const SbVec3fgetCenter (void) const
void setInCameraSpace (const SbBool flag)
SbBool isInCameraSpace (void) const
void setResetPath (const SoPath *path, const SbBool resetbefore=TRUE, const ResetType what=ALL)
const SoPathgetResetPath (void) const
SbBool isResetPath (void) const
SbBool isResetBefore (void) const
SoGetBoundingBoxAction::ResetType getWhatReset (void) const
void checkResetBefore (void)
void checkResetAfter (void)
void extendBy (const SbBox3f &box)
void extendBy (const SbXfBox3f &box)
void setCenter (const SbVec3f &center, const SbBool transformcenter)
SbBool isCenterSet (void) const
void resetCenter (void)

Static Public Methods

void initClass (void)

Protected Methods

virtual void beginTraversal (SoNode *node)

Detailed Description

The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.

The use of bounding boxes is ubiquitous within the Coin library. It is needed for the correct execution of and for performance enhancements during rendering, picking, caching, culling, etc.

Apply this action to a path or scene graph root to calculate the bounding box and the center point of the geometry contained within the scene.

SoSeparator nodes are aggressively caching the results of bounding box calculations, so that they are really only re-calculated whenever the scenegraph rooted below any SoSeparator node has been modified. This means that applying this action to scenegraphs, or parts of scenegraphs, should be very quick on successive runs for "static" parts of the scene.

See also:
SoSeparator::boundingBoxCaching


Member Enumeration Documentation

enum SoGetBoundingBoxAction::ResetType
 

For internal use only.


Constructor & Destructor Documentation

SoGetBoundingBoxAction::SoGetBoundingBoxAction const SbViewportRegion & vp
 

Constructor.

Some node types need to know the viewport region to calculate their bounding box.

SoGetBoundingBoxAction::~SoGetBoundingBoxAction [virtual]
 

Destructor.


Member Function Documentation

void SoGetBoundingBoxAction::initClass void [static]
 

Initializes the run-time type system for this class, and sets up the enabled elements and action method list.

Reimplemented from SoAction.

void SoGetBoundingBoxAction::setViewportRegion const SbViewportRegion & newregion
 

Set a new viewport region with this method, if it has changed from the oned passed in with the constructor.

const SbViewportRegion & SoGetBoundingBoxAction::getViewportRegion void const
 

Returns the viewport region used by the action instance.

SbBox3f SoGetBoundingBoxAction::getBoundingBox void const
 

Returns the projected bounding box after (or during) traversal.

SbXfBox3f & SoGetBoundingBoxAction::getXfBoundingBox void
 

Returns the bounding box and transformation matrix to global coordinates. Use after (or during) traversal.

const SbVec3f & SoGetBoundingBoxAction::getCenter void const
 

Returns center point of scene after the action has been applied.

This might differ from the geometric center of the bounding box, as shape nodes may "weight" the center point according to various criteria (i.e. a faceset could for instance weight the center point according to the area within its bounding box where there are more polygons).

void SoGetBoundingBoxAction::setInCameraSpace const SbBool on
 

Sets whether the returned bounding box should be calculated in the coordinate system of the camera space or not.

SbBool SoGetBoundingBoxAction::isInCameraSpace void const
 

Returns whether the bounding box returned is to be in camera space.

void SoGetBoundingBoxAction::setResetPath const SoPath * path,
const SbBool resetbefore = TRUE,
const ResetType what = ALL
 

Forces the computed bounding box to be reset and the transformation to be identity before or after the tail node of path, depending on the resetbefore argument. NULL can be specified for the path argument to disable this behavior.

See also:
getResetPath(), isResetPath(), isResetBefore(), getWhatReset()

const SoPath * SoGetBoundingBoxAction::getResetPath void const
 

Returns the reset path (or NULL).

See also:
setResetPath(), isResetPath(), isResetBefore(), getWhatReset()

SbBool SoGetBoundingBoxAction::isResetPath void const
 

Returns whether a reset path is set or not.

See also:
setResetPath(), getResetPath(), isResetBefore(), getWhatReset()

SbBool SoGetBoundingBoxAction::isResetBefore void const
 

Returns whether the bounding box and transformation is reset before or after the tail node of the reset path.

See also:
setResetPath(), getResetPath(), isResetPath(), getWhatReset()

SoGetBoundingBoxAction::ResetType SoGetBoundingBoxAction::getWhatReset void const
 

Returns what type of reset has been specified for the reset path.

See also:
setResetPath(), getResetPath(), isResetPath(), isResetBefore()

void SoGetBoundingBoxAction::checkResetBefore void
 

For internal use only.

void SoGetBoundingBoxAction::checkResetAfter void
 

For internal use only.

void SoGetBoundingBoxAction::extendBy const SbBox3f & box
 

Extend bounding box by the given box. Called from nodes during traversal.

Should usually not be of interest to application programmers, unless you're extending Coin with your own shapenode extension classes.

void SoGetBoundingBoxAction::extendBy const SbXfBox3f & box
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SoGetBoundingBoxAction::setCenter const SbVec3f & center,
const SbBool transformcenter
 

For internal use only.

SbBool SoGetBoundingBoxAction::isCenterSet void const
 

For internal use only.

void SoGetBoundingBoxAction::resetCenter void
 

For internal use only.

void SoGetBoundingBoxAction::beginTraversal SoNode * node [protected, virtual]
 

This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal.

It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.

Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal.

Reimplemented from SoAction.


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:25 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001