OpenVDB: BBox< Vec3T > Class Template Reference

OpenVDB 4.0.2

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 &)=default
| Copy constructor. More...
BBox & | operator= (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 . 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::v4_0_2::math::BBox< Vec3T >

Axis-aligned bounding box.

## Member Typedef Documentation

## ◆ ElementType

typedef Vec3Type::ValueType ElementType

## ◆ ValueType

typedef Vec3T ValueType

## ◆ Vec3Type

typedef Vec3T Vec3Type

## ◆ VectorType

typedef Vec3T VectorType

## Constructor & Destructor Documentation

## ◆ BBox() [1/6]

BBox | ( |  | ) |
| inline

Default constructor creates an invalid BBox.

## ◆ BBox() [2/6]

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

Constructor based on a minimum and maximum point.

## ◆ BBox() [3/6]

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() [4/6]

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 `ElementType`s

## ◆ BBox() [5/6]

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() [6/6]

BBox | ( | const BBox< Vec3T > & |  | ) |
| default

Copy constructor.

## Member Function Documentation

## ◆ applyInverseMap() [1/2]

BBox applyInverseMap | ( | const MapType & | map | ) | const

Apply the inverse of a map to this bounding box.

## ◆ applyInverseMap() [2/2]

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

## ◆ applyMap() [1/2]

BBox applyMap | ( | const MapType & | map | ) | const

Apply a map to this bounding box.

## ◆ applyMap() [2/2]

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

## ◆ empty()

bool empty | ( |  | ) | const
| inline

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

## ◆ expand() [1/4]

void expand | ( | ElementType | padding | ) |
| inline

Pad this bounding box.

## ◆ expand() [2/4]

void expand | ( | const Vec3T & | xyz | ) |
| inline

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

## ◆ expand() [3/4]

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

Union this bounding box with the given bounding box.

## ◆ expand() [4/4]

void expand | ( | const Vec3T & | xyzMin,
|  | const ElementType & | length
| ) |  |
| inline

Note
  inclusive for integral `ElementType`s

## ◆ extents()

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 `ElementType`s

## ◆ getCenter()

Vec3d getCenter | ( |  | ) | const
| inline

Return the center point of the BBox.

## ◆ hasOverlap()

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

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

## ◆ hasVolume()

bool hasVolume | ( |  | ) | const
| inline

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

## ◆ isInside() [1/2]

bool isInside | ( | const Vec3T & | xyz | ) | const
| inline

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

## ◆ isInside() [2/2]

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

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

## ◆ isSorted()

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.

## ◆ max() [1/2]

const Vec3T& max | ( |  | ) | const
| inline

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

## ◆ max() [2/2]

Vec3T& max | ( |  | ) |
| inline

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

## ◆ maxExtent()

size_t maxExtent | ( |  | ) | const
| inline

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

## ◆ min() [1/2]

const Vec3T& min | ( |  | ) | const
| inline

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

## ◆ min() [2/2]

Vec3T& min | ( |  | ) |
| inline

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

## ◆ minExtent()

size_t minExtent | ( |  | ) | const
| inline

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

## ◆ operator bool()

operator bool | ( |  | ) | const
| inline

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

## ◆ operator!=()

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

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

## ◆ operator=()

BBox& operator= | ( | const BBox< Vec3T > & |  | ) |
| default

Assignment operator.

## ◆ operator==()

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

Return true if the two BBox'es are identical.

## ◆ read()

void read | ( | std::istream & | is | ) |
| inline

Unserialize this bounding box from the given stream.

## ◆ sort()

void sort | ( |  | ) |
| inline

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

## ◆ translate()

void translate | ( | const Vec3T & | t | ) |
| inline

Translate this bounding box by .

## ◆ volume()

ElementType volume | ( |  | ) | const
| inline

Return the volume spanned by this BBox.

## ◆ write()

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:

- BBox.h