Open Inventor Reference
|
3D box with an associated transformation matrix. More...
#include <Inventor/SbBoxd.h>
Public Member Functions | |
SbXfBox3d () | |
Constructors and destructor. | |
SbXfBox3d (const SbVec3d &_min, const SbVec3d &_max) | |
Constructors and destructor. | |
SbXfBox3d (const SbBox3d &box) | |
Constructors and destructor. | |
~SbXfBox3d () | |
Constructors and destructor. | |
void | setTransform (const SbMatrixd &m) |
Sets the transformation on the box. | |
const SbMatrixd & | getTransform () const |
Gets the transformation on the box, and its inverse. | |
const SbMatrixd & | getInverse () const |
Gets the transformation on the box, and its inverse. | |
SbVec3d | getCenter () const |
Returns the center of the box. | |
void | extendBy (const SbVec3d &pt) |
Extends the box (if necessary) to contain the given 3D point. | |
void | extendBy (const SbBox3d &bb) |
Extends the box (if necessary) to contain the given SbBox3d. | |
void | extendBy (const SbXfBox3d &bb) |
Extends the box (if necessary) to contain the given SbXfBox3d. | |
bool | intersect (const SbVec3d &pt) const |
Returns TRUE if intersection of given point and Box3d is not empty. | |
bool | intersect (const SbBox3d &bb) const |
Returns TRUE if intersection of given XfBox3d and Box3d is not empty. | |
void | setBounds (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
Common get and set functions. | |
void | setBounds (const SbVec3d &_min, const SbVec3d &_max) |
Set and get the bounds of the box. | |
void | getBounds (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const |
void | getBounds (SbVec3d &_min, SbVec3d &_max) const |
void | getOrigin (double &originX, double &originY, double &originZ) |
Returns origin (minimum point) of the box. | |
void | getSize (double &sizeX, double &sizeY, double &sizeZ) |
Returns size of the box. | |
double | getVolume () const |
Gives the volume of the box (0 for an empty box). | |
void | makeEmpty () |
Sets Box3d to contain nothing. | |
bool | isEmpty () const |
Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if they are degenerate at all. | |
bool | hasVolume () const |
Checks if the box has volume; i.e., all three dimensions have positive size. | |
void | getSpan (const SbVec3d &direction, double &dMin, double &dMax) const |
Finds the extent of the box along a particular direction. | |
void | transform (const SbMatrixd &m) |
Transforms the box by the given matrix. | |
SbBox3d | project () const |
Projects an SbXfBox3d to an SbBox3d. | |
![]() | |
SbBox3d () | |
Empty box constructor. | |
SbBox3d (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) | |
Constructor given bounds. | |
SbBox3d (const SbVec3d &min, const SbVec3d &max) | |
Constructor given minimum and maximum points min and max are the corners of the diagonal that define the box. | |
~SbBox3d () | |
Destructor. | |
const SbVec3d & | getMin () const |
Returns the minimum point of the box. | |
const SbVec3d & | getMax () const |
Returns the maximum point of the box. | |
SbVec3d & | getMin () |
Returns the minimum point of the box. | |
SbVec3d & | getMax () |
Returns the maximum point of the box. | |
SbVec3d | getCenter () const |
Returns the center of the box. | |
void | extendBy (const SbVec3d &pt) |
Extends Box3d (if necessary) to contain given 3D point. | |
void | extendBy (const SbBox3d &bb) |
Extends Box3d (if necessary) to contain given Box3d. | |
bool | intersect (const SbVec3d &pt) const |
Returns TRUE if intersection of given point and Box3d is not empty. | |
bool | intersect (const SbBox3d &bb) const |
Returns TRUE if intersection of given Box3d and Box3d is not empty. | |
bool | outside (const SbMatrixd &MVP, int &cullBits) const |
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projection matrix given. | |
void | setBounds (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
Common get and set functions. | |
void | setBounds (const SbVec3d &_min, const SbVec3d &_max) |
void | getBounds (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const |
void | getBounds (SbVec3d &_min, SbVec3d &_max) const |
SbVec3d | getClosestPoint (const SbVec3d &point) |
Returns the closest point on the box to the given point. | |
void | getOrigin (double &originX, double &originY, double &originZ) const |
Gets box origin which is the same as the minimum corner of the box. | |
void | getSize (double &sizeX, double &sizeY, double &sizeZ) const |
Gets box size. | |
void | makeEmpty () |
Makes an empty box. | |
bool | isEmpty () const |
Returns TRUE if the box is empty, and FALSE otherwise. | |
bool | hasVolume () const |
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise. | |
void | getSpan (const SbVec3d &direction, double &dMin, double &dMax) const |
Finds the span of a box along a specified direction. | |
void | transform (const SbMatrixd &m) |
Transforms box by matrix, enlarging box to contain result. | |
double | getVolume () const |
Returns the volume of the box. | |
Friends | |
INVENTOR_API bool | operator== (const SbXfBox3d &b1, const SbXfBox3d &b2) |
Equality comparisons. | |
INVENTOR_API bool | operator!= (const SbXfBox3d &b1, const SbXfBox3d &b2) |
A 3D box with an arbitrary transformation applied. This class is useful when a box will be transformed frequently; if an SbBox3d 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 SbXfBox3d without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.
SbXfBox3d::SbXfBox3d | ( | ) |
Referenced by extendBy(), extendBy(), operator!=, and operator==.
SbXfBox3d::SbXfBox3d | ( | const SbBox3d & | box | ) |
References SbBox3d::SbBox3d().
|
inline |
If the box has had a non-identity transformation applied using the setTransform() method, the given SbBox3d is assumed to be in the transformed space.
Definition at line 273 of file SbBoxd.h.
References extendBy(), SbBox3d::SbBox3d(), and SbXfBox3d().
void SbXfBox3d::extendBy | ( | const SbVec3d & | pt | ) |
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:
will result in a bounding box extending from (-1,-1,-1) to (0,0,0) in bbox'es local (untransformed) space.
Referenced by extendBy().
void SbXfBox3d::extendBy | ( | const SbXfBox3d & | bb | ) |
References SbXfBox3d().
|
inline |
Definition at line 295 of file SbBoxd.h.
References SbBox3d::getBounds().
Definition at line 299 of file SbBoxd.h.
References SbBox3d::getBounds().
SbVec3d SbXfBox3d::getCenter | ( | ) | const |
|
inline |
Definition at line 303 of file SbBoxd.h.
References SbBox3d::getOrigin().
|
inline |
Definition at line 309 of file SbBoxd.h.
References SbBox3d::getSize().
|
inline |
double SbXfBox3d::getVolume | ( | ) | const |
|
inline |
Definition at line 326 of file SbBoxd.h.
References SbBox3d::hasVolume().
|
inline |
Definition at line 283 of file SbBoxd.h.
References project(), and SbBox3d::SbBox3d().
bool SbXfBox3d::intersect | ( | const SbVec3d & | pt | ) | const |
|
inline |
All member functions preserve this invariant.
Definition at line 322 of file SbBoxd.h.
References SbBox3d::isEmpty().
|
inline |
Definition at line 316 of file SbBoxd.h.
References SbBox3d::makeEmpty().
SbBox3d SbXfBox3d::project | ( | ) | const |
References SbBox3d::SbBox3d().
Referenced by getSpan(), and intersect().
Definition at line 292 of file SbBoxd.h.
References SbBox3d::setBounds().
|
inline |
Definition at line 287 of file SbBoxd.h.
References SbBox3d::setBounds().
void SbXfBox3d::setTransform | ( | const SbMatrixd & | m | ) |
void SbXfBox3d::transform | ( | const SbMatrixd & | m | ) |
|
friend |
Definition at line 354 of file SbBoxd.h.
References INVENTOR_API, and SbXfBox3d().
|
friend |
References INVENTOR_API, and SbXfBox3d().