OpenVDB: CoordBBox Class Reference

OpenVDB 3.2.0

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
CoordBBox Class Reference

Axis-aligned bounding box of signed integer coordinates. More...

`#include <Coord.h>`

## Classes
class | Iterator
| Iterator over Coord domain covered by a CoordBBox. More...

## Public Types
typedef uint64_t | Index64
typedef Coord::ValueType | ValueType

## Public Member Functions
| CoordBBox ()
| The default constructor produces an empty bounding box. More...
| CoordBBox (const Coord &min, const Coord &max)
| Construct a bounding box with the given min and max bounds. More...
| CoordBBox (ValueType x_min, ValueType y_min, ValueType z_min, ValueType x_max, ValueType y_max, ValueType z_max)
| Construct from individual components of the min and max bounds. More...
| CoordBBox (CoordBBox &other, const tbb::split &)
| Splitting constructor for use in TBB ranges. More...
const Coord & | min () const
const Coord & | max () const
Coord & | min ()
Coord & | max ()
void | reset ()
void | reset (const Coord &min, const Coord &max)
void | resetToCube (const Coord &min, ValueType dim)
Coord | getStart () const
Coord | getEnd () const
bool | operator== (const CoordBBox &rhs) const
bool | operator!= (const CoordBBox &rhs) const
bool | empty () const
Vec3d | getCenter () const
| Return the floating-point position of the center of this bounding box. More...
Coord | dim () const
| Return the dimensions of the coordinates spanned by this bounding box. More...
Coord | extents () const
Index64 | volume () const
| Return the integer volume of coordinates spanned by this bounding box. More...
bool | is_divisible () const
| Return `true` if this bounding box can be subdivided [mainly for use by TBB]. More...
size_t | minExtent () const
| Return the index (0, 1 or 2) of the shortest axis. More...
size_t | maxExtent () const
| Return the index (0, 1 or 2) of the longest axis. More...
bool | isInside (const Coord &xyz) const
| Return `true` if point (x, y, z) is inside this bounding box. More...
bool | isInside (const CoordBBox &b) const
| Return `true` if the given bounding box is inside this bounding box. More...
bool | hasOverlap (const CoordBBox &b) const
| Return `true` if the given bounding box overlaps with this bounding box. More...
void | expand (ValueType padding)
| Pad this bounding box with the specified padding. More...
CoordBBox | expandBy (ValueType padding) const
| Return a new instance that is expanded by the specified padding. More...
void | expand (const Coord &xyz)
| Expand this bounding box to enclose point (x, y, z). More...
void | expand (const CoordBBox &bbox)
| Union this bounding box with the given bounding box. More...
void | intersect (const CoordBBox &bbox)
| Intersect this bounding box with the given bounding box. More...
void | expand (const Coord &min, Coord::ValueType dim)
| Union this bounding box with the cubical bounding box of the given size and with the given minimum coordinates. More...
void | translate (const Coord &t)
| Translate this bounding box by . More...
void | getCornerPoints (Coord *p) const
| Populates an array with the eight corner points of 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...
| operator bool () const
| Return `true` if this bounding box is nonempty. More...
bool | hasVolume () const
| Return `true` if this bounding box is nonempty. More...
CoordBBox | operator>> (size_t n) const
| Bit-wise operations performed on both the min and max members. More...
CoordBBox | operator<< (size_t n) const
| Bit-wise operations performed on both the min and max members. More...
CoordBBox & | operator<<= (size_t n)
| Bit-wise operations performed on both the min and max members. More...
CoordBBox & | operator>>= (size_t n)
| Bit-wise operations performed on both the min and max members. More...
CoordBBox | operator & (Coord::Int32 n) const
| Bit-wise operations performed on both the min and max members. More...
CoordBBox | operator| (Coord::Int32 n) const
| Bit-wise operations performed on both the min and max members. More...
CoordBBox & | operator &= (Coord::Int32 n)
| Bit-wise operations performed on both the min and max members. More...
CoordBBox & | operator|= (Coord::Int32 n)
| Bit-wise operations performed on both the min and max members. More...

## Static Public Member Functions
static CoordBBox | createCube (const Coord &min, ValueType dim)
static CoordBBox | inf ()
| Return an "infinite" bounding box, as defined by the Coord value range. More...

## Detailed Description

Axis-aligned bounding box of signed integer coordinates.

Note
  The range of the integer coordinates, [min, max], is inclusive. Thus, a bounding box with min = max is not empty but rather encloses a single coordinate.

## Member Typedef Documentation

## ◆ Index64

typedef uint64_t Index64

## ◆ ValueType

typedef Coord::ValueType ValueType

## Constructor & Destructor Documentation

## ◆ CoordBBox() [1/4]

CoordBBox | ( |  | ) |
| inline

The default constructor produces an empty bounding box.

## ◆ CoordBBox() [2/4]

CoordBBox | ( | const Coord & | min,
|  | const Coord & | max
| ) |  |
| inline

Construct a bounding box with the given min and max bounds.

## ◆ CoordBBox() [3/4]

CoordBBox | ( | ValueType | x_min,
|  | ValueType | y_min,
|  | ValueType | z_min,
|  | ValueType | x_max,
|  | ValueType | y_max,
|  | ValueType | z_max
| ) |  |
| inline

Construct from individual components of the min and max bounds.

## ◆ CoordBBox() [4/4]

CoordBBox | ( | CoordBBox & | other,
|  | const tbb::split & |
| ) |  |
| inline

Splitting constructor for use in TBB ranges.

Note
  The other bounding box is assumed to be divisible.

## Member Function Documentation

## ◆ createCube()

static CoordBBox createCube | ( | const Coord & | min,
|  | ValueType | dim
| ) |  |
| inlinestatic

## ◆ dim()

Coord dim | ( |  | ) | const
| inline

Return the dimensions of the coordinates spanned by this bounding box.

Note
  Since coordinates are inclusive, a bounding box with min = max has dimensions of (1, 1, 1).

## ◆ empty()

bool empty | ( |  | ) | const
| inline

## ◆ expand() [1/4]

void expand | ( | ValueType | padding | ) |
| inline

Pad this bounding box with the specified padding.

## ◆ expand() [2/4]

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

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

## ◆ expand() [3/4]

void expand | ( | const CoordBBox & | bbox | ) |
| inline

Union this bounding box with the given bounding box.

## ◆ expand() [4/4]

void expand | ( | const Coord & | min,
|  | Coord::ValueType | dim
| ) |  |
| inline

Union this bounding box with the cubical bounding box of the given size and with the given minimum coordinates.

## ◆ expandBy()

CoordBBox expandBy | ( | ValueType | padding | ) | const
| inline

Return a new instance that is expanded by the specified padding.

## ◆ extents()

Coord extents | ( |  | ) | const
| inline

## ◆ getCenter()

Vec3d getCenter | ( |  | ) | const
| inline

Return the floating-point position of the center of this bounding box.

## ◆ getCornerPoints()

void getCornerPoints | ( | Coord * | p | ) | const
| inline

Populates an array with the eight corner points of this bounding box.

The ordering of the corner points is lexicographic.

Warning
  It is assumed that the pointer can be incremented at least seven times, i.e. has storage for eight Coord elements!

## ◆ getEnd()

Coord getEnd | ( |  | ) | const
| inline

Note
  The end coordinate is exclusive.

## ◆ getStart()

Coord getStart | ( |  | ) | const
| inline

Note
  The start coordinate is inclusive.

## ◆ hasOverlap()

bool hasOverlap | ( | const CoordBBox & | b | ) | const
| inline

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

## ◆ hasVolume()

bool hasVolume | ( |  | ) | const
| inline

Return `true` if this bounding box is nonempty.

## ◆ inf()

static CoordBBox inf | ( |  | ) |
| inlinestatic

Return an "infinite" bounding box, as defined by the Coord value range.

## ◆ intersect()

void intersect | ( | const CoordBBox & | bbox | ) |
| inline

Intersect this bounding box with the given bounding box.

## ◆ is_divisible()

bool is_divisible | ( |  | ) | const
| inline

Return `true` if this bounding box can be subdivided [mainly for use by TBB].

## ◆ isInside() [1/2]

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

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

## ◆ isInside() [2/2]

bool isInside | ( | const CoordBBox & | b | ) | const
| inline

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

## ◆ max() [1/2]

const Coord& max | ( |  | ) | const
| inline

## ◆ max() [2/2]

Coord& max | ( |  | ) |
| inline

## ◆ maxExtent()

size_t maxExtent | ( |  | ) | const
| inline

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

## ◆ min() [1/2]

const Coord& min | ( |  | ) | const
| inline

## ◆ min() [2/2]

Coord& min | ( |  | ) |
| inline

## ◆ minExtent()

size_t minExtent | ( |  | ) | const
| inline

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

## ◆ operator &()

CoordBBox operator& | ( | Coord::Int32 | n | ) | const
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator &=()

CoordBBox& operator&= | ( | Coord::Int32 | n | ) |
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator bool()

operator bool | ( |  | ) | const
| inline

Return `true` if this bounding box is nonempty.

## ◆ operator!=()

bool operator!= | ( | const CoordBBox & | rhs | ) | const
| inline

## ◆ operator<<()

CoordBBox operator<< | ( | size_t | n | ) | const
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator<<=()

CoordBBox& operator<<= | ( | size_t | n | ) |
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator==()

bool operator== | ( | const CoordBBox & | rhs | ) | const
| inline

## ◆ operator>>()

CoordBBox operator>> | ( | size_t | n | ) | const
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator>>=()

CoordBBox& operator>>= | ( | size_t | n | ) |
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator|()

CoordBBox operator| | ( | Coord::Int32 | n | ) | const
| inline

Bit-wise operations performed on both the min and max members.

## ◆ operator|=()

CoordBBox& operator|= | ( | Coord::Int32 | n | ) |
| inline

Bit-wise operations performed on both the min and max members.

## ◆ read()

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

Unserialize this bounding box from the given stream.

## ◆ reset() [1/2]

void reset | ( |  | ) |
| inline

## ◆ reset() [2/2]

void reset | ( | const Coord & | min,
|  | const Coord & | max
| ) |  |
| inline

## ◆ resetToCube()

void resetToCube | ( | const Coord & | min,
|  | ValueType | dim
| ) |  |
| inline

## ◆ translate()

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

Translate this bounding box by .

## ◆ volume()

Index64 volume | ( |  | ) | const
| inline

Return the integer volume of coordinates spanned by this bounding box.

Note
  Since coordinates are inclusive, a bounding box with min = max has volume one.

## ◆ 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:

- Coord.h