HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T > Class Template Reference

Axis-aligned bounding box. More...

#include <BBox.h>

Public Types

typedef Vec3T Vec3Type
 
typedef Vec3T ValueType
 
typedef Vec3T VectorType
 
typedef Vec3Type::ValueType ElementType
 

Public Member Functions

 BBox ()
 Default constructor creates an invalid BBox. More...
 
 BBox (const Vec3T &xyzMin, const Vec3T &xyzMax)
 Constructor based on a minimum and maximum point. More...
 
 BBox (const Vec3T &xyzMin, const Vec3T &xyzMax, bool sorted)
 Constructor based on a minimum and maximum point. If sorted is false the points will be sorted by x,y,z component. More...
 
 BBox (const Vec3T &xyzMin, const ElementType &length)
 Contruct a cubical BBox from a minimum coordinate and a single edge length. More...
 
 BBox (const ElementType *xyz, bool sorted=true)
 Constructor based on a raw array of six points. If sorted is false the points will be sorted by x,y,z component. More...
 
 BBox (const BBox &)=default
 Copy constructor. More...
 
BBoxoperator= (const BBox &)=default
 Assignment operator. More...
 
void sort ()
 Sort the min/max by x,y,z component. More...
 
const Vec3T & min () const
 Return a const reference to the minimum point of the BBox. More...
 
const Vec3T & max () const
 Return a const reference to the maximum point of the BBox. More...
 
Vec3T & min ()
 Return a non-const reference to the minimum point of the BBox. More...
 
Vec3T & max ()
 Return a non-const reference to the maximum point of the BBox. More...
 
bool operator== (const BBox &rhs) const
 Return true if the two BBox'es are identical. More...
 
bool operator!= (const BBox &rhs) const
 Return true if the two BBox'es are not identical. More...
 
bool empty () const
 Return true if the BBox is empty, i.e. has no (positive) volume. More...
 
bool hasVolume () const
 Return true if the BBox has a (positive) volume. More...
 
 operator bool () const
 Return true if the BBox is valid, i.e. as a (positive) volume. More...
 
bool isSorted () const
 Return true if the all components of mMin <= mMax, i.e. the volume is not negative. More...
 
Vec3d getCenter () const
 Return the center point of the BBox. More...
 
Vec3T extents () const
 Returns the extents of the BBox, i.e. the length per axis for floating points values or number of grids per axis points integral values. More...
 
ElementType volume () const
 Return the volume spanned by this BBox. 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...
 
bool isInside (const Vec3T &xyz) const
 Return true if point (x, y, z) 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...
 
void expand (ElementType padding)
 Pad this bounding box. More...
 
void expand (const Vec3T &xyz)
 Expand this bounding box to enclose point (x, y, z). More...
 
void expand (const BBox &)
 Union this bounding box with the given bounding box. More...
 
void expand (const Vec3T &xyzMin, const ElementType &length)
 
void translate (const Vec3T &t)
 Translate this bounding box by $(t_x, t_y, t_z)$. 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...
 
void read (std::istream &is)
 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 47 of file BBox.h.

Member Typedef Documentation

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

Definition at line 53 of file BBox.h.

template<typename Vec3T>
typedef Vec3T openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::ValueType

Definition at line 51 of file BBox.h.

template<typename Vec3T>
typedef Vec3T openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::Vec3Type

Definition at line 50 of file BBox.h.

template<typename Vec3T>
typedef Vec3T openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::VectorType

Definition at line 52 of file BBox.h.

Constructor & Destructor Documentation

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

Default constructor creates an invalid BBox.

Definition at line 183 of file BBox.h.

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

Constructor based on a minimum and maximum point.

Definition at line 191 of file BBox.h.

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

Constructor based on a minimum and maximum point. If sorted is false the points will be sorted by x,y,z component.

Definition at line 198 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 BBox from a minimum coordinate and a single edge length.

Note
inclusive for integral ElementTypes

Definition at line 206 of file BBox.h.

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

Constructor based on a raw array of six points. If sorted is false the points will be sorted by x,y,z component.

Definition at line 218 of file BBox.h.

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

Copy constructor.

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<Vec3T> openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyInverseMap ( const MapType &  map) const
inline

Definition at line 428 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<Vec3T> openvdb::OPENVDB_VERSION_NAME::math::BBox< Vec3T >::applyMap ( const MapType &  map) const
inline

Definition at line 410 of file BBox.h.

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

Return true if the BBox is empty, i.e. has no (positive) volume.

Definition at line 231 of file BBox.h.

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

Pad this bounding box.

Definition at line 356 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 point (x, y, z).

Definition at line 368 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 379 of file BBox.h.

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

Definition at line 389 of file BBox.h.

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

Returns the extents of the BBox, i.e. the length per axis for floating points values or number of grids per axis points integral values.

Note
inclusive for integral ElementTypes

Definition at line 288 of file BBox.h.

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

Return the center point of the BBox.

Definition at line 280 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 336 of file BBox.h.

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

Return true if the BBox has a (positive) volume.

Definition at line 106 of file BBox.h.

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

Return true if point (x, y, z) is inside this bounding box.

Definition at line 302 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 319 of file BBox.h.

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

Return true if the all components of mMin <= mMax, i.e. the volume is not negative.

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

Definition at line 267 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 the BBox.

Definition at line 87 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 the BBox.

Definition at line 93 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 129 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 the BBox.

Definition at line 84 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 the BBox.

Definition at line 90 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 132 of file BBox.h.

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

Return true if the BBox is valid, i.e. as a (positive) volume.

Definition at line 109 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 the two BBox'es are not identical.

Definition at line 99 of file BBox.h.

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

Assignment operator.

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

Return true if the two BBox'es are identical.

Definition at line 243 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 168 of file BBox.h.

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

Sort the min/max by x,y,z component.

Definition at line 255 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 $(t_x, t_y, t_z)$.

Definition at line 401 of file BBox.h.

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

Return the volume spanned by this BBox.

Definition at line 126 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 171 of file BBox.h.


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