HDK
openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T > Class Template Reference

Axis-aligned bounding box. More...

`#include <BBox.h>`

## Public Types

using Vec3Type = Vec3T

using ValueType = Vec3T

using VectorType = Vec3T

using ElementType = typename Vec3Type::ValueType

## Public Member Functions

BBox ()
The default constructor creates an invalid bounding box. More...

BBox (const Vec3T &xyzMin, const Vec3T &xyzMax)
Construct a bounding box that exactly encloses the given minimum and maximum points. More...

BBox (const Vec3T &xyzMin, const Vec3T &xyzMax, bool sorted)
Construct a bounding box that exactly encloses the given minimum and maximum points. More...

BBox (const Vec3T &xyzMin, const ElementType &length)
Contruct a cubical bounding box from a minimum coordinate and an edge length. More...

BBox (const ElementType *xyz, bool sorted=true)
Construct a bounding box that exactly encloses two points, whose coordinates are given by an array of six values, x1, y1, z1, x2, y2 and z2. More...

BBox (const BBox &)=default

BBoxoperator= (const BBox &)=default

void sort ()
Sort the mininum and maximum points of this bounding box by their x, y and z components. More...

const Vec3T & min () const
Return a const reference to the minimum point of this bounding box. More...

const Vec3T & max () const
Return a const reference to the maximum point of this bounding box. More...

Vec3T & min ()
Return a non-const reference to the minimum point of this bounding box. More...

Vec3T & max ()
Return a non-const reference to the maximum point of this bounding box. More...

bool operator== (const BBox &rhs) const
Return `true` if this bounding box is identical to the given bounding box. More...

bool operator!= (const BBox &rhs) const
Return `true` if this bounding box differs from the given bounding box. More...

bool empty () const
Return `true` if this bounding box is empty, i.e., it has no (positive) volume. More...

bool hasVolume () const
Return `true` if this bounding box has (positive) volume. More...

operator bool () const
Return `true` if this bounding box has (positive) volume. More...

bool isSorted () const
Return `true` if all components of the minimum point are less than or equal to the corresponding components of the maximum point. More...

Vec3d getCenter () const
Return the center point of this bounding box. More...

Vec3T extents () const
Return the extents of this bounding box, i.e., the length along each axis. More...

size_t maxExtent () const
Return the index (0, 1 or 2) of the longest axis. More...

size_t minExtent () const
Return the index (0, 1 or 2) of the shortest axis. More...

ElementType volume () const
Return the volume enclosed by this bounding box. More...

bool isInside (const Vec3T &xyz) const
Return `true` if the given point is inside this bounding box. More...

bool isInside (const BBox &) const
Return `true` if the given bounding box is inside this bounding box. More...

bool hasOverlap (const BBox &) const
Return `true` if the given bounding box overlaps with this bounding box. More...

bool intersects (const BBox &other) const
Return `true` if the given bounding box overlaps with this bounding box. More...

void expand (const Vec3T &xyz)
Expand this bounding box to enclose the given point. More...

void expand (const BBox &)
Union this bounding box with the given bounding box. More...

void expand (const Vec3T &xyzMin, const ElementType &length)
Union this bounding box with the cubical bounding box with minimum point xyzMin and the given edge length. More...

void translate (const Vec3T &t)
Translate this bounding box by (tx, ty, tz). More...

template<typename MapType >
BBox applyMap (const MapType &map) const
Apply a map to this bounding box. More...

template<typename MapType >
BBox applyInverseMap (const MapType &map) const
Apply the inverse of a map to this bounding box. More...

Unserialize this bounding box from the given stream. More...

void write (std::ostream &os) const
Serialize this bounding box to the given stream. More...

template<typename MapType >
BBox< Vec3T > applyMap (const MapType &map) const

template<typename MapType >
BBox< Vec3T > applyInverseMap (const MapType &map) const

## Detailed Description

### template<typename Vec3T> class openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >

Axis-aligned bounding box.

Definition at line 23 of file BBox.h.

## Member Typedef Documentation

template<typename Vec3T>
 using openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::ElementType = typename Vec3Type::ValueType

Definition at line 29 of file BBox.h.

template<typename Vec3T>
 using openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::ValueType = Vec3T

Definition at line 27 of file BBox.h.

template<typename Vec3T>
 using openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::Vec3Type = Vec3T

Definition at line 26 of file BBox.h.

template<typename Vec3T>
 using openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::VectorType = Vec3T

Definition at line 28 of file BBox.h.

## Constructor & Destructor Documentation

template<typename Vec3T >
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( )
inline

The default constructor creates an invalid bounding box.

Definition at line 148 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( const Vec3T & xyzMin, const Vec3T & xyzMax )
inline

Construct a bounding box that exactly encloses the given minimum and maximum points.

Definition at line 156 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( const Vec3T & xyzMin, const Vec3T & xyzMax, bool sorted )
inline

Construct a bounding box that exactly encloses the given minimum and maximum points.

If sorted is false, sort the points by their x, y and z components.

Definition at line 163 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( const Vec3T & xyzMin, const ElementType & length )
inline

Contruct a cubical bounding box from a minimum coordinate and an edge length.

Note
Inclusive for integral ElementTypes

Definition at line 171 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( const ElementType * xyz, bool sorted = `true` )
inlineexplicit

Construct a bounding box that exactly encloses two points, whose coordinates are given by an array of six values, x1, y1, z1, x2, y2 and z2.

If sorted is false, sort the points by their x, y and z components.

Definition at line 183 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::BBox ( const BBox< Vec3T > & )
default

## Member Function Documentation

template<typename Vec3T>
template<typename MapType >
 BBox openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyInverseMap ( const MapType & map ) const

Apply the inverse of a map to this bounding box.

template<typename Vec3T>
template<typename MapType >
 BBox openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyInverseMap ( const MapType & map ) const
inline

Definition at line 393 of file BBox.h.

template<typename Vec3T>
template<typename MapType >
 BBox openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyMap ( const MapType & map ) const

Apply a map to this bounding box.

template<typename Vec3T>
template<typename MapType >
 BBox openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyMap ( const MapType & map ) const
inline

Definition at line 375 of file BBox.h.

template<typename Vec3T >
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::empty ( void ) const
inline

Return `true` if this bounding box is empty, i.e., it has no (positive) volume.

Definition at line 196 of file BBox.h.

template<typename Vec3T >
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::expand ( ElementType padding )
inline

Definition at line 321 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::expand ( const Vec3T & xyz )
inline

Expand this bounding box to enclose the given point.

Definition at line 333 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::expand ( const BBox< Vec3T > & b )
inline

Union this bounding box with the given bounding box.

Definition at line 344 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::expand ( const Vec3T & xyzMin, const ElementType & length )
inline

Union this bounding box with the cubical bounding box with minimum point xyzMin and the given edge length.

Note
Inclusive for integral ElementTypes

Definition at line 354 of file BBox.h.

template<typename Vec3T >
 Vec3T openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::extents ( ) const
inline

Return the extents of this bounding box, i.e., the length along each axis.

Note
Inclusive for integral ElementTypes

Definition at line 253 of file BBox.h.

template<typename Vec3T >
 Vec3d openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::getCenter ( ) const
inline

Return the center point of this bounding box.

Definition at line 245 of file BBox.h.

template<typename Vec3T >
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::hasOverlap ( const BBox< Vec3T > & b ) const
inline

Return `true` if the given bounding box overlaps with this bounding box.

Definition at line 301 of file BBox.h.

template<typename Vec3T>
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::hasVolume ( ) const
inline

Return `true` if this bounding box has (positive) volume.

Definition at line 78 of file BBox.h.

template<typename Vec3T>
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::intersects ( const BBox< Vec3T > & other ) const
inline

Return `true` if the given bounding box overlaps with this bounding box.

Definition at line 109 of file BBox.h.

template<typename Vec3T>
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::isInside ( const Vec3T & xyz ) const
inline

Return `true` if the given point is inside this bounding box.

Definition at line 267 of file BBox.h.

template<typename Vec3T>
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::isInside ( const BBox< Vec3T > & b ) const
inline

Return `true` if the given bounding box is inside this bounding box.

Definition at line 284 of file BBox.h.

template<typename Vec3T >
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::isSorted ( ) const
inline

Return `true` if all components of the minimum point are less than or equal to the corresponding components of the maximum point.

This is equivalent to testing whether this bounding box has nonnegative volume.

Note
For floating-point ElementTypes a tolerance is used for this test.

Definition at line 232 of file BBox.h.

template<typename Vec3T>
 const Vec3T& openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::max ( ) const
inline

Return a const reference to the maximum point of this bounding box.

Definition at line 64 of file BBox.h.

template<typename Vec3T>
 Vec3T& openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::max ( )
inline

Return a non-const reference to the maximum point of this bounding box.

Definition at line 68 of file BBox.h.

template<typename Vec3T>
 size_t openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::maxExtent ( ) const
inline

Return the index (0, 1 or 2) of the longest axis.

Definition at line 95 of file BBox.h.

template<typename Vec3T>
 const Vec3T& openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::min ( ) const
inline

Return a const reference to the minimum point of this bounding box.

Definition at line 62 of file BBox.h.

template<typename Vec3T>
 Vec3T& openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::min ( )
inline

Return a non-const reference to the minimum point of this bounding box.

Definition at line 66 of file BBox.h.

template<typename Vec3T>
 size_t openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::minExtent ( ) const
inline

Return the index (0, 1 or 2) of the shortest axis.

Definition at line 97 of file BBox.h.

template<typename Vec3T>
 openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::operator bool ( ) const
inline

Return `true` if this bounding box has (positive) volume.

Definition at line 80 of file BBox.h.

template<typename Vec3T>
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::operator!= ( const BBox< Vec3T > & rhs ) const
inline

Return `true` if this bounding box differs from the given bounding box.

Definition at line 73 of file BBox.h.

template<typename Vec3T>
 BBox& openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::operator= ( const BBox< Vec3T > & )
default
template<typename Vec3T >
 bool openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::operator== ( const BBox< Vec3T > & rhs ) const
inline

Return `true` if this bounding box is identical to the given bounding box.

Definition at line 208 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::read ( std::istream & is )
inline

Unserialize this bounding box from the given stream.

Definition at line 134 of file BBox.h.

template<typename Vec3T >
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::sort ( )
inline

Sort the mininum and maximum points of this bounding box by their x, y and z components.

Definition at line 220 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::translate ( const Vec3T & t )
inline

Translate this bounding box by (tx, ty, tz).

Definition at line 366 of file BBox.h.

template<typename Vec3T>
 ElementType openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::volume ( ) const
inline

Return the volume enclosed by this bounding box.

Definition at line 100 of file BBox.h.

template<typename Vec3T>
 void openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::write ( std::ostream & os ) const
inline

Serialize this bounding box to the given stream.

Definition at line 136 of file BBox.h.

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