SbXfBox3d.3coin2

Langue: en

Version: 379384 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

Sommaire

NAME

SbXfBox3d -

The SbXfBox3d class is a 3 dimensional box with double precision coordinates and an attached transformation.

It provides storage for two box corners with double precision floating point coordinates, and for a double precision 4x4 transformation matrix.

SYNOPSIS


#include <Inventor/SbBox.h>

Inherits SbBox3d.

Public Member Functions


SbXfBox3d (void)

SbXfBox3d (const SbVec3d &boxmin, const SbVec3d &boxmax)

SbXfBox3d (const SbBox3d &box)

void setTransform (const SbDPMatrix &matrix)

const SbDPMatrix & getTransform (void) const

const SbDPMatrix & getInverse (void) const

SbVec3d getCenter (void) const

void extendBy (const SbVec3d &pt)

void extendBy (const SbBox3d &bb)

void extendBy (const SbXfBox3d &bb)

SbBool intersect (const SbVec3d &pt) const

SbBool intersect (const SbBox3d &bb) const

SbBool intersect (const SbXfBox3d &bb) const

SbBox3d project (void) const

void getSpan (const SbVec3d &direction, double &dMin, double &dMax) const

void transform (const SbDPMatrix &matrix)

double getVolume (void) const

Detailed Description

The SbXfBox3d class is a 3 dimensional box with double precision coordinates and an attached transformation.

It provides storage for two box corners with double precision floating point coordinates, and for a double precision 4x4 transformation matrix.

See also:

SbBox2d, SbBox2f, SbBox2i32, SbBox2s, SbBox3d, SbBox3f, SbBox3i32, SbBox3s, SbXfBox3f, SbDPMatrix

Constructor & Destructor Documentation

SbXfBox3d::SbXfBox3d (void)The default constructor makes an empty box and identity matrix.

References SbDPMatrix::makeIdentity().

SbXfBox3d::SbXfBox3d (const SbVec3d & boxmin, const SbVec3d & boxmax)Constructs a box with the given corners.

The coordinates of min should be less than the coordinates of max if you want to make a valid box.

References SbDPMatrix::makeIdentity().

SbXfBox3d::SbXfBox3d (const SbBox3d & box)Constructs a box from the given SbBox3d.

The transformation is set to the identity matrix.

References SbDPMatrix::makeIdentity().

Member Function Documentation

void SbXfBox3d::setTransform (const SbDPMatrix & m)Sets the transformation to the given SbMatrix.

Referenced by extendBy(), and transform().

const SbDPMatrix & SbXfBox3d::getTransform (void) const [inline]Returns the current transformation matrix.

Referenced by extendBy().

const SbDPMatrix & SbXfBox3d::getInverse (void) constReturns the inverse of the current transformation matrix.

Referenced by extendBy(), and intersect().

SbVec3d SbXfBox3d::getCenter (void) constReturn the transformed center point of the box.

Reimplemented from SbBox3d.

References SbDPMatrix::multVecMatrix().

void SbXfBox3d::extendBy (const SbVec3d & pt)Extend the boundaries of the box by the given point, i.e. make the point fit inside the box if it isn't already so.

The point is assumed to be in transformed space.

Reimplemented from SbBox3d.

References getInverse(), SbBox3d::isEmpty(), SbDPMatrix::makeIdentity(), and SbDPMatrix::multVecMatrix().

void SbXfBox3d::extendBy (const SbBox3d & bb)Extend the boundaries of the box by the given bb parameter. The given box is assumed to be in transformed space.

The two given boxes will be combined in such a way so that the resultant bounding box always has the smallest possible volume. To accomplish this, the transformation on this SbXfBox3f will sometimes be flattened before it's combined with bb.

References SbBox3d::extendBy(), getInverse(), SbBox3d::getMax(), SbBox3d::getMin(), SbBox3d::getVolume(), getVolume(), SbBox3d::isEmpty(), SbDPMatrix::makeIdentity(), SbDPMatrix::multVecMatrix(), SoDebugError::postInfo(), SoDebugError::postWarning(), project(), SbBox3d::setBounds(), setTransform(), and SbVec3d::setValue().

void SbXfBox3d::extendBy (const SbXfBox3d & bb)Extend the boundaries of the box by the given bb parameter.

The given box is assumed to be in transformed space.

Note: is not guaranteed to give an optimal result if used for bbox calculation since the transformation matrix might change. See documentation in SoGetBoundingBoxAction for more details.

Reimplemented from SbBox3d.

References getInverse(), SbBox3d::getMax(), SbBox3d::getMin(), getTransform(), getVolume(), SbBox3d::isEmpty(), SbDPMatrix::multRight(), SbDPMatrix::multVecMatrix(), SoDebugError::postInfo(), SoDebugError::postWarning(), and SbVec3d::setValue().

SbBool SbXfBox3d::intersect (const SbVec3d & pt) constCheck if the given point lies within the boundaries of this box.

The point is assumed to be in transformed space.

Reimplemented from SbBox3d.

References SbDPMatrix::multVecMatrix().

Referenced by intersect().

SbBool SbXfBox3d::intersect (const SbBox3d & bb) constCheck if the given box lies wholly or partly within the boundaries of this box.

The given box is assumed to be in transformed space.

References SbBox3d::getMax(), SbBox3d::getMin(), SbDPMatrix::identity(), intersect(), SbBox3d::isEmpty(), and SoDebugError::postWarning().

SbBool SbXfBox3d::intersect (const SbXfBox3d & xfbb) constCheck if two transformed boxes intersect.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since:

Coin 2.0

Reimplemented from SbBox3d.

References getInverse(), intersect(), and transform().

SbBox3d SbXfBox3d::project (void) constProject the SbXfBox3d into a SbBox3d.

This gives the same resulting SbBox3d as doing a SbBox3d::transform() with this transformation matrix as parameter.

References SbBox3d::getMax(), SbBox3d::getMin(), SbBox3d::isEmpty(), and SbBox3d::transform().

Referenced by extendBy(), and getSpan().

void SbXfBox3d::getSpan (const SbVec3d & direction, double & dMin, double & dMax) constFind the span of the box in the given direction (i.e. how much room in the given direction the box needs). The distance is returned as the minimum and maximum distance from origo to the closest and furthest plane defined by the direction vector and each of the box' corners. The difference between these values gives the span.

Reimplemented from SbBox3d.

References SbBox3d::getSpan(), and project().

void SbXfBox3d::transform (const SbDPMatrix & m)Overridden from SbBox3d, as the transformations are to be kept separate from the box in the SbXfBox3d class.

Reimplemented from SbBox3d.

References SbDPMatrix::multRight(), and setTransform().

Referenced by intersect().

double SbXfBox3d::getVolume (void) constReturn box volume. Overridden from parent class to take into account the possibility of scaling in the transformation matrix.

Reimplemented from SbBox3d.

References SbDPMatrix::det3(), and SbBox3d::hasVolume().

Referenced by extendBy().

Author

Generated automatically by Doxygen for Coin from the source code.