OpenVDB 13.1.0
Loading...
Searching...
No Matches
BBox< CoordT, false > Struct Template Reference

Partial template specialization for integer coordinate types. More...

#include <nanovdb/math/Math.h>

Classes

class  Iterator
 Iterator over the domain covered by a BBox. More...

Public Types

using BaseT = BaseBBox<CoordT>

Public Member Functions

__hostdev__ Iterator begin () const
__hostdev__ Iterator end () const
__hostdev__ BBox ()
__hostdev__ BBox (const CoordT &min, const CoordT &max)
template<typename SplitT>
__hostdev__ BBox (BBox &other, const SplitT &)
__hostdev__ bool is_divisible () const
__hostdev__ bool empty () const
 Return true if this bounding box is empty, e.g. uninitialized.
__hostdev__ operator bool () const
 Convert this BBox to boolean true if it is not empty.
__hostdev__ CoordT dim () const
__hostdev__ uint64_t volume () const
__hostdev__ bool isInside (const CoordT &p) const
__hostdev__ bool isInside (const BBox &b) const
 Return true if the given bounding box is inside this bounding box.
__hostdev__ bool hasOverlap (const BBox &b) const
 Return true if the given bounding box overlaps with this bounding box.
template<typename RealT = double>
__hostdev__ BBox< Vec3< RealT > > asReal () const
__hostdev__ BBox expandBy (typename CoordT::ValueType padding) const
 Return a new instance that is expanded by the specified padding.
template<typename Map>
__hostdev__ auto transform (const Map &map) const
 transform this coordinate bounding box by the specified map
__hostdev__ bool operator== (const BaseBBox &rhs) const
__hostdev__ bool operator!= (const BaseBBox &rhs) const
__hostdev__ const CoordT & operator[] (int i) const
__hostdev__ CoordT & operator[] (int i)
__hostdev__ CoordT & min ()
__hostdev__ const CoordT & min () const
__hostdev__ CoordT & max ()
__hostdev__ const CoordT & max () const
__hostdev__ BaseBBoxtranslate (const CoordT &xyz)
__hostdev__ BaseBBoxexpand (const CoordT &xyz)
 Expand this bounding box to enclose point xyz.
__hostdev__ BaseBBoxexpand (const BaseBBox &bbox)
 Expand this bounding box to enclose the given bounding box.
__hostdev__ BaseBBoxintersect (const BaseBBox &bbox)
 Intersect this bounding box with the given bounding box.
__hostdev__ bool isInside (const CoordT &xyz)

Static Public Member Functions

static __hostdev__ BBox createCube (const CoordT &min, typename CoordT::ValueType dim)
static __hostdev__ BBox createCube (typename CoordT::ValueType min, typename CoordT::ValueType max)

Public Attributes

CoordT mCoord [2]

Detailed Description

template<typename CoordT>
struct nanovdb::math::BBox< CoordT, false >

Partial template specialization for integer coordinate types.

Note
Both min and max are INCLUDED in the bbox so dim = max - min + 1. So, if min = max the bounding box contains exactly one point and dim = 1!

Member Typedef Documentation

◆ BaseT

template<typename CoordT>
using BaseT = BaseBBox<CoordT>

Constructor & Destructor Documentation

◆ BBox() [1/3]

template<typename CoordT>
__hostdev__ BBox ( )
inline

◆ BBox() [2/3]

template<typename CoordT>
__hostdev__ BBox ( const CoordT & min,
const CoordT & max )
inline

◆ BBox() [3/3]

template<typename CoordT>
template<typename SplitT>
__hostdev__ BBox ( BBox< CoordT, false > & other,
const SplitT &  )
inline

Member Function Documentation

◆ asReal()

template<typename CoordT>
template<typename RealT = double>
__hostdev__ BBox< Vec3< RealT > > asReal ( ) const
inline
Warning
This converts a CoordBBox into a floating-point bounding box which implies that max += 1 !

◆ begin()

template<typename CoordT>
__hostdev__ Iterator begin ( ) const
inline

◆ createCube() [1/2]

template<typename CoordT>
__hostdev__ BBox createCube ( const CoordT & min,
typename CoordT::ValueType dim )
inlinestatic

◆ createCube() [2/2]

template<typename CoordT>
__hostdev__ BBox createCube ( typename CoordT::ValueType min,
typename CoordT::ValueType max )
inlinestatic

◆ dim()

template<typename CoordT>
__hostdev__ CoordT dim ( ) const
inline

◆ empty()

template<typename CoordT>
__hostdev__ bool empty ( ) const
inline

Return true if this bounding box is empty, e.g. uninitialized.

◆ end()

template<typename CoordT>
__hostdev__ Iterator end ( ) const
inline

◆ expand() [1/2]

__hostdev__ BaseBBox & expand ( const BaseBBox< CoordT > & bbox)
inlineinherited

Expand this bounding box to enclose the given bounding box.

◆ expand() [2/2]

__hostdev__ BaseBBox & expand ( const CoordT & xyz)
inlineinherited

Expand this bounding box to enclose point xyz.

◆ expandBy()

template<typename CoordT>
__hostdev__ BBox expandBy ( typename CoordT::ValueType padding) const
inline

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

◆ hasOverlap()

template<typename CoordT>
__hostdev__ bool hasOverlap ( const BBox< CoordT, false > & b) const
inline

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

◆ intersect()

__hostdev__ BaseBBox & intersect ( const BaseBBox< CoordT > & bbox)
inlineinherited

Intersect this bounding box with the given bounding box.

◆ is_divisible()

template<typename CoordT>
__hostdev__ bool is_divisible ( ) const
inline

◆ isInside() [1/3]

__hostdev__ bool isInside ( const CoordT & xyz)
inlineinherited

◆ isInside() [2/3]

template<typename CoordT>
__hostdev__ bool isInside ( const BBox< CoordT, false > & b) const
inline

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

◆ isInside() [3/3]

template<typename CoordT>
__hostdev__ bool isInside ( const CoordT & p) const
inline

◆ max() [1/2]

__hostdev__ CoordT & max ( )
inlineinherited

◆ max() [2/2]

__hostdev__ const CoordT & max ( ) const
inlineinherited

◆ min() [1/2]

__hostdev__ CoordT & min ( )
inlineinherited

◆ min() [2/2]

__hostdev__ const CoordT & min ( ) const
inlineinherited

◆ operator bool()

template<typename CoordT>
__hostdev__ operator bool ( ) const
inline

Convert this BBox to boolean true if it is not empty.

◆ operator!=()

__hostdev__ bool operator!= ( const BaseBBox< CoordT > & rhs) const
inlineinherited

◆ operator==()

__hostdev__ bool operator== ( const BaseBBox< CoordT > & rhs) const
inlineinherited

◆ operator[]() [1/2]

__hostdev__ CoordT & operator[] ( int i)
inlineinherited

◆ operator[]() [2/2]

__hostdev__ const CoordT & operator[] ( int i) const
inlineinherited

◆ transform()

template<typename CoordT>
template<typename Map>
__hostdev__ auto transform ( const Map & map) const
inline

transform this coordinate bounding box by the specified map

Parameters
mapmapping of index to world coordinates
Returns
world bounding box

◆ translate()

__hostdev__ BaseBBox & translate ( const CoordT & xyz)
inlineinherited

◆ volume()

template<typename CoordT>
__hostdev__ uint64_t volume ( ) const
inline

Member Data Documentation

◆ mCoord

template<typename CoordT>
CoordT mCoord[2]