OpenVDB: NodeMask< 1 > Class Reference

OpenVDB 10.0.1

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
NodeMask< 1 > Class Reference

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

`#include <openvdb/util/NodeMasks.h>`

## Public Types
using | Word = Byte
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 NodeMask & | foreach (const NodeMask &other, const WordOp &op)
| Apply a functor to the words of the this and the other mask. More...
template<typename WordOp >
const NodeMask & | foreach (const NodeMask &other1, const NodeMask &other2, const WordOp &op)
template<typename WordOp >
const NodeMask & | foreach (const NodeMask &other1, const NodeMask &other2, const NodeMask &other3, const WordOp &op)
const NodeMask & | operator&= (const NodeMask &other)
| Bitwise intersection. More...
const NodeMask & | operator|= (const NodeMask &other)
| Bitwise union. More...
const NodeMask & | operator-= (const NodeMask &other)
| Bitwise difference. More...
const NodeMask & | operator^= (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

## Static Public Member Functions
static Index32 | memUsage ()
| Return the byte size of this NodeMask. More...

## Static Public Attributes
static const Index32 | LOG2DIM = 1
static const Index32 | DIM = 2
static const Index32 | SIZE = 8
static const Index32 | WORD_COUNT = 1

## Detailed Description

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

## Member Typedef Documentation

## ◆ DenseIterator

using DenseIterator = DenseMaskIterator<NodeMask>

## ◆ OffIterator

using OffIterator = OffMaskIterator<NodeMask>

## ◆ OnIterator

using OnIterator = OnMaskIterator<NodeMask>

## ◆ Word

using Word = Byte

## Constructor & Destructor Documentation

## ◆ NodeMask() [1/3]

NodeMask | ( |  | ) |
| inline

Default constructor sets all bits off.

## ◆ NodeMask() [2/3]

NodeMask | ( | bool | on | ) |
| inline

All bits are set to the specified state.

## ◆ NodeMask() [3/3]

NodeMask | ( | const NodeMask< 1 > & | other | ) |
| inline

Copy constructor.

## ◆ ~NodeMask()

~NodeMask | ( |  | ) |
| inline

Destructor.

## Member Function Documentation

## ◆ beginDense()

DenseIterator beginDense | ( |  | ) | const
| inline

## ◆ beginOff()

OffIterator beginOff | ( |  | ) | const
| inline

## ◆ beginOn()

OnIterator beginOn | ( |  | ) | const
| inline

## ◆ countOff()

Index32 countOff | ( |  | ) | const
| inline

Return the total number of on bits.

## ◆ countOn()

Index32 countOn | ( |  | ) | const
| inline

Return the total number of on bits.

## ◆ endDense()

DenseIterator endDense | ( |  | ) | const
| inline

## ◆ endOff()

OffIterator endOff | ( |  | ) | const
| inline

## ◆ endOn()

OnIterator endOn | ( |  | ) | const
| inline

## ◆ findFirstOff()

Index32 findFirstOff | ( |  | ) | const
| inline

## ◆ findFirstOn()

Index32 findFirstOn | ( |  | ) | const
| inline

## ◆ findNextOff()

Index32 findNextOff | ( | Index32 | start | ) | const
| inline

## ◆ findNextOn()

Index32 findNextOn | ( | Index32 | start | ) | const
| inline

## ◆ foreach() [1/3]

const NodeMask & foreach | ( | const NodeMask< 1 > & | 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; } };
openvdb::v10_0::util::NodeMask< 1 >::Word
Byte Word
Definition: NodeMasks.h:631

## ◆ foreach() [2/3]

const NodeMask & foreach | ( | const NodeMask< 1 > & | other1,
|  | const NodeMask< 1 > & | other2,
|  | const NodeMask< 1 > & | other3,
|  | const WordOp & | op
| ) |  |
| inline

## ◆ foreach() [3/3]

const NodeMask & foreach | ( | const NodeMask< 1 > & | other1,
|  | const NodeMask< 1 > & | other2,
|  | const WordOp & | op
| ) |  |
| inline

## ◆ isConstant()

bool isConstant | ( | bool & | isOn | ) | const
| inline

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

Parameters

  isOn | Takes on the values of all bits if the method returns true - else it is undefined.

## ◆ isOff() [1/2]

bool isOff | ( |  | ) | const
| inline

Return true if all the bits are off.

## ◆ isOff() [2/2]

bool isOff | ( | Index32 | n | ) | const
| inline

Return true if the nth bit is off.

## ◆ isOn() [1/2]

bool isOn | ( |  | ) | const
| inline

Return true if all the bits are on.

## ◆ isOn() [2/2]

bool isOn | ( | Index32 | n | ) | const
| inline

Return true if the nth bit is on.

## ◆ load()

void load | ( | std::istream & | is | ) |
| inline

## ◆ memUsage()

static Index32 memUsage | ( |  | ) |
| inlinestatic

Return the byte size of this NodeMask.

## ◆ operator!()

NodeMask operator! | ( |  | ) | const
| inline

## ◆ operator!=()

bool operator!= | ( | const NodeMask< 1 > & | other | ) | const
| inline

## ◆ operator&()

NodeMask operator& | ( | const NodeMask< 1 > & | other | ) | const
| inline

## ◆ operator&=()

const NodeMask & operator&= | ( | const NodeMask< 1 > & | other | ) |
| inline

Bitwise intersection.

## ◆ operator-=()

const NodeMask & operator-= | ( | const NodeMask< 1 > & | other | ) |
| inline

Bitwise difference.

## ◆ operator=()

void operator= | ( | const NodeMask< 1 > & | other | ) |
| inline

Assignment operator.

## ◆ operator==()

bool operator== | ( | const NodeMask< 1 > & | other | ) | const
| inline

## ◆ operator^()

NodeMask operator^ | ( | const NodeMask< 1 > & | other | ) | const
| inline

## ◆ operator^=()

const NodeMask & operator^= | ( | const NodeMask< 1 > & | other | ) |
| inline

Bitwise XOR.

## ◆ operator|()

NodeMask operator| | ( | const NodeMask< 1 > & | other | ) | const
| inline

## ◆ operator|=()

const NodeMask & operator|= | ( | const NodeMask< 1 > & | other | ) |
| inline

Bitwise union.

## ◆ printAll()

void printAll | ( | std::ostream & | os = `std::cout` | ) | const
| inline

## ◆ printBits()

void printBits | ( | std::ostream & | os = `std::cout` | ) | const
| inline

## ◆ printInfo()

void printInfo | ( | std::ostream & | os = `std::cout` | ) | const
| inline

simple print method for debugging

## ◆ save()

void save | ( | std::ostream & | os | ) | const
| inline

## ◆ seek()

void seek | ( | std::istream & | is | ) | const
| inline

## ◆ set() [1/2]

void set | ( | bool | on | ) |
| inline

Set all bits to the specified state.

## ◆ set() [2/2]

void set | ( | Index32 | n,
|  | bool | On
| ) |  |
| inline

Set the nth bit to the specified state.

## ◆ setFirstOff()

void setFirstOff | ( |  | ) |
| inline

Set the first bit off.

## ◆ setFirstOn()

void setFirstOn | ( |  | ) |
| inline

Set the first bit on.

## ◆ setLastOff()

void setLastOff | ( |  | ) |
| inline

Set the last bit off.

## ◆ setLastOn()

void setLastOn | ( |  | ) |
| inline

Set the last bit on.

## ◆ setOff() [1/2]

void setOff | ( |  | ) |
| inline

Set all bits off.

## ◆ setOff() [2/2]

void setOff | ( | Index32 | n | ) |
| inline

Set the nth bit off.

## ◆ setOn() [1/2]

void setOn | ( |  | ) |
| inline

Set all bits on.

## ◆ setOn() [2/2]

void setOn | ( | Index32 | n | ) |
| inline

Set the nth bit on.

## ◆ toggle() [1/2]

void toggle | ( |  | ) |
| inline

Toggle the state of all bits in the mask.

## ◆ toggle() [2/2]

void toggle | ( | Index32 | n | ) |
| inline

Toggle the state of the nth bit.

## Member Data Documentation

## ◆ DIM

const Index32 DIM = 2
| static

## ◆ LOG2DIM

const Index32 LOG2DIM = 1
| static

## ◆ SIZE

const Index32 SIZE = 8
| static

## ◆ WORD_COUNT

const Index32 WORD_COUNT = 1
| static