HDK
|
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. 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... | |
NodeMask & | 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, Index32 max_out=80u) const |
void | printAll (std::ostream &os=std::cout, Index32 max_out=80u) 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 = Log2Dim |
static const Index32 | DIM = 1<<Log2Dim |
static const Index32 | SIZE = 1<<3*Log2Dim |
static const Index32 | WORD_COUNT = SIZE >> 6 |
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition at line 307 of file NodeMasks.h.
using openvdb::OPENVDB_VERSION_NAME::util::NodeMask< Log2Dim >::DenseIterator = DenseMaskIterator<NodeMask> |
Definition at line 350 of file NodeMasks.h.
using openvdb::OPENVDB_VERSION_NAME::util::NodeMask< Log2Dim >::OffIterator = OffMaskIterator<NodeMask> |
Definition at line 349 of file NodeMasks.h.
using openvdb::OPENVDB_VERSION_NAME::util::NodeMask< Log2Dim >::OnIterator = OnMaskIterator<NodeMask> |
Definition at line 348 of file NodeMasks.h.
using openvdb::OPENVDB_VERSION_NAME::util::NodeMask< Log2Dim >::Word = Index64 |
Definition at line 316 of file NodeMasks.h.
|
inline |
Default constructor sets all bits off.
Definition at line 332 of file NodeMasks.h.
|
inline |
All bits are set to the specified state.
Definition at line 334 of file NodeMasks.h.
|
inline |
Copy constructor.
Definition at line 336 of file NodeMasks.h.
|
inline |
Destructor.
Definition at line 338 of file NodeMasks.h.
|
inline |
Definition at line 356 of file NodeMasks.h.
|
inline |
Definition at line 354 of file NodeMasks.h.
|
inline |
Definition at line 352 of file NodeMasks.h.
|
inline |
Return the total number of on bits.
Definition at line 450 of file NodeMasks.h.
|
inline |
Return the total number of on bits.
Definition at line 443 of file NodeMasks.h.
|
inline |
Definition at line 357 of file NodeMasks.h.
|
inline |
Definition at line 355 of file NodeMasks.h.
|
inline |
Definition at line 353 of file NodeMasks.h.
|
inline |
Definition at line 541 of file NodeMasks.h.
|
inline |
Definition at line 534 of file NodeMasks.h.
|
inline |
Definition at line 607 of file NodeMasks.h.
|
inline |
Definition at line 595 of file NodeMasks.h.
|
inline |
Apply a functor to the words of the this and the other mask.
An example that implements the "operator&=" method:
Definition at line 379 of file NodeMasks.h.
|
inline |
Definition at line 387 of file NodeMasks.h.
|
inline |
Definition at line 395 of file NodeMasks.h.
|
inline |
Return the nth word of the bit mask, for a word of arbitrary size.
Definition at line 552 of file NodeMasks.h.
|
inline |
Return the nth word of the bit mask, for a word of arbitrary size.
Definition at line 558 of file NodeMasks.h.
|
inline |
Return true
if bits are either all off OR all on.
isOn | Takes on the values of all bits if the method returns true - else it is undefined. |
Definition at line 526 of file NodeMasks.h.
|
inline |
Return true
if the nth bit is off.
Definition at line 508 of file NodeMasks.h.
|
inline |
Return true
if all the bits are off.
Definition at line 517 of file NodeMasks.h.
|
inline |
Return true
if the nth bit is on.
Definition at line 502 of file NodeMasks.h.
|
inline |
Return true
if all the bits are on.
Definition at line 510 of file NodeMasks.h.
|
inline |
Definition at line 569 of file NodeMasks.h.
|
inlinestatic |
Return the byte size of this NodeMask.
Definition at line 441 of file NodeMasks.h.
|
inline |
Definition at line 435 of file NodeMasks.h.
|
inline |
Definition at line 366 of file NodeMasks.h.
|
inline |
Definition at line 436 of file NodeMasks.h.
|
inline |
Bitwise intersection.
Definition at line 404 of file NodeMasks.h.
|
inline |
Bitwise difference.
Definition at line 420 of file NodeMasks.h.
|
inline |
Assignment operator.
Definition at line 340 of file NodeMasks.h.
|
inline |
Definition at line 359 of file NodeMasks.h.
|
inline |
Definition at line 438 of file NodeMasks.h.
|
inline |
Bitwise XOR.
Definition at line 428 of file NodeMasks.h.
|
inline |
Definition at line 437 of file NodeMasks.h.
|
inline |
Bitwise union.
Definition at line 412 of file NodeMasks.h.
|
inline |
Definition at line 589 of file NodeMasks.h.
|
inline |
Definition at line 577 of file NodeMasks.h.
|
inline |
simple print method for debugging
Definition at line 572 of file NodeMasks.h.
|
inline |
Definition at line 565 of file NodeMasks.h.
|
inline |
Definition at line 570 of file NodeMasks.h.
|
inline |
Set the nth bit to the specified state.
Definition at line 462 of file NodeMasks.h.
|
inline |
Set all bits to the specified state.
Definition at line 464 of file NodeMasks.h.
|
inline |
Set the first bit off.
Definition at line 498 of file NodeMasks.h.
|
inline |
Set the first bit on.
Definition at line 494 of file NodeMasks.h.
|
inline |
Set the last bit off.
Definition at line 500 of file NodeMasks.h.
|
inline |
Set the last bit on.
Definition at line 496 of file NodeMasks.h.
|
inline |
Set the nth bit off.
Definition at line 457 of file NodeMasks.h.
|
inline |
Set all bits off.
Definition at line 477 of file NodeMasks.h.
|
inline |
Set the nth bit on.
Definition at line 452 of file NodeMasks.h.
|
inline |
Set all bits on.
Definition at line 471 of file NodeMasks.h.
|
inline |
Toggle the state of the nth bit.
Definition at line 483 of file NodeMasks.h.
|
inline |
Toggle the state of all bits in the mask.
Definition at line 488 of file NodeMasks.h.
|
static |
Definition at line 313 of file NodeMasks.h.
|
static |
Definition at line 312 of file NodeMasks.h.
|
static |
Definition at line 314 of file NodeMasks.h.
|
static |
Definition at line 315 of file NodeMasks.h.