OpenVDB  2.1.0
Public Types | Public Member Functions | List of all members
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 &other)
 Copy constructor. 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::v2_1_0::math::BBox< Vec3T >

Axis-aligned bounding box.

Member Typedef Documentation

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

Constructor & Destructor Documentation

BBox ( )
inline

Default constructor creates an invalid BBox.

BBox ( const Vec3T &  xyzMin,
const Vec3T &  xyzMax 
)
inline

Constructor based on a minimum and maximum point.

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.

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

BBox ( const BBox< Vec3T > &  other)
inline

Copy constructor.

Member Function Documentation

BBox applyInverseMap ( const MapType &  map) const

Apply the inverse of a map to this bounding box.

BBox<Vec3T> applyInverseMap ( const MapType &  map) const
inline
BBox applyMap ( const MapType &  map) const

Apply a map to this bounding box.

BBox<Vec3T> applyMap ( const MapType &  map) const
inline
bool empty ( ) const
inline

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

void expand ( ElementType  padding)
inline

Pad this bounding box.

void expand ( const Vec3T &  xyz)
inline

Expand this bounding box to enclose point (x, y, z).

void expand ( const BBox< Vec3T > &  b)
inline

Union this bounding box with the given bounding box.

void expand ( const Vec3T &  xyzMin,
const ElementType length 
)
inline
Note
inclusive for integral ElementTypes
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
Vec3d getCenter ( ) const
inline

Return the center point of the BBox.

bool hasOverlap ( const BBox< Vec3T > &  b) const
inline

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

bool hasVolume ( ) const
inline

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

bool isInside ( const Vec3T &  xyz) const
inline

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

bool isInside ( const BBox< Vec3T > &  b) const
inline

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

bool 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.
const Vec3T& max ( ) const
inline

Return a const reference to the maximum point of the BBox.

Vec3T& max ( )
inline

Return a non-const reference to the maximum point of the BBox.

size_t maxExtent ( ) const
inline

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

const Vec3T& min ( ) const
inline

Return a const reference to the minimum point of the BBox.

Vec3T& min ( )
inline

Return a non-const reference to the minimum point of the BBox.

size_t minExtent ( ) const
inline

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

operator bool ( ) const
inline

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

bool operator!= ( const BBox< Vec3T > &  rhs) const
inline

Return true if the two BBox'es are not identical.

bool operator== ( const BBox< Vec3T > &  rhs) const
inline

Return true if the two BBox'es are identical.

void read ( std::istream &  is)
inline

Unserialize this bounding box from the given stream.

void sort ( )
inline

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

void translate ( const Vec3T &  t)
inline

Translate this bounding box by $(t_x, t_y, t_z)$.

ElementType volume ( ) const
inline

Return the volume spanned by this BBox.

void write ( std::ostream &  os) const
inline

Serialize this bounding box to the given stream.


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