3D box with an associated transformation matrix. More...
#include <Inventor/SbBox.h>
Public Member Functions | |
SbXfBox3f () | |
SbXfBox3f (const SbVec3f &_min, const SbVec3f &_max) | |
SbXfBox3f (const SbBox3f &box) | |
~SbXfBox3f () | |
void | setTransform (const SbMatrix &m) |
const SbMatrix & | getTransform () const |
const SbMatrix & | getInverse () const |
SbVec3f | getCenter () const |
void | extendBy (const SbVec3f &pt) |
void | extendBy (const SbBox3f &bb) |
void | extendBy (const SbXfBox3f &bb) |
SbBool | intersect (const SbVec3f &pt) const |
SbBool | intersect (const SbBox3f &bb) const |
SbXfBox3f & | setValue (const SbXfBox3d &xfbox3d) |
void | setBounds (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax) |
void | setBounds (const SbVec3f &_min, const SbVec3f &_max) |
void | getBounds (float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const |
void | getBounds (SbVec3f &_min, SbVec3f &_max) const |
void | getOrigin (float &originX, float &originY, float &originZ) |
void | getSize (float &sizeX, float &sizeY, float &sizeZ) |
float | getVolume () const |
void | makeEmpty () |
SbBool | isEmpty () const |
SbBool | hasVolume () const |
void | getSpan (const SbVec3f &direction, float &dMin, float &dMax) const |
void | transform (const SbMatrix &m) |
SbBox3f | project () const |
Friends | |
int | operator== (const SbXfBox3f &b1, const SbXfBox3f &b2) |
int | operator!= (const SbXfBox3f &b1, const SbXfBox3f &b2) |
3D box with an associated transformation matrix.
A 3D box with an arbitrary transformation applied. This class is useful when a box will be transformed frequently; if an SbBox3f is used for this purpose it will expand each time it is transformed in order to keep itself axis-aligned. Transformations can be accumulated on an SbXfBox3f without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.
SbBox3f, SbBox2f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction
SbXfBox3f::SbXfBox3f | ( | ) |
Constructor.
The box is initially empty.
SbXfBox3f::SbXfBox3f | ( | const SbBox3f & | box | ) |
Constructor.
SbXfBox3f::~SbXfBox3f | ( | ) | [inline] |
Destructor.
void SbXfBox3f::extendBy | ( | const SbXfBox3f & | bb | ) |
Extends the box (if necessary) to contain the given box.
Reimplemented from SbBox3f.
void SbXfBox3f::extendBy | ( | const SbBox3f & | bb | ) | [inline] |
Extends the box (if necessary) to contain the given box.
If the box has had a non-identity transformation applied using the setTransform() method, the given SbBox3f is assumed to be in the transformed space.
void SbXfBox3f::extendBy | ( | const SbVec3f & | pt | ) |
Extends the box (if necessary) to contain the given 3D point.
If the box has had a non-identity transformation applied using the setTransform() method, the point is assumed to be in the transformed space. For example, the following code sequence:
SbXfBox3f bbox; bbox.extendBy(SbVec3f(0,0,0)); SbMatrix trans; trans.setTranslate(SbVec3f(1,1,1)); bbox.setTransform(trans); bbox.extendBy(SbVec3f(0,0,0));
will result in a bounding box extending from (-1,-1,-1) to (0,0,0) in the bbox's local (untransformed) space.
Reimplemented from SbBox3f.
Gets the bounds of the box.
Reimplemented from SbBox3f.
void SbXfBox3f::getBounds | ( | float & | xmin, | |
float & | ymin, | |||
float & | zmin, | |||
float & | xmax, | |||
float & | ymax, | |||
float & | zmax | |||
) | const [inline] |
Gets the bounds of the box.
Reimplemented from SbBox3f.
const SbMatrix& SbXfBox3f::getInverse | ( | ) | const [inline] |
Gets the inverse of the transformation on the box.
void SbXfBox3f::getOrigin | ( | float & | originX, | |
float & | originY, | |||
float & | originZ | |||
) | [inline] |
Returns origin (minimum point) of the box.
void SbXfBox3f::getSize | ( | float & | sizeX, | |
float & | sizeY, | |||
float & | sizeZ | |||
) | [inline] |
Returns size of the box.
void SbXfBox3f::getSpan | ( | const SbVec3f & | direction, | |
float & | dMin, | |||
float & | dMax | |||
) | const [inline] |
Finds the extent of the box along a particular direction.
Reimplemented from SbBox3f.
const SbMatrix& SbXfBox3f::getTransform | ( | ) | const [inline] |
Gets the transformation on the box.
float SbXfBox3f::getVolume | ( | ) | const |
Gives the volume of the box (0 for an empty box).
Reimplemented from SbBox3f.
SbBool SbXfBox3f::hasVolume | ( | ) | const [inline] |
Checks if the box has volume; i.e., all three dimensions have positive size.
Reimplemented from SbBox3f.
Returns TRUE if intersection of given box and this box is not empty.
Returns TRUE if intersection of given point and this box is not empty.
Reimplemented from SbBox3f.
SbBool SbXfBox3f::isEmpty | ( | ) | const [inline] |
Returns TRUE if the box is empty, and FALSE otherwise. Note: Setting the box to all zeros does not make it "empty". Use the makeEmpty() method. (This method only returns true if the maximum X value is less than the minimum X value.)
Reimplemented from SbBox3f.
void SbXfBox3f::makeEmpty | ( | ) | [inline] |
Sets the box to contain nothing.
Reimplemented from SbBox3f.
Sets the bounds of the box.
Reimplemented from SbBox3f.
void SbXfBox3f::setBounds | ( | float | xmin, | |
float | ymin, | |||
float | zmin, | |||
float | xmax, | |||
float | ymax, | |||
float | zmax | |||
) | [inline] |
Sets the bounds of the box.
Reimplemented from SbBox3f.
void SbXfBox3f::setTransform | ( | const SbMatrix & | m | ) |
Sets the transformation on the box.
Sets value of the box from a double precision box.
void SbXfBox3f::transform | ( | const SbMatrix & | m | ) |
Transforms the box by the given matrix.
Reimplemented from SbBox3f.
Inequality comparison.
Reimplemented from SbBox3f.
Equality comparison.
Reimplemented from SbBox3f.