Loading...
Searching...
No Matches
BBox< Vec3T > Class Template Reference

Axis-aligned bounding box. More...

`#include <openvdb/math/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.
| BBox (const Vec3T &xyzMin, const Vec3T &xyzMax)
| Construct a bounding box that exactly encloses the given minimum and maximum points.
| BBox (const Vec3T &xyzMin, const Vec3T &xyzMax, bool sorted)
| Construct a bounding box that exactly encloses the given minimum and maximum points.
| BBox (const Vec3T &xyzMin, const ElementType &length)
| Contruct a cubical bounding box from a minimum coordinate and an edge length.
| 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.
| BBox (const BBox &)=default
BBox & | operator= (const BBox &)=default
void | sort ()
| Sort the mininum and maximum points of this bounding box by their x, y and z components.
const Vec3T & | min () const
| Return a const reference to the minimum point of this bounding box.
const Vec3T & | max () const
| Return a const reference to the maximum point of this bounding box.
Vec3T & | min ()
| Return a non-const reference to the minimum point of this bounding box.
Vec3T & | max ()
| Return a non-const reference to the maximum point of this bounding box.
bool | operator== (const BBox &rhs) const
| Return `true` if this bounding box is identical to the given bounding box.
bool | operator!= (const BBox &rhs) const
| Return `true` if this bounding box differs from the given bounding box.
bool | empty () const
| Return `true` if this bounding box is empty, i.e., it has no (positive) volume.
bool | hasVolume () const
| Return `true` if this bounding box has (positive) volume.
| operator bool () const
| Return `true` if this bounding box has (positive) volume.
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.
Vec3d | getCenter () const
| Return the center point of this bounding box.
Vec3T | extents () const
| Return the extents of this bounding box, i.e., the length along each axis.
size_t | maxExtent () const
| Return the index (0, 1 or 2) of the longest axis.
size_t | minExtent () const
| Return the index (0, 1 or 2) of the shortest axis.
ElementType | volume () const
| Return the volume enclosed by this bounding box.
bool | isInside (const Vec3T &xyz) const
| Return `true` if the given point is inside this bounding box.
bool | isInside (const BBox &) const
| Return `true` if the given bounding box is inside this bounding box.
bool | hasOverlap (const BBox &) const
| Return `true` if the given bounding box overlaps with this bounding box.
bool | intersects (const BBox &other) const
| Return `true` if the given bounding box overlaps with this bounding box.
void | expand (ElementType padding)
| Pad this bounding box.
void | expand (const Vec3T &xyz)
| Expand this bounding box to enclose the given point.
void | expand (const BBox &)
| Union this bounding box with the given bounding box.
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.
void | translate (const Vec3T &t)
| Translate this bounding box by (tx, ty, tz).
template<typename MapType>
BBox | applyMap (const MapType &map) const
| Apply a map to this bounding box.
template<typename MapType>
BBox | applyInverseMap (const MapType &map) const
| Apply the inverse of a map to this bounding box.
void | read (std::istream &is)
| Unserialize this bounding box from the given stream.
void | write (std::ostream &os) const
| Serialize this bounding box to the given stream.
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::v10_0::math::BBox< Vec3T >

Axis-aligned bounding box.

## Member Typedef Documentation

## ElementType

template<typename Vec3T>

using ElementType = typename Vec3Type::ValueType

## ValueType

template<typename Vec3T>

using ValueType = Vec3T

## Vec3Type

template<typename Vec3T>

using Vec3Type = Vec3T

## VectorType

template<typename Vec3T>

using VectorType = Vec3T

## Constructor & Destructor Documentation

## BBox() [1/6]

template<typename Vec3T>

BBox | ( |  | ) |

inline

The default constructor creates an invalid bounding box.

## BBox() [2/6]

template<typename Vec3T>

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

inline

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

## BBox() [3/6]

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

## BBox() [4/6]

template<typename 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

## BBox() [5/6]

template<typename Vec3T>

BBox | ( | const ElementType * | xyz,
|  | bool | sorted = true )

inline explicit

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.

## BBox() [6/6]

template<typename Vec3T>

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

default

## Member Function Documentation

## applyInverseMap() [1/2]

template<typename Vec3T>
template<typename MapType>

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

inline

## applyInverseMap() [2/2]

template<typename Vec3T>
template<typename MapType>

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

Apply the inverse of a map to this bounding box.

## applyMap() [1/2]

template<typename Vec3T>
template<typename MapType>

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

inline

## applyMap() [2/2]

template<typename Vec3T>
template<typename MapType>

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

Apply a map to this bounding box.

## empty()

template<typename Vec3T>

bool empty | ( |  | ) | const

inline

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

## expand() [1/4]

template<typename Vec3T>

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

inline

Union this bounding box with the given bounding box.

## expand() [2/4]

template<typename Vec3T>

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

inline

Expand this bounding box to enclose the given point.

## expand() [3/4]

template<typename Vec3T>

void 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

## expand() [4/4]

template<typename Vec3T>

void expand | ( | ElementType | padding | ) |

inline

Pad this bounding box.

## extents()

template<typename Vec3T>

Vec3T extents | ( |  | ) | const

inline

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

Note
  Inclusive for integral ElementTypes

## getCenter()

template<typename Vec3T>

Vec3d getCenter | ( |  | ) | const

inline

Return the center point of this bounding box.

## hasOverlap()

template<typename Vec3T>

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

inline

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

## hasVolume()

template<typename Vec3T>

bool hasVolume | ( |  | ) | const

inline

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

## intersects()

template<typename Vec3T>

bool intersects | ( | const BBox< Vec3T > & | other | ) | const

inline

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

## isInside() [1/2]

template<typename Vec3T>

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

inline

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

## isInside() [2/2]

template<typename Vec3T>

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

inline

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

## isSorted()

template<typename Vec3T>

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

## max() [1/2]

template<typename Vec3T>

Vec3T & max | ( |  | ) |

inline

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

## max() [2/2]

template<typename Vec3T>

const Vec3T & max | ( |  | ) | const

inline

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

## maxExtent()

template<typename Vec3T>

size_t maxExtent | ( |  | ) | const

inline

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

## min() [1/2]

template<typename Vec3T>

Vec3T & min | ( |  | ) |

inline

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

## min() [2/2]

template<typename Vec3T>

const Vec3T & min | ( |  | ) | const

inline

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

## minExtent()

template<typename Vec3T>

size_t minExtent | ( |  | ) | const

inline

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

## operator bool()

template<typename Vec3T>

operator bool | ( |  | ) | const

inline

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

## operator!=()

template<typename Vec3T>

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

inline

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

## operator=()

template<typename Vec3T>

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

default

## operator==()

template<typename Vec3T>

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

inline

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

## read()

template<typename Vec3T>

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

inline

Unserialize this bounding box from the given stream.

## sort()

template<typename Vec3T>

void sort | ( |  | ) |

inline

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

## translate()

template<typename Vec3T>

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

inline

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

## volume()

template<typename Vec3T>

ElementType volume | ( |  | ) | const

inline

Return the volume enclosed by this bounding box.

## write()

template<typename Vec3T>

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

inline

Serialize this bounding box to the given stream.