Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SbXfBox3d Class Reference

The SbXfBox3d class is a 3 dimensional box with double precision coordinates and an attached transformation. More...

#include <Inventor/SbXfBox3d.h>

Inheritance diagram for SbXfBox3d:
SbBox3d

Public Member Functions

 SbXfBox3d (const SbBox3d &box)
 
 SbXfBox3d (const SbVec3d &boxmin, const SbVec3d &boxmax)
 
 SbXfBox3d (void)
 
void extendBy (const SbBox3d &bb)
 
void extendBy (const SbVec3d &pt)
 
void extendBy (const SbXfBox3d &bb)
 
SbVec3d getCenter (void) const
 
const SbDPMatrixgetInverse (void) const
 
void getSpan (const SbVec3d &direction, double &dMin, double &dMax) const
 
const SbDPMatrixgetTransform (void) const
 
double getVolume (void) const
 
SbBool intersect (const SbBox3d &bb) const
 
SbBool intersect (const SbVec3d &pt) const
 
SbBool intersect (const SbXfBox3d &bb) const
 
SbBox3d project (void) const
 
void setTransform (const SbDPMatrix &matrix)
 
void transform (const SbDPMatrix &matrix)
 
- Public Member Functions inherited from SbBox3d
 SbBox3d (const SbBox3f &box)
 
 SbBox3d (const SbBox3i32 &box)
 
 SbBox3d (const SbBox3s &box)
 
 SbBox3d (const SbVec3d &minpoint, const SbVec3d &maxpoint)
 
 SbBox3d (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
 
 SbBox3d (void)
 
void extendBy (const SbBox3d &box)
 
void extendBy (const SbVec3d &pt)
 
void getBounds (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
 
void getBounds (SbVec3d &minpoint, SbVec3d &maxpoint) const
 
SbVec3d getCenter (void) const
 
SbVec3d getClosestPoint (const SbVec3d &point) const
 
SbVec3dgetMax (void)
 
const SbVec3dgetMax (void) const
 
SbVec3dgetMin (void)
 
const SbVec3dgetMin (void) const
 
void getOrigin (double &origoX, double &origoY, double &origoZ) const
 
void getSize (double &sizeX, double &sizeY, double &sizeZ) const
 
SbVec3d getSize (void) const
 
void getSpan (const SbVec3d &dir, double &dmin, double &dmax) const
 
double getVolume (void) const
 
SbBool hasVolume (void) const
 
SbBool intersect (const SbBox3d &box) const
 
SbBool intersect (const SbVec3d &point) const
 
SbBool isEmpty (void) const
 
void makeEmpty (void)
 
SbBool outside (const SbDPMatrix &mvp, int &cullbits) const
 
void print (FILE *file) const
 
SbBox3dsetBounds (const SbBox3f &box)
 
SbBox3dsetBounds (const SbBox3i32 &box)
 
SbBox3dsetBounds (const SbBox3s &box)
 
SbBox3dsetBounds (const SbVec3d &minpoint, const SbVec3d &maxpoint)
 
SbBox3dsetBounds (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
 
void transform (const SbDPMatrix &matrix)
 

Additional Inherited Members

- Protected Attributes inherited from SbBox3d
SbVec3d maxpt
 
SbVec3d minpt
 

Detailed Description

The SbXfBox3d class is a 3 dimensional box with double precision coordinates and an attached transformation.

It provides storage for two box corners with double precision floating point coordinates, and for a double precision 4x4 transformation matrix.

See also
SbBox3d, SbDPMatrix, SbXfBox3f

Constructor & Destructor Documentation

◆ SbXfBox3d() [1/3]

SbXfBox3d::SbXfBox3d ( void )

The default constructor makes an empty box and identity matrix.

◆ SbXfBox3d() [2/3]

SbXfBox3d::SbXfBox3d ( const SbVec3d & boxmin,
const SbVec3d & boxmax )

Constructs a box with the given corners.

The coordinates of min should be less than the coordinates of max if you want to make a valid box.

◆ SbXfBox3d() [3/3]

SbXfBox3d::SbXfBox3d ( const SbBox3d & box)

Constructs a box from the given SbBox3d.

The transformation is set to the identity matrix.

Member Function Documentation

◆ extendBy() [1/3]

void SbXfBox3d::extendBy ( const SbBox3d & bb)

Extend the boundaries of the box by the given bb parameter. The given box is assumed to be in transformed space.

The two given boxes will be combined in such a way so that the resultant bounding box always has the smallest possible volume. To accomplish this, the transformation on this SbXfBox3f will sometimes be flattened before it is combined with bb.

◆ extendBy() [2/3]

void SbXfBox3d::extendBy ( const SbVec3d & pt)

Extend the boundaries of the box by the given point, i.e. make the point fit inside the box if it isn't already so.

The point is assumed to be in transformed space.

◆ extendBy() [3/3]

void SbXfBox3d::extendBy ( const SbXfBox3d & bb)

Extend the boundaries of the box by the given bb parameter.

The given box is assumed to be in transformed space.

Note: is not guaranteed to give an optimal result if used for bounding box calculation since the transformation matrix might change. See documentation in SoGetBoundingBoxAction for more details.

◆ getCenter()

SbVec3d SbXfBox3d::getCenter ( void ) const

Return the transformed center point of the box.

◆ getInverse()

const SbDPMatrix & SbXfBox3d::getInverse ( void ) const

Returns the inverse of the current transformation matrix.

◆ getSpan()

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

Find the span of the box in the given direction (i.e. how much room in the given direction the box needs). The distance is returned as the minimum and maximum distance from origo to the closest and furthest plane defined by the direction vector and each of the box' corners. The difference between these values gives the span.

◆ getTransform()

const SbDPMatrix & SbXfBox3d::getTransform ( void ) const
inline

Returns the current transformation matrix.

◆ getVolume()

double SbXfBox3d::getVolume ( void ) const

Return box volume. Overridden from parent class to take into account the possibility of scaling in the transformation matrix.

◆ intersect() [1/3]

SbBool SbXfBox3d::intersect ( const SbBox3d & bb) const

Check if the given box lies entirely or partially within the boundaries of this box.

The given box is assumed to be in transformed space.

◆ intersect() [2/3]

SbBool SbXfBox3d::intersect ( const SbVec3d & pt) const

Check if the given point lies within the boundaries of this box.

The point is assumed to be in transformed space.

◆ intersect() [3/3]

SbBool SbXfBox3d::intersect ( const SbXfBox3d & xfbb) const

Check if two transformed boxes intersect.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since
Coin 2.0

◆ project()

SbBox3d SbXfBox3d::project ( void ) const

Project the SbXfBox3d into a SbBox3d.

This gives the same resulting SbBox3d as doing a SbBox3d::transform() with this transformation matrix as parameter.

◆ setTransform()

void SbXfBox3d::setTransform ( const SbDPMatrix & m)

Sets the transformation to the given SbMatrix.

◆ transform()

void SbXfBox3d::transform ( const SbDPMatrix & m)

Overridden from SbBox3d, as the transformations are to be kept separate from the box in the SbXfBox3d class.


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