OpenVDB  1.1.0
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 Coord::ValueType ValueType

Public Member Functions

 CoordBBox ()
 CoordBBox (const Coord &min, const Coord &max)
const Coordmin () const
const Coordmax () const
Coordmin ()
Coordmax ()
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
 operator bool () const
bool hasVolume () const
 Return true if this bbox is not empty.
ValueType volume () const
 Return the integer volume of coordinates spanned by this bbox.
Vec3d getCenter () const
 Return the floating-point position of the center of this bbox.
Coord dim () const
 Return the dimensions of the coordinates spanned by this bbox.
Coord extents () const
size_t maxExtent () const
 Return the index (0, 1 or 2) of the longest axis.
bool isInside (const Coord &xyz) const
 Return true if point (x, y, z) is inside this bounding box.
bool isInside (const CoordBBox &b) const
 Return true if the given bounding box is inside this bounding box.
bool hasOverlap (const CoordBBox &b) const
 Return true if the given bounding box overlaps with this bounding box.
void expand (ValueType padding)
 Pad this bounding box with the specified padding.
void expand (const Coord &xyz)
 Expand this bounding box to enclose point (x, y, z).
void expand (const CoordBBox &bbox)
 Union this bounding box with the given bounding box.
void expand (const Coord &min, Coord::ValueType dim)
void translate (const Coord &t)
 Translate this bounding box by $(t_x, t_y, t_z)$.
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.

Static Public Member Functions

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

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

Constructor & Destructor Documentation

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

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

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
Coord extents ( ) const
inline
Vec3d getCenter ( ) const
inline

Return the floating-point position of the center of this bbox.

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 bbox is not empty.

static const CoordBBox& inf ( )
inlinestatic
Returns
an infinite bounding box defined from the value range of Coord
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
operator bool ( ) const
inline
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 ( 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 $(t_x, t_y, t_z)$.

ValueType volume ( ) const
inline

Return the integer volume of coordinates spanned by this bbox.

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: