SbXfBox3d Class Reference
[Basics]

VSG extension 3D box with an associated transformation matrix. More...

#include <Inventor/SbBox.h>

Inheritance diagram for SbXfBox3d:
SbBox3d

List of all members.

Public Member Functions

 SbXfBox3d ()
 SbXfBox3d (const SbVec3d &_min, const SbVec3d &_max)
 SbXfBox3d (const SbBox3d &box)
 ~SbXfBox3d ()
void setTransform (const SbMatrixd &m)
const SbMatrixdgetTransform () const
const SbMatrixdgetInverse () const
SbVec3d getCenter () 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
SbXfBox3dsetValue (const SbXfBox3f &xfbox3f)
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
void getOrigin (double &originX, double &originY, double &originZ) const
void getSize (double &sizeX, double &sizeY, double &sizeZ) const
double getVolume () const
void makeEmpty ()
SbBool isEmpty () const
SbBool hasVolume () const
void getSpan (const SbVec3d &direction, double &dMin, double &dMax) const
void transform (const SbMatrixd &m)
SbBox3d project () const

Friends

int operator== (const SbXfBox3d &b1, const SbXfBox3d &b2)
int operator!= (const SbXfBox3d &b1, const SbXfBox3d &b2)

Detailed Description

VSG extension 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 SbXfBox3d without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.

SEE ALSO

SbBox3f, SbBox2f, SbBox2s, SbVec3d, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction


Constructor & Destructor Documentation

SbXfBox3d::SbXfBox3d (  ) 

Constructor.

The box is initially empty.

SbXfBox3d::SbXfBox3d ( const SbVec3d _min,
const SbVec3d _max 
)

Constructor.

SbXfBox3d::SbXfBox3d ( const SbBox3d box  ) 

Constructor.

SbXfBox3d::~SbXfBox3d (  )  [inline]

Destructor.


Member Function Documentation

void SbXfBox3d::extendBy ( const SbXfBox3d bb  ) 

Extends the box (if necessary) to contain the given box.

Reimplemented from SbBox3d.

void SbXfBox3d::extendBy ( const SbBox3d bb  )  [inline]

Extends the box (if necessary) to contain the given box.

void SbXfBox3d::extendBy ( const SbVec3d 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:

   SbXfBox3d 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 SbBox3d.

void SbXfBox3d::getBounds ( SbVec3d _min,
SbVec3d _max 
) const [inline]

Gets the bounds of the box.

Reimplemented from SbBox3d.

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

Gets the bounds of the box.

Reimplemented from SbBox3d.

SbVec3d SbXfBox3d::getCenter (  )  const

Returns the center of the box.

Reimplemented from SbBox3d.

const SbMatrixd& SbXfBox3d::getInverse (  )  const [inline]

Gets the inverse of the transformation on the box.

void SbXfBox3d::getOrigin ( double &  originX,
double &  originY,
double &  originZ 
) const [inline]

Returns origin (minimum point) of the box.

Reimplemented from SbBox3d.

void SbXfBox3d::getSize ( double &  sizeX,
double &  sizeY,
double &  sizeZ 
) const [inline]

Returns size of the box.

Reimplemented from SbBox3d.

void SbXfBox3d::getSpan ( const SbVec3d direction,
double &  dMin,
double &  dMax 
) const [inline]

Finds the extent of the box along a particular direction.

Reimplemented from SbBox3d.

const SbMatrixd& SbXfBox3d::getTransform (  )  const [inline]

Gets the transformation on the box.

double SbXfBox3d::getVolume (  )  const

Gives the volume of the box (0 for an empty box).

Reimplemented from SbBox3d.

SbBool SbXfBox3d::hasVolume (  )  const [inline]

Checks if the box has volume; i.e., all three dimensions have positive size.

Reimplemented from SbBox3d.

SbBool SbXfBox3d::intersect ( const SbBox3d bb  )  const [inline]

Returns TRUE if intersection of this XfBox3d and the given Box3d is not empty.

SbBool SbXfBox3d::intersect ( const SbVec3d pt  )  const

Returns TRUE if intersection of given point and this box is not empty.

Reimplemented from SbBox3d.

SbBool SbXfBox3d::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 SbBox3d.

void SbXfBox3d::makeEmpty (  )  [inline]

Sets the box to contain nothing.

Reimplemented from SbBox3d.

SbBox3d SbXfBox3d::project (  )  const

Projects an SbXfBox3d to an SbBox3d.

void SbXfBox3d::setBounds ( const SbVec3d _min,
const SbVec3d _max 
) [inline]

Sets the bounds of the box.

Reimplemented from SbBox3d.

void SbXfBox3d::setBounds ( double  xmin,
double  ymin,
double  zmin,
double  xmax,
double  ymax,
double  zmax 
) [inline]

Sets the bounds of the box.

Reimplemented from SbBox3d.

void SbXfBox3d::setTransform ( const SbMatrixd m  ) 

Sets the transformation on the box.

SbXfBox3d & SbXfBox3d::setValue ( const SbXfBox3f xfbox3f  )  [inline]

Sets value of the box from a single precision box.

void SbXfBox3d::transform ( const SbMatrixd m  ) 

Transforms the box by the given matrix.

Reimplemented from SbBox3d.


Friends And Related Function Documentation

int operator!= ( const SbXfBox3d b1,
const SbXfBox3d b2 
) [friend]

Inequality comparison.

Reimplemented from SbBox3d.

int operator== ( const SbXfBox3d b1,
const SbXfBox3d b2 
) [friend]

Equality comparison.

Reimplemented from SbBox3d.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/