HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 > Class Template Reference

Template specialization of NodeMask for Log2Dim=2, i.e. 4^3 nodes. More...

#include <NodeMasks.h>

Public Types

using Word = Index64
 
using OnIterator = OnMaskIterator< NodeMask >
 
using OffIterator = OffMaskIterator< NodeMask >
 
using DenseIterator = DenseMaskIterator< NodeMask >
 

Public Member Functions

 NodeMask ()
 Default constructor sets all bits off. More...
 
 NodeMask (bool on)
 All bits are set to the specified state. More...
 
 NodeMask (const NodeMask &other)
 Copy constructor. More...
 
 ~NodeMask ()
 Destructor. More...
 
void operator= (const NodeMask &other)
 Assignment operator. More...
 
OnIterator beginOn () const
 
OnIterator endOn () const
 
OffIterator beginOff () const
 
OffIterator endOff () const
 
DenseIterator beginDense () const
 
DenseIterator endDense () const
 
bool operator== (const NodeMask &other) const
 
bool operator!= (const NodeMask &other) const
 
template<typename WordOp >
const NodeMaskforeach (const NodeMask &other, const WordOp &op)
 Apply a functor to the words of the this and the other mask. More...
 
template<typename WordOp >
const NodeMaskforeach (const NodeMask &other1, const NodeMask &other2, const WordOp &op)
 
template<typename WordOp >
const NodeMaskforeach (const NodeMask &other1, const NodeMask &other2, const NodeMask &other3, const WordOp &op)
 
const NodeMaskoperator&= (const NodeMask &other)
 Bitwise intersection. More...
 
const NodeMaskoperator|= (const NodeMask &other)
 Bitwise union. More...
 
const NodeMaskoperator-= (const NodeMask &other)
 Bitwise difference. More...
 
const NodeMaskoperator^= (const NodeMask &other)
 Bitwise XOR. More...
 
NodeMask operator! () const
 
NodeMask operator& (const NodeMask &other) const
 
NodeMask operator| (const NodeMask &other) const
 
NodeMask operator^ (const NodeMask &other) const
 
Index32 countOn () const
 Return the total number of on bits. More...
 
Index32 countOff () const
 Return the total number of on bits. More...
 
void setOn (Index32 n)
 Set the nth bit on. More...
 
void setOff (Index32 n)
 Set the nth bit off. More...
 
void set (Index32 n, bool On)
 Set the nth bit to the specified state. More...
 
void set (bool on)
 Set all bits to the specified state. More...
 
void setOn ()
 Set all bits on. More...
 
void setOff ()
 Set all bits off. More...
 
void toggle (Index32 n)
 Toggle the state of the nth bit. More...
 
void toggle ()
 Toggle the state of all bits in the mask. More...
 
void setFirstOn ()
 Set the first bit on. More...
 
void setLastOn ()
 Set the last bit on. More...
 
void setFirstOff ()
 Set the first bit off. More...
 
void setLastOff ()
 Set the last bit off. More...
 
bool isOn (Index32 n) const
 Return true if the nth bit is on. More...
 
bool isOff (Index32 n) const
 Return true if the nth bit is off. More...
 
bool isOn () const
 Return true if all the bits are on. More...
 
bool isOff () const
 Return true if all the bits are off. More...
 
bool isConstant (bool &isOn) const
 
Index32 findFirstOn () const
 
Index32 findFirstOff () const
 
void save (std::ostream &os) const
 
void load (std::istream &is)
 
void seek (std::istream &is) const
 
void printInfo (std::ostream &os=std::cout) const
 simple print method for debugging More...
 
void printBits (std::ostream &os=std::cout) const
 
void printAll (std::ostream &os=std::cout) const
 
Index32 findNextOn (Index32 start) const
 
Index32 findNextOff (Index32 start) const
 
template<typename WordT >
WordT getWord (Index n) const
 Return the nth word of the bit mask, for a word of arbitrary size. More...
 
template<typename WordT >
WordT & getWord (Index n)
 Return the nth word of the bit mask, for a word of arbitrary size. More...
 

Static Public Member Functions

static Index32 memUsage ()
 Return the byte size of this NodeMask. More...
 

Static Public Attributes

static const Index32 LOG2DIM = 2
 
static const Index32 DIM = 4
 
static const Index32 SIZE = 64
 
static const Index32 WORD_COUNT = 1
 

Detailed Description

template<>
class openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >

Template specialization of NodeMask for Log2Dim=2, i.e. 4^3 nodes.

Definition at line 845 of file NodeMasks.h.

Member Typedef Documentation

Definition at line 853 of file NodeMasks.h.

Constructor & Destructor Documentation

Default constructor sets all bits off.

Definition at line 861 of file NodeMasks.h.

All bits are set to the specified state.

Definition at line 863 of file NodeMasks.h.

Copy constructor.

Definition at line 865 of file NodeMasks.h.

Destructor.

Definition at line 867 of file NodeMasks.h.

Member Function Documentation

Definition at line 879 of file NodeMasks.h.

Definition at line 877 of file NodeMasks.h.

Definition at line 875 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::countOff ( ) const
inline

Return the total number of on bits.

Definition at line 948 of file NodeMasks.h.

Return the total number of on bits.

Definition at line 946 of file NodeMasks.h.

Definition at line 880 of file NodeMasks.h.

Definition at line 878 of file NodeMasks.h.

Definition at line 876 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::findFirstOff ( ) const
inline

Definition at line 1002 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::findFirstOn ( ) const
inline

Definition at line 1001 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::findNextOff ( Index32  start) const
inline

Definition at line 1052 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::findNextOn ( Index32  start) const
inline

Definition at line 1045 of file NodeMasks.h.

template<typename WordOp >
const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::foreach ( const NodeMask< 2 > &  other,
const WordOp &  op 
)
inline

Apply a functor to the words of the this and the other mask.

An example that implements the "operator&=" method:

struct Op { inline void operator()(Word &w1, const Word& w2) const { w1 &= w2; } };

Definition at line 897 of file NodeMasks.h.

template<typename WordOp >
const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::foreach ( const NodeMask< 2 > &  other1,
const NodeMask< 2 > &  other2,
const WordOp &  op 
)
inline

Definition at line 903 of file NodeMasks.h.

template<typename WordOp >
const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::foreach ( const NodeMask< 2 > &  other1,
const NodeMask< 2 > &  other2,
const NodeMask< 2 > &  other3,
const WordOp &  op 
)
inline

Definition at line 909 of file NodeMasks.h.

template<typename WordT >
WordT openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::getWord ( Index  n) const
inline

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

Definition at line 1010 of file NodeMasks.h.

template<typename WordT >
WordT& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::getWord ( Index  n)
inline

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

Definition at line 1016 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::isConstant ( bool &  isOn) const
inline

Return true if bits are either all off OR all on.

Parameters
isOnTakes on the values of all bits if the method returns true - else it is undefined.

Definition at line 997 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::isOff ( Index32  n) const
inline

Return true if the nth bit is off.

Definition at line 989 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::isOff ( ) const
inline

Return true if all the bits are off.

Definition at line 993 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::isOn ( Index32  n) const
inline

Return true if the nth bit is on.

Definition at line 983 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::isOn ( ) const
inline

Return true if all the bits are on.

Definition at line 991 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::load ( std::istream &  is)
inline

Definition at line 1023 of file NodeMasks.h.

static Index32 openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::memUsage ( )
inlinestatic

Return the byte size of this NodeMask.

Definition at line 944 of file NodeMasks.h.

NodeMask openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator! ( void  ) const
inline

Definition at line 939 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator!= ( const NodeMask< 2 > &  other) const
inline

Definition at line 884 of file NodeMasks.h.

NodeMask openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator& ( const NodeMask< 2 > &  other) const
inline

Definition at line 940 of file NodeMasks.h.

const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator&= ( const NodeMask< 2 > &  other)
inline

Bitwise intersection.

Definition at line 916 of file NodeMasks.h.

const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator-= ( const NodeMask< 2 > &  other)
inline

Bitwise difference.

Definition at line 928 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator= ( const NodeMask< 2 > &  other)
inline

Assignment operator.

Definition at line 869 of file NodeMasks.h.

bool openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator== ( const NodeMask< 2 > &  other) const
inline

Definition at line 882 of file NodeMasks.h.

NodeMask openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator^ ( const NodeMask< 2 > &  other) const
inline

Definition at line 942 of file NodeMasks.h.

const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator^= ( const NodeMask< 2 > &  other)
inline

Bitwise XOR.

Definition at line 934 of file NodeMasks.h.

NodeMask openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator| ( const NodeMask< 2 > &  other) const
inline

Definition at line 941 of file NodeMasks.h.

const NodeMask& openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::operator|= ( const NodeMask< 2 > &  other)
inline

Bitwise union.

Definition at line 922 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::printAll ( std::ostream &  os = std::cout) const
inline

Definition at line 1039 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::printBits ( std::ostream &  os = std::cout) const
inline

Definition at line 1030 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::printInfo ( std::ostream &  os = std::cout) const
inline

simple print method for debugging

Definition at line 1026 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::save ( std::ostream &  os) const
inline

Definition at line 1022 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::seek ( std::istream &  is) const
inline

Definition at line 1024 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::set ( Index32  n,
bool  On 
)
inline

Set the nth bit to the specified state.

Definition at line 960 of file NodeMasks.h.

void openvdb::OPENVDB_VERSION_NAME::util::NodeMask< 2 >::set ( bool  on)
inline

Set all bits to the specified state.

Definition at line 962 of file NodeMasks.h.

Set the first bit off.

Definition at line 979 of file NodeMasks.h.

Set the first bit on.

Definition at line 975 of file NodeMasks.h.

Set the last bit off.

Definition at line 981 of file NodeMasks.h.

Set the last bit on.

Definition at line 977 of file NodeMasks.h.

Set the nth bit off.

Definition at line 955 of file NodeMasks.h.

Set all bits off.

Definition at line 966 of file NodeMasks.h.

Set the nth bit on.

Definition at line 950 of file NodeMasks.h.

Set all bits on.

Definition at line 964 of file NodeMasks.h.

Toggle the state of the nth bit.

Definition at line 968 of file NodeMasks.h.

Toggle the state of all bits in the mask.

Definition at line 973 of file NodeMasks.h.

Member Data Documentation

Definition at line 850 of file NodeMasks.h.

Definition at line 849 of file NodeMasks.h.

Definition at line 851 of file NodeMasks.h.

Definition at line 852 of file NodeMasks.h.


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