OpenVDB  9.0.1
Classes | Public Member Functions | Static Public Member Functions | List of all members
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/NanoVDB.h>

Classes

class  Iterator
 

Public Member Functions

uint32_t countOn () const
 
 Mask ()
 Initialize all bits to zero. More...
 
 Mask (bool on)
 
 Mask (const Mask &other)
 Copy constructor. More...
 
template<typename WordT >
WordT getWord (int n) const
 Return the nth word of the bit mask, for a word of arbitrary size. More...
 
template<typename MaskT >
Maskoperator= (const MaskT &other)
 Assignment operator that works with openvdb::util::NodeMask. More...
 
bool operator== (const Mask &other) const
 
bool operator!= (const Mask &other) const
 
Iterator beginOn () const
 
bool isOn (uint32_t n) const
 Return true if the given bit is set. More...
 
bool isOn () const
 
bool isOff () const
 
void setOn (uint32_t n)
 Set the given bit on. More...
 
void setOff (uint32_t n)
 
void set (uint32_t n, bool On)
 
void setOn ()
 Set all bits on. More...
 
void setOff ()
 Set all bits off. More...
 
void set (bool on)
 Set all bits off. More...
 
void toggle ()
 brief Toggle the state of all bits in the mask More...
 
void toggle (uint32_t n)
 

Static Public Member Functions

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

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.

Constructor & Destructor Documentation

Mask ( )
inline

Initialize all bits to zero.

Mask ( bool  on)
inline
Mask ( const Mask< LOG2DIM > &  other)
inline

Copy constructor.

Member Function Documentation

Iterator beginOn ( ) const
inline
static uint32_t bitCount ( )
inlinestatic

Return the number of bits available in this Mask.

uint32_t countOn ( ) const
inline
WordT getWord ( int  n) const
inline

Return the nth word of the bit mask, for a word of arbitrary size.

bool isOff ( ) const
inline
bool isOn ( uint32_t  n) const
inline

Return true if the given bit is set.

bool isOn ( ) const
inline
static size_t memUsage ( )
inlinestatic

Return the memory footprint in bytes of this Mask.

bool operator!= ( const Mask< LOG2DIM > &  other) const
inline
Mask& operator= ( const MaskT &  other)
inline

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

bool operator== ( const Mask< LOG2DIM > &  other) const
inline
void set ( uint32_t  n,
bool  On 
)
inline
void set ( bool  on)
inline

Set all bits off.

void setOff ( uint32_t  n)
inline
void setOff ( )
inline

Set all bits off.

void setOn ( uint32_t  n)
inline

Set the given bit on.

void setOn ( )
inline

Set all bits on.

void toggle ( )
inline

brief Toggle the state of all bits in the mask

void toggle ( uint32_t  n)
inline
static uint32_t wordCount ( )
inlinestatic

Return the number of machine words used by this Mask.