3D box class. More...
#include <Inventor/SbBox.h>
Public Member Functions | |
SbBox3d () | |
SbBox3d (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) | |
SbBox3d (const SbVec3d &_min, const SbVec3d &_max) | |
~SbBox3d () | |
const SbVec3d & | getMin () const |
const SbVec3d & | getMax () const |
SbVec3d & | getMin () |
SbVec3d & | getMax () |
SbVec3d | getCenter () const |
void | extendBy (const SbVec3d &pt) |
void | extendBy (const SbBox3d &bb) |
SbBool | intersect (const SbVec3d &pt) const |
SbBool | intersect (const SbBox3d &bb) const |
SbBox3d | intersection (const SbBox3d &box) const |
SbBool | contains (const SbBox3d &bb) const |
SbBool | outside (const SbMatrixd &MVP, int &cullBits) const |
void | setBounds (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
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) const |
void | getOrigin (double &originX, double &originY, double &originZ) const |
void | getSize (double &sizeX, double &sizeY, double &sizeZ) const |
SbVec3d | getSize () const |
void | makeEmpty () |
SbBool | isEmpty () const |
SbBool | hasVolume () const |
void | getSpan (const SbVec3d &direction, double &dMin, double &dMax) const |
void | transform (const SbMatrixd &m) |
double | getVolume () const |
template<typename T > | |
SbBox3d (const T &b) | |
Friends | |
int | operator== (const SbBox3d &b1, const SbBox3d &b2) |
int | operator!= (const SbBox3d &b1, const SbBox3d &b2) |
3D box which has planes parallel to the major axes and is specified by two points on a diagonal. This class is part of the standard Open Inventor datatype classes and is used as input and output to geometry operations (see SoGetBoundingBoxAction).
SbXfBox3f, SbBox2f, SbBox2s, SbVec3d, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction
SbBox3d::SbBox3d | ( | ) | [inline] |
Constructor for a 3D double box.
The box is initially empty.
SbBox3d::SbBox3d | ( | double | xmin, | |
double | ymin, | |||
double | zmin, | |||
double | xmax, | |||
double | ymax, | |||
double | zmax | |||
) | [inline] |
Constructor for a 3D double box.
xmin , ymin , zmin , xmax , ymax and zmax are the bounds of the box.
Constructor for a 3D double box.
m_min and m_max are the corners of the diagonal that define the box.
SbBox3d::~SbBox3d | ( | ) | [inline] |
Destructor.
SbBox3d::SbBox3d | ( | const T & | b | ) | [inline, explicit] |
Constructor that converts an arbitrary SbBox3 to an SbBox3f.
Returns TRUE if the specified box is fully contained inside this box.
void SbBox3d::extendBy | ( | const SbBox3d & | bb | ) |
Extends this box (if necessary) to contain the specified box.
Reimplemented in SbXfBox3d.
void SbBox3d::extendBy | ( | const SbVec3d & | pt | ) |
Extends this box (if necessary) to contain the specified point.
Reimplemented in SbXfBox3d.
Gets the corners of the box.
Reimplemented in SbXfBox3d.
void SbBox3d::getBounds | ( | double & | xmin, | |
double & | ymin, | |||
double & | zmin, | |||
double & | xmax, | |||
double & | ymax, | |||
double & | zmax | |||
) | const [inline] |
Gets the corners of the box.
Reimplemented in SbXfBox3d.
Returns the closest point on the box to the given point.
(Returns the point on the center of the Z face if passed the center.)
SbVec3d& SbBox3d::getMax | ( | ) | [inline] |
Returns the maximum point of the box.
The maximum point is the corner of the box with the highest X, Y, and Z values.
const SbVec3d& SbBox3d::getMax | ( | ) | const [inline] |
Returns the maximum point of the box.
The maximum point is the corner of the box with the highest X, Y, and Z values.
SbVec3d& SbBox3d::getMin | ( | ) | [inline] |
Returns the minimum point of the box.
The minimum point is the corner of the box with the lowest X, Y, and Z values.
const SbVec3d& SbBox3d::getMin | ( | ) | const [inline] |
Returns the minimum point of the box.
The minimum point is the corner of the box with the lowest X, Y, and Z values.
void SbBox3d::getOrigin | ( | double & | originX, | |
double & | originY, | |||
double & | originZ | |||
) | const [inline] |
Gets box origin which is the same as the minimum corner of the box.
Reimplemented in SbXfBox3d.
SbVec3d SbBox3d::getSize | ( | void | ) | const [inline] |
Gets box size.
void SbBox3d::getSize | ( | double & | sizeX, | |
double & | sizeY, | |||
double & | sizeZ | |||
) | const [inline] |
Gets box size.
Reimplemented in SbXfBox3d.
void SbBox3d::getSpan | ( | const SbVec3d & | direction, | |
double & | dMin, | |||
double & | dMax | |||
) | const |
Finds the span of a box along a specified direction.
The span is the total distance the box occupies along a given direction. The total distance is returned in the form of a minimum and maximum distance from the origin of each of the corners of the box along the given direction. The difference between these two values is the span.
Reimplemented in SbXfBox3d.
double SbBox3d::getVolume | ( | ) | const |
Returns the volume of the box.
Reimplemented in SbXfBox3d.
SbBool SbBox3d::hasVolume | ( | ) | const [inline] |
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
Reimplemented in SbXfBox3d.
Returns TRUE if the specified box intersects this box.
Returns TRUE if the specified point intersects this box.
Reimplemented in SbXfBox3d.
Returns the intersection of the specified box with this box.
Returned box is empty if there is no intersection.
SbBool SbBox3d::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 in SbXfBox3d.
void SbBox3d::makeEmpty | ( | ) |
Makes an empty box.
Reimplemented in SbXfBox3d.
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projection matrix given.
"cullBits" keeps track of which view-volume clipping planes the box is completely inside of; if a 'parent' bounding box of this bounding box was found to be completely inside the left/right clipping planes, the low bit of cullBits will be set to zero, and this routine will not test this box against those planes. When cullBits is zero, it is a waste of time to call this function! Before calling this the first time, set cullBits to 7 (SoGLRenderAction and SoSeparator will handle this automatically for render culling).
Sets the corners of the box.
Reimplemented in SbXfBox3d.
void SbBox3d::setBounds | ( | double | xmin, | |
double | ymin, | |||
double | zmin, | |||
double | xmax, | |||
double | ymax, | |||
double | zmax | |||
) | [inline] |
Sets the corners of the box.
Reimplemented in SbXfBox3d.
void SbBox3d::transform | ( | const SbMatrixd & | m | ) |
Transforms box by matrix, enlarging box to contain result.
Reimplemented in SbXfBox3d.
Inequality comparison.
Reimplemented in SbXfBox3d.
Equality comparison.
Reimplemented in SbXfBox3d.