other versions
- wheezy-backports 3.1.4~abc9f50-3~bpo70+1
- jessie 3.1.4~abc9f50-7
SoGetBoundingBoxAction(3) | Coin | SoGetBoundingBoxAction(3) |
NAME¶
SoGetBoundingBoxAction - The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs. If this action is applied to a path or scene graph root, it will calculate the bounding box and the center point of the geometry contained within the scene.SYNOPSIS¶
#include <Inventor/actions/SoGetBoundingBoxAction.h> Inherits SoAction.Public Types¶
enum ResetType { TRANSFORM = 0x1, BBOX = 0x2, ALL = TRANSFORM | BBOX }
Public Member Functions¶
virtual SoType getTypeId (void) const
Static Public Member Functions¶
static SoType getClassTypeId (void)
Protected Member Functions¶
virtual const
Static Protected Member Functions¶
static SoEnabledElementsList * getClassEnabledElements (void)
Additional Inherited Members¶
Detailed Description¶
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs. If this action is applied to a path or scene graph root, it will calculate the bounding box and the center point of the geometry contained within the scene.SoSeparator::boundingBoxCaching
Member Enumeration Documentation¶
enum SoGetBoundingBoxAction::ResetType¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.Constructor & Destructor Documentation¶
SoGetBoundingBoxAction::SoGetBoundingBoxAction (const SbViewportRegion &vp)¶
Constructor. It might seem unnecessary to have to pass in a viewport region argument to calculate bounding boxes, but there is a good reason for this: a few shape nodes needs to know the viewport region to calculate their bounding box -- these include SoText2 and SoImage, among others. What is particular about these shapes is that they are fundamentally 2D shapes, but they are being rendered on the screen 'surface' as if they were in a 3D scene. (This is possible because we can match each pixel's depth value against the 3D shapes in the scene.) To compute an accurate 3D bounding box of a shape rendered in 2D on the screen 'surface', you need to 'de-project' the screen-space area it occupies to a 2D rectangle placed at some depth in the scene. This 'de-projecting' operation needs to know about the dimensions of the viewport. Also, some 3D shapes like for instance SoNurbsSurface, get slightly distorted if there's an SoComplexity node in the scenegraph with the SoComplexity::value field set to SCREEN_SPACE. Then it is also necessary to know the viewport region to find out how to accurately calculate the bounding box of those shapes. You would usually want to pass in a viewport region equal to the layout of the current renderarea canvas. If you have a viewer or So available, you can get hold of the viewport region data simply by doingconst SbViewportRegion & vpreg = viewer->getViewportRegion();(If you don't have a viewer or renderarea available in your application at the point where you want to get the bounding box, it probably doesn't matter much what you set it to. The accuracy of the bounding box calculation might be slightly wrong versus the actual rendered appearance of the scene, but this is usually not noticable.)
SoGetBoundingBoxAction::~SoGetBoundingBoxAction (void) [virtual]¶
Destructor.Member Function Documentation¶
SoType SoGetBoundingBoxAction::getTypeId (void) const [virtual]¶
Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and 'downward' casting. Usage example:void bar(SoAction * action) { if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) { // safe downward cast, know the type SoGLRenderAction * glrender = (SoGLRenderAction *)action; } return; // ignore if not renderaction }For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR. For more information on writing Coin extensions, see the SoAction class documentation. Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses. Implements SoAction.
SoType SoGetBoundingBoxAction::getClassTypeId (void) [static]¶
Returns the run-time type object associated with instances of this class. Reimplemented from SoAction.void SoGetBoundingBoxAction::addMethod (const SoTypetype, SoActionMethodmethod) [static]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.void SoGetBoundingBoxAction::enableElement (const SoTypetype, const intstackindex) [static]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.const SoEnabledElementsList & SoGetBoundingBoxAction::getEnabledElements (void) const [protected], [virtual]¶
Returns a list of the elements used by action instances of this class upon traversal operations. Reimplemented from SoAction.SoEnabledElementsList * SoGetBoundingBoxAction::getClassEnabledElements (void) [static], [protected]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. This method not available in the original OIV API, see SoSubAction.h for explanation. Reimplemented from SoAction.SoActionMethodList * SoGetBoundingBoxAction::getClassActionMethods (void) [static], [protected]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. This method not available in the original OIV API, see SoSubAction.h for explanation. Reimplemented from SoAction.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 one 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 SbBoolon)¶
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 SbBoolresetbefore = TRUE, const ResetTypewhat = 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)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Called before node traversal of each node (from SoNode action method).void SoGetBoundingBoxAction::checkResetAfter (void)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Called after node traversal of each node (from SoNode action method).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 ¢erarg, const SbBooltransformcenter)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Set a new center point during traversal.SbBool SoGetBoundingBoxAction::isCenterSet (void) const¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Query about the center point during traversal.void SoGetBoundingBoxAction::resetCenter (void)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Reset the scene center point during traversal.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.Author¶
Generated automatically by Doxygen for Coin from the source code.Sat Oct 12 2013 | Version 4.0.0a |