HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::math::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 Coordmin () const
 
const Coordmax () const
 
Coordmin ()
 
Coordmax ()
 
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 $(t_x, t_y, t_z)$. 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...
 
CoordBBoxoperator<<= (size_t n)
 Bit-wise operations performed on both the min and max members. More...
 
CoordBBoxoperator>>= (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...
 
CoordBBoxoperator&= (Coord::Int32 n)
 Bit-wise operations performed on both the min and max members. More...
 
CoordBBoxoperator|= (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.

Definition at line 266 of file Coord.h.

Member Typedef Documentation

Definition at line 269 of file Coord.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::CoordBBox ( )
inline

The default constructor produces an empty bounding box.

Definition at line 312 of file Coord.h.

openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::CoordBBox ( const Coord min,
const Coord max 
)
inline

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

Definition at line 314 of file Coord.h.

openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::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.

Definition at line 316 of file Coord.h.

openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::CoordBBox ( CoordBBox other,
const tbb::split &   
)
inline

Splitting constructor for use in TBB ranges.

Note
The other bounding box is assumed to be divisible.

Definition at line 323 of file Coord.h.

Member Function Documentation

static CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::createCube ( const Coord min,
ValueType  dim 
)
inlinestatic

Definition at line 331 of file Coord.h.

Coord openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::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).

Definition at line 370 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::empty ( void  ) const
inline

Definition at line 357 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::expand ( ValueType  padding)
inline

Pad this bounding box with the specified padding.

Definition at line 408 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::expand ( const Coord xyz)
inline

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

Definition at line 421 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::expand ( const CoordBBox bbox)
inline

Union this bounding box with the given bounding box.

Definition at line 428 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::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.

Definition at line 441 of file Coord.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::expandBy ( ValueType  padding) const
inline

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

Definition at line 415 of file Coord.h.

Coord openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::extents ( ) const
inline
Todo:
deprecate - use dim instead

Definition at line 372 of file Coord.h.

Vec3d openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::getCenter ( ) const
inline

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

Definition at line 365 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::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!

Definition at line 453 of file Coord.h.

Coord openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::getEnd ( void  ) const
inline
Note
The end coordinate is exclusive.

Definition at line 352 of file Coord.h.

Coord openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::getStart ( ) const
inline
Note
The start coordinate is inclusive.

Definition at line 350 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::hasOverlap ( const CoordBBox b) const
inline

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

Definition at line 402 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::hasVolume ( ) const
inline

Return true if this bounding box is nonempty.

Definition at line 361 of file Coord.h.

static CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::inf ( )
inlinestatic

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

Definition at line 337 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::intersect ( const CoordBBox bbox)
inline

Intersect this bounding box with the given bounding box.

Definition at line 434 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::is_divisible ( ) const
inline

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

Definition at line 381 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::isInside ( const Coord xyz) const
inline

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

Definition at line 390 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::isInside ( const CoordBBox b) const
inline

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

Definition at line 396 of file Coord.h.

const Coord& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::max ( ) const
inline

Definition at line 340 of file Coord.h.

Coord& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::max ( )
inline

Definition at line 343 of file Coord.h.

size_t openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::maxExtent ( ) const
inline

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

Definition at line 387 of file Coord.h.

const Coord& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::min ( ) const
inline

Definition at line 339 of file Coord.h.

Coord& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::min ( )
inline

Definition at line 342 of file Coord.h.

size_t openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::minExtent ( ) const
inline

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

Definition at line 384 of file Coord.h.

openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator bool ( ) const
inline

Return true if this bounding box is nonempty.

Definition at line 360 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator!= ( const CoordBBox rhs) const
inline

Definition at line 355 of file Coord.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator& ( Coord::Int32  n) const
inline

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

Definition at line 472 of file Coord.h.

CoordBBox& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator&= ( Coord::Int32  n)
inline

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

Definition at line 474 of file Coord.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator<< ( size_t  n) const
inline

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

Definition at line 469 of file Coord.h.

CoordBBox& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator<<= ( size_t  n)
inline

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

Definition at line 470 of file Coord.h.

bool openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator== ( const CoordBBox rhs) const
inline

Definition at line 354 of file Coord.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator>> ( size_t  n) const
inline

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

Definition at line 468 of file Coord.h.

CoordBBox& openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator>>= ( size_t  n)
inline

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

Definition at line 471 of file Coord.h.

CoordBBox openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::operator| ( Coord::Int32  n) const
inline

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

Definition at line 473 of file Coord.h.

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

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

Definition at line 475 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::read ( std::istream &  is)
inline

Unserialize this bounding box from the given stream.

Definition at line 479 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::reset ( void  )
inline

Definition at line 345 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::reset ( const Coord min,
const Coord max 
)
inline

Definition at line 346 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::resetToCube ( const Coord min,
ValueType  dim 
)
inline

Definition at line 347 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::translate ( const Coord t)
inline

Translate this bounding box by $(t_x, t_y, t_z)$.

Definition at line 447 of file Coord.h.

Index64 openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::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.

Definition at line 375 of file Coord.h.

void openvdb::OPENVDB_VERSION_NAME::math::CoordBBox::write ( std::ostream &  os) const
inline

Serialize this bounding box to the given stream.

Definition at line 481 of file Coord.h.


The documentation for this class was generated from the following file: