Open Inventor Reference
SbBox3d Class Reference

3D box class. More...

#include <Inventor/SbBoxd.h>

Inheritance diagram for SbBox3d:
SbXfBox3d

Public Member Functions

 SbBox3d ()
 Empty box constructor. More...
 
 SbBox3d (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
 Constructor given bounds. More...
 
 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. More...
 
 ~SbBox3d ()
 Destructor. More...
 
const SbVec3dgetMin () const
 Returns the minimum point of the box. More...
 
const SbVec3dgetMax () const
 Returns the maximum point of the box. More...
 
SbVec3dgetMin ()
 Returns the minimum point of the box. More...
 
SbVec3dgetMax ()
 Returns the maximum point of the box. More...
 
SbVec3d getCenter () const
 Returns the center of the box. More...
 
void extendBy (const SbVec3d &pt)
 Extends Box3d (if necessary) to contain given 3D point. More...
 
void extendBy (const SbBox3d &bb)
 Extends Box3d (if necessary) to contain given Box3d. More...
 
bool intersect (const SbVec3d &pt) const
 Returns TRUE if intersection of given point and Box3d is not empty. More...
 
bool intersect (const SbBox3d &bb) const
 Returns TRUE if intersection of given Box3d and Box3d is not empty. More...
 
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. More...
 
void setBounds (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
 Common get and set functions. More...
 
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. More...
 
void getOrigin (double &originX, double &originY, double &originZ) const
 Gets box origin which is the same as the minimum corner of the box. More...
 
void getSize (double &sizeX, double &sizeY, double &sizeZ) const
 Gets box size. More...
 
void makeEmpty ()
 Makes an empty box. More...
 
bool isEmpty () const
 Returns TRUE if the box is empty, and FALSE otherwise. More...
 
bool hasVolume () const
 Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise. More...
 
void getSpan (const SbVec3d &direction, double &dMin, double &dMax) const
 Finds the span of a box along a specified direction. More...
 
void transform (const SbMatrixd &m)
 Transforms box by matrix, enlarging box to contain result. More...
 
double getVolume () const
 Returns the volume of the box. More...
 

Friends

INVENTOR_API bool operator== (const SbBox3d &b1, const SbBox3d &b2)
 Equality comparisons. More...
 
INVENTOR_API bool operator!= (const SbBox3d &b1, const SbBox3d &b2)
 

Detailed Description

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 Inventor datatype classes and is used as input and output to geometry operations (see SoGetBoundingBoxAction).

See Also
SbXfBox3f, SbBox2f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction, SbBox3f, SbXfBox3d, SbBox2d, SbVec3d, SbVec2d, SbMatrixd

Definition at line 82 of file SbBoxd.h.

Constructor & Destructor Documentation

◆ SbBox3d() [1/3]

SbBox3d::SbBox3d ( )
inline

Definition at line 86 of file SbBoxd.h.

◆ SbBox3d() [2/3]

SbBox3d::SbBox3d ( double  xmin,
double  ymin,
double  zmin,
double  xmax,
double  ymax,
double  zmax 
)
inline

Definition at line 89 of file SbBoxd.h.

◆ SbBox3d() [3/3]

SbBox3d::SbBox3d ( const SbVec3d min,
const SbVec3d max 
)
inline

Definition at line 95 of file SbBoxd.h.

◆ ~SbBox3d()

SbBox3d::~SbBox3d ( )
inline

Definition at line 99 of file SbBoxd.h.

Member Function Documentation

◆ extendBy() [1/2]

void SbBox3d::extendBy ( const SbBox3d bb)

◆ extendBy() [2/2]

void SbBox3d::extendBy ( const SbVec3d pt)

◆ getBounds() [1/2]

void SbBox3d::getBounds ( double &  xmin,
double &  ymin,
double &  zmin,
double &  xmax,
double &  ymax,
double &  zmax 
) const
inline

Definition at line 150 of file SbBoxd.h.

Referenced by SbXfBox3d::getBounds().

◆ getBounds() [2/2]

void SbBox3d::getBounds ( SbVec3d _min,
SbVec3d _max 
) const
inline

Definition at line 154 of file SbBoxd.h.

◆ getCenter()

SbVec3d SbBox3d::getCenter ( ) const

◆ getClosestPoint()

SbVec3d SbBox3d::getClosestPoint ( const SbVec3d point)

(Returns the point on the center of the Z face if passed the center.)

◆ getMax() [1/2]

SbVec3d& SbBox3d::getMax ( )
inline

The maximum point is the corner of the box with the highest X, Y, and Z values.

Definition at line 112 of file SbBoxd.h.

◆ getMax() [2/2]

const SbVec3d& SbBox3d::getMax ( ) const
inline

The maximum point is the corner of the box with the highest X, Y, and Z values.

Definition at line 106 of file SbBoxd.h.

◆ getMin() [1/2]

SbVec3d& SbBox3d::getMin ( )
inline

The minimum point is the corner of the box with the lowest X, Y, and Z values.

Definition at line 109 of file SbBoxd.h.

◆ getMin() [2/2]

const SbVec3d& SbBox3d::getMin ( ) const
inline

The minimum point is the corner of the box with the lowest X, Y, and Z values.

Definition at line 103 of file SbBoxd.h.

◆ getOrigin()

void SbBox3d::getOrigin ( double &  originX,
double &  originY,
double &  originZ 
) const
inline

Definition at line 162 of file SbBoxd.h.

Referenced by SbXfBox3d::getOrigin().

◆ getSize()

void SbBox3d::getSize ( double &  sizeX,
double &  sizeY,
double &  sizeZ 
) const
inline

Definition at line 168 of file SbBoxd.h.

Referenced by SbXfBox3d::getSize().

◆ getSpan()

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

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.

◆ getVolume()

double SbBox3d::getVolume ( ) const

◆ hasVolume()

bool SbBox3d::hasVolume ( ) const
inline

Definition at line 181 of file SbBoxd.h.

Referenced by SbXfBox3d::hasVolume().

◆ intersect() [1/2]

bool SbBox3d::intersect ( const SbBox3d bb) const

◆ intersect() [2/2]

bool SbBox3d::intersect ( const SbVec3d pt) const

◆ isEmpty()

bool SbBox3d::isEmpty ( ) const
inline

Definition at line 177 of file SbBoxd.h.

Referenced by SbXfBox3d::isEmpty().

◆ makeEmpty()

void SbBox3d::makeEmpty ( )

Referenced by SbXfBox3d::makeEmpty().

◆ outside()

bool SbBox3d::outside ( const SbMatrixd MVP,
int &  cullBits 
) const

"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).

◆ setBounds() [1/2]

void SbBox3d::setBounds ( const SbVec3d _min,
const SbVec3d _max 
)
inline

Definition at line 147 of file SbBoxd.h.

◆ setBounds() [2/2]

void SbBox3d::setBounds ( double  xmin,
double  ymin,
double  zmin,
double  xmax,
double  ymax,
double  zmax 
)
inline

Definition at line 143 of file SbBoxd.h.

Referenced by SbXfBox3d::setBounds().

◆ transform()

void SbBox3d::transform ( const SbMatrixd m)

Friends And Related Function Documentation

◆ operator!=

INVENTOR_API bool operator!= ( const SbBox3d b1,
const SbBox3d b2 
)
friend

Definition at line 208 of file SbBoxd.h.

◆ operator==

INVENTOR_API bool operator== ( const SbBox3d b1,
const SbBox3d b2 
)
friend

The documentation for this class was generated from the following file: