HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::Mask< LOG2DIM > Class Template Reference

Bit-mask to encode active states and facilitate sequential iterators and a fast codec for I/O compression. More...

#include <NanoVDB.h>

Classes

class  DenseIterator
 
class  Iterator
 

Public Types

using OnIterator = Iterator< true >
 
using OffIterator = Iterator< false >
 

Public Member Functions

__hostdev__ uint32_t countOn () const
 Return the total number of set bits in this Mask. More...
 
__hostdev__ uint32_t countOn (uint32_t i) const
 Return the number of lower set bits in mask up to but excluding the i'th bit. More...
 
__hostdev__ OnIterator beginOn () const
 
__hostdev__ OffIterator beginOff () const
 
__hostdev__ DenseIterator beginAll () const
 
__hostdev__ Mask ()
 Initialize all bits to zero. More...
 
__hostdev__ Mask (bool on)
 
__hostdev__ Mask (const Mask &other)
 Copy constructor. More...
 
__hostdev__ uint64_t * words ()
 Return a pointer to the list of words of the bit mask. More...
 
__hostdev__ const uint64_t * words () const
 
template<typename MaskT = Mask>
__hostdev__ enable_if<!is_same
< MaskT, Mask >::value, Mask & >
::type 
operator= (const MaskT &other)
 Assignment operator that works with openvdb::util::NodeMask. More...
 
__hostdev__ Maskoperator= (const Mask &other)
 
__hostdev__ bool operator== (const Mask &other) const
 
__hostdev__ bool operator!= (const Mask &other) const
 
__hostdev__ bool isOn (uint32_t n) const
 Return true if the given bit is set. More...
 
__hostdev__ bool isOff (uint32_t n) const
 Return true if the given bit is NOT set. More...
 
__hostdev__ bool isOn () const
 Return true if all the bits are set in this Mask. More...
 
__hostdev__ bool isOff () const
 Return true if none of the bits are set in this Mask. More...
 
__hostdev__ void setOn (uint32_t n)
 Set the specified bit on. More...
 
__hostdev__ void setOff (uint32_t n)
 Set the specified bit off. More...
 
__hostdev__ void set (uint32_t n, bool on)
 Set the specified bit on or off. More...
 
__hostdev__ void setOn ()
 Set all bits on. More...
 
__hostdev__ void setOff ()
 Set all bits off. More...
 
__hostdev__ void set (bool on)
 Set all bits off. More...
 
__hostdev__ void toggle ()
 brief Toggle the state of all bits in the mask More...
 
__hostdev__ void toggle (uint32_t n)
 
__hostdev__ Maskoperator&= (const Mask &other)
 Bitwise intersection. More...
 
__hostdev__ Maskoperator|= (const Mask &other)
 Bitwise union. More...
 
__hostdev__ Maskoperator-= (const Mask &other)
 Bitwise difference. More...
 
__hostdev__ Maskoperator^= (const Mask &other)
 Bitwise XOR. More...
 
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING
__hostdev__ uint32_t 
findFirst () const
 
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING
__hostdev__ uint32_t 
findNext (uint32_t start) const
 
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING
__hostdev__ uint32_t 
findPrev (uint32_t start) const
 

Static Public Member Functions

static __hostdev__ size_t memUsage ()
 Return the memory footprint in bytes of this Mask. More...
 
static __hostdev__ uint32_t bitCount ()
 Return the number of bits available in this Mask. More...
 
static __hostdev__ uint32_t wordCount ()
 Return the number of machine words used by this Mask. More...
 

Static Public Attributes

static constexpr uint32_t SIZE = 1U << (3 * LOG2DIM)
 
static constexpr uint32_t WORD_COUNT = SIZE >> 6
 

Detailed Description

template<uint32_t LOG2DIM>
class nanovdb::Mask< LOG2DIM >

Bit-mask to encode active states and facilitate sequential iterators and a fast codec for I/O compression.

Definition at line 2805 of file NanoVDB.h.

Member Typedef Documentation

template<uint32_t LOG2DIM>
using nanovdb::Mask< LOG2DIM >::OffIterator = Iterator<false>

Definition at line 2902 of file NanoVDB.h.

template<uint32_t LOG2DIM>
using nanovdb::Mask< LOG2DIM >::OnIterator = Iterator<true>

Definition at line 2901 of file NanoVDB.h.

Constructor & Destructor Documentation

template<uint32_t LOG2DIM>
__hostdev__ nanovdb::Mask< LOG2DIM >::Mask ( )
inline

Initialize all bits to zero.

Definition at line 2911 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ nanovdb::Mask< LOG2DIM >::Mask ( bool  on)
inline

Definition at line 2916 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ nanovdb::Mask< LOG2DIM >::Mask ( const Mask< LOG2DIM > &  other)
inline

Copy constructor.

Definition at line 2924 of file NanoVDB.h.

Member Function Documentation

template<uint32_t LOG2DIM>
__hostdev__ DenseIterator nanovdb::Mask< LOG2DIM >::beginAll ( ) const
inline

Definition at line 2908 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ OffIterator nanovdb::Mask< LOG2DIM >::beginOff ( ) const
inline

Definition at line 2906 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ OnIterator nanovdb::Mask< LOG2DIM >::beginOn ( ) const
inline

Definition at line 2904 of file NanoVDB.h.

template<uint32_t LOG2DIM>
static __hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::bitCount ( )
inlinestatic

Return the number of bits available in this Mask.

Definition at line 2815 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::countOn ( ) const
inline

Return the total number of set bits in this Mask.

Definition at line 2821 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::countOn ( uint32_t  i) const
inline

Return the number of lower set bits in mask up to but excluding the i'th bit.

Definition at line 2830 of file NanoVDB.h.

template<uint32_t LOG2DIM>
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::findFirst ( ) const
inline

Definition at line 3089 of file NanoVDB.h.

template<uint32_t LOG2DIM>
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::findNext ( uint32_t  start) const
inline

Definition at line 3100 of file NanoVDB.h.

template<uint32_t LOG2DIM>
template<bool ON>
NANOVDB_HOSTDEV_DISABLE_WARNING __hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::findPrev ( uint32_t  start) const
inline

Definition at line 3117 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::isOff ( uint32_t  n) const
inline

Return true if the given bit is NOT set.

Definition at line 2968 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::isOff ( ) const
inline

Return true if none of the bits are set in this Mask.

Definition at line 2980 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::isOn ( uint32_t  n) const
inline

Return true if the given bit is set.

Definition at line 2965 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::isOn ( ) const
inline

Return true if all the bits are set in this Mask.

Definition at line 2971 of file NanoVDB.h.

template<uint32_t LOG2DIM>
static __hostdev__ size_t nanovdb::Mask< LOG2DIM >::memUsage ( )
inlinestatic

Return the memory footprint in bytes of this Mask.

Definition at line 2812 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::operator!= ( const Mask< LOG2DIM > &  other) const
inline

Definition at line 2962 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ Mask& nanovdb::Mask< LOG2DIM >::operator&= ( const Mask< LOG2DIM > &  other)
inline

Bitwise intersection.

Definition at line 3051 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ Mask& nanovdb::Mask< LOG2DIM >::operator-= ( const Mask< LOG2DIM > &  other)
inline

Bitwise difference.

Definition at line 3069 of file NanoVDB.h.

template<uint32_t LOG2DIM>
template<typename MaskT = Mask>
__hostdev__ enable_if<!is_same<MaskT, Mask>::value, Mask&>::type nanovdb::Mask< LOG2DIM >::operator= ( const MaskT &  other)
inline

Assignment operator that works with openvdb::util::NodeMask.

Definition at line 2936 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ Mask& nanovdb::Mask< LOG2DIM >::operator= ( const Mask< LOG2DIM > &  other)
inline

Definition at line 2947 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ bool nanovdb::Mask< LOG2DIM >::operator== ( const Mask< LOG2DIM > &  other) const
inline

Definition at line 2953 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ Mask& nanovdb::Mask< LOG2DIM >::operator^= ( const Mask< LOG2DIM > &  other)
inline

Bitwise XOR.

Definition at line 3078 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ Mask& nanovdb::Mask< LOG2DIM >::operator|= ( const Mask< LOG2DIM > &  other)
inline

Bitwise union.

Definition at line 3060 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::set ( uint32_t  n,
bool  on 
)
inline

Set the specified bit on or off.

Definition at line 3008 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::set ( bool  on)
inline

Set all bits off.

Definition at line 3035 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::setOff ( uint32_t  n)
inline

Set the specified bit off.

Definition at line 2991 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::setOff ( )
inline

Set all bits off.

Definition at line 3028 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::setOn ( uint32_t  n)
inline

Set the specified bit on.

Definition at line 2989 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::setOn ( )
inline

Set all bits on.

Definition at line 3021 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::toggle ( )
inline

brief Toggle the state of all bits in the mask

Definition at line 3042 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ void nanovdb::Mask< LOG2DIM >::toggle ( uint32_t  n)
inline

Definition at line 3048 of file NanoVDB.h.

template<uint32_t LOG2DIM>
static __hostdev__ uint32_t nanovdb::Mask< LOG2DIM >::wordCount ( )
inlinestatic

Return the number of machine words used by this Mask.

Definition at line 2818 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ uint64_t* nanovdb::Mask< LOG2DIM >::words ( )
inline

Return a pointer to the list of words of the bit mask.

Definition at line 2931 of file NanoVDB.h.

template<uint32_t LOG2DIM>
__hostdev__ const uint64_t* nanovdb::Mask< LOG2DIM >::words ( ) const
inline

Definition at line 2932 of file NanoVDB.h.

Member Data Documentation

template<uint32_t LOG2DIM>
constexpr uint32_t nanovdb::Mask< LOG2DIM >::SIZE = 1U << (3 * LOG2DIM)
static

Definition at line 2808 of file NanoVDB.h.

template<uint32_t LOG2DIM>
constexpr uint32_t nanovdb::Mask< LOG2DIM >::WORD_COUNT = SIZE >> 6
static

Definition at line 2809 of file NanoVDB.h.


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