OpenVDB: CoordBBox Class Reference

OpenVDB 3.1.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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

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

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

typedef uint64_t Index64

typedef Coord::ValueType ValueType

## Constructor & Destructor Documentation

CoordBBox | ( |  | ) |
| inline

The default constructor produces an empty bounding box.

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

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

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

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

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

bool empty | ( |  | ) | const
| inline

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

Pad this bounding box with the specified padding.

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

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

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

Union this bounding box with the given bounding box.

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.

Coord extents | ( |  | ) | const
| inline

Vec3d getCenter | ( |  | ) | const
| inline

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

Coord getEnd | ( |  | ) | const
| inline

Note
  The end coordinate is exclusive.

Coord getStart | ( |  | ) | const
| inline

Note
  The start coordinate is inclusive.

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

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

bool hasVolume | ( |  | ) | const
| inline

Return `true` if this bounding box is nonempty.

static CoordBBox inf | ( |  | ) |
| inlinestatic

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

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

Intersect this bounding box with the given bounding box.

bool is_divisible | ( |  | ) | const
| inline

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

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

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

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

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

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

Coord& max | ( |  | ) |
| inline

size_t maxExtent | ( |  | ) | const
| inline

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

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

Coord& min | ( |  | ) |
| inline

size_t minExtent | ( |  | ) | const
| inline

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

operator bool | ( |  | ) | const
| inline

Return `true` if this bounding box is nonempty.

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

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

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

Unserialize this bounding box from the given stream.

void reset | ( |  | ) |
| inline

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

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

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

Translate this bounding box by .

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.

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