OpenVDB 13.0.0

Loading...
Searching...
No Matches
NodeMasks.h
Go to the documentation of this file.
1// Copyright Contributors to the OpenVDB Project
2// SPDX-License-Identifier: Apache-2.0
3//
4/// @author Ken Museth
5///
6/// @file NodeMasks.h
7
8#ifndef OPENVDB_UTIL_NODEMASKS_HAS_BEEN_INCLUDED
9#define OPENVDB_UTIL_NODEMASKS_HAS_BEEN_INCLUDED
10
11#include <algorithm> // for std::min()
12#include <cstring>
13#include <iostream>// for cout
14#include <openvdb/Platform.h>
15#include <openvdb/Types.h>
16#include <openvdb/util/Assert.h>
17//#include <strings.h> // for ffs
18
19
20 namespace openvdb {
21 OPENVDB_USE_VERSION_NAMESPACE
22 namespace OPENVDB_VERSION_NAME {
23 namespace util {
24
25/// Return the number of on bits in the given 8-bit value.
26 inline Index32
27 CountOn(Byte v)
28{
29#if defined(OPENVDB_USE_SSE42) && defined(_MSC_VER)
30 return __popcnt16(v);
31#elif defined(OPENVDB_USE_SSE42) && (defined(__GNUC__) || defined(__clang__))
32 return __builtin_popcount(v);
33#else
34 // Software Implementation - Simple LUT
35 static const Byte numBits[256] = {
36#define COUNTONB2(n) n, n+1, n+1, n+2
37#define COUNTONB4(n) COUNTONB2(n), COUNTONB2(n+1), COUNTONB2(n+1), COUNTONB2(n+2)
38#define COUNTONB6(n) COUNTONB4(n), COUNTONB4(n+1), COUNTONB4(n+1), COUNTONB4(n+2)
39 COUNTONB6(0), COUNTONB6(1), COUNTONB6(1), COUNTONB6(2)
40 };
41 return numBits[v];
42#undef COUNTONB6
43#undef COUNTONB4
44#undef COUNTONB2
45#endif
46}
47
48/// Return the number of off bits in the given 8-bit value.
49 inline Index32 CountOff(Byte v) { return CountOn(static_cast<Byte>(~v)); }
50
51/// Return the number of on bits in the given 32-bit value.
52 inline Index32
53 CountOn(Index32 v)
54{
55 v = v - ((v >> 1) & 0x55555555U);
56 v = (v & 0x33333333U) + ((v >> 2) & 0x33333333U);
57 return (((v + (v >> 4)) & 0xF0F0F0FU) * 0x1010101U) >> 24;
58}
59
60/// Return the number of off bits in the given 32-bit value.
61 inline Index32 CountOff(Index32 v) { return CountOn(~v); }
62
63/// Return the number of on bits in the given 64-bit value.
64 inline Index32
65 CountOn(Index64 v)
66{
67#if defined(OPENVDB_USE_SSE42) && defined(_MSC_VER) && defined(_M_X64)
68 v = __popcnt64(v);
69#elif defined(OPENVDB_USE_SSE42) && (defined(__GNUC__) || defined(__clang__))
70 v = __builtin_popcountll(v);
71#else
72 // Software Implementation
73 v = v - ((v >> 1) & UINT64_C(0x5555555555555555));
74 v = (v & UINT64_C(0x3333333333333333)) + ((v >> 2) & UINT64_C(0x3333333333333333));
75 v = (((v + (v >> 4)) & UINT64_C(0xF0F0F0F0F0F0F0F)) * UINT64_C(0x101010101010101)) >> 56;
76#endif
77 return static_cast<Index32>(v);
78}
79
80/// Return the number of off bits in the given 64-bit value.
81 inline Index32 CountOff(Index64 v) { return CountOn(~v); }
82
83/// Return the least significant on bit of the given 8-bit value.
84 inline Index32
85 FindLowestOn(Byte v)
86{
87 OPENVDB_ASSERT(v);
88#if defined(OPENVDB_USE_SSE42) && defined(_MSC_VER)
89 unsigned long index;
90 _BitScanForward(&index, static_cast<Index32>(v));
91 return static_cast<Index32>(index);
92#elif defined(OPENVDB_USE_SSE42) && (defined(__GNUC__) || defined(__clang__))
93 return __builtin_ctz(v);
94#else
95 // Software Implementation
96 static const Byte DeBruijn[8] = {0, 1, 6, 2, 7, 5, 4, 3};
97 return DeBruijn[Byte((v & -v) * 0x1DU) >> 5];
98#endif
99}
100
101/// Return the least significant on bit of the given 32-bit value.
102 inline Index32
103 FindLowestOn(Index32 v)
104{
105 OPENVDB_ASSERT(v);
106 //return ffs(v);
107 static const Byte DeBruijn[32] = {
108 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
109 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
110 };
111
112// disable unary minus on unsigned warning
113#if defined(_MSC_VER)
114#pragma warning(push)
115#pragma warning(disable:4146)
116#endif
117 return DeBruijn[Index32((v & -v) * 0x077CB531U) >> 27];
118#if defined(_MSC_VER)
119#pragma warning(pop)
120#endif
121}
122
123/// Return the least significant on bit of the given 64-bit value.
124 inline Index32
125 FindLowestOn(Index64 v)
126{
127 OPENVDB_ASSERT(v);
128#if defined(OPENVDB_USE_SSE42) && defined(_MSC_VER)
129 unsigned long index;
130 _BitScanForward64(&index, v);
131 return static_cast<Index32>(index);
132#elif defined(OPENVDB_USE_SSE42) && (defined(__GNUC__) || defined(__clang__))
133 return static_cast<Index32>(__builtin_ctzll(v));
134#else
135 // Software Implementation
136 static const Byte DeBruijn[64] = {
137 0, 1, 2, 53, 3, 7, 54, 27, 4, 38, 41, 8, 34, 55, 48, 28,
138 62, 5, 39, 46, 44, 42, 22, 9, 24, 35, 59, 56, 49, 18, 29, 11,
139 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10,
140 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12,
141 };
142
143
144// disable unary minus on unsigned warning
145#if defined(_MSC_VER)
146#pragma warning(push)
147#pragma warning(disable:4146)
148#endif
149 return DeBruijn[Index64((v & -v) * UINT64_C(0x022FDD63CC95386D)) >> 58];
150#if defined(_MSC_VER)
151#pragma warning(pop)
152#endif
153
154#endif
155}
156
157/// Return the most significant on bit of the given 32-bit value.
158 inline Index32
159 FindHighestOn(Index32 v)
160{
161 static const Byte DeBruijn[32] = {
162 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
163 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
164 };
165 v |= v >> 1; // first round down to one less than a power of 2
166 v |= v >> 2;
167 v |= v >> 4;
168 v |= v >> 8;
169 v |= v >> 16;
170 return DeBruijn[Index32(v * 0x07C4ACDDU) >> 27];
171}
172
173
174////////////////////////////////////////
175
176
177/// Base class for the bit mask iterators
178 template<typename NodeMask>
179 class BaseMaskIterator
180{
181 protected:
182 Index32 mPos; // bit position
183 const NodeMask* mParent; // this iterator can't change the parent_mask!
184
185 public:
186 BaseMaskIterator(): mPos(NodeMask::SIZE), mParent(nullptr) {}
187 BaseMaskIterator(const BaseMaskIterator&) = default;
188 BaseMaskIterator(Index32 pos, const NodeMask* parent): mPos(pos), mParent(parent)
189 {
190 OPENVDB_ASSERT((parent == nullptr && pos == 0) || (parent != nullptr && pos <= NodeMask::SIZE));
191 }
192 bool operator==(const BaseMaskIterator &iter) const {return mPos == iter.mPos;}
193 bool operator!=(const BaseMaskIterator &iter) const {return mPos != iter.mPos;}
194 bool operator< (const BaseMaskIterator &iter) const {return mPos < iter.mPos;}
195 BaseMaskIterator& operator=(const BaseMaskIterator& iter)
196 {
197 mPos = iter.mPos; mParent = iter.mParent; return *this;
198 }
199 Index32 offset() const { return mPos; }
200 Index32 pos() const { return mPos; }
201 bool test() const { OPENVDB_ASSERT(mPos <= NodeMask::SIZE); return (mPos != NodeMask::SIZE); }
202 operator bool() const { return this->test(); }
203}; // class BaseMaskIterator
204
205
206/// @note This happens to be a const-iterator!
207 template <typename NodeMask>
208 class OnMaskIterator: public BaseMaskIterator<NodeMask>
209{
210 private:
211 using BaseType = BaseMaskIterator<NodeMask>;
212 using BaseType::mPos;//bit position;
213 using BaseType::mParent;//this iterator can't change the parent_mask!
214 public:
215 OnMaskIterator() : BaseType() {}
216 OnMaskIterator(Index32 pos,const NodeMask *parent) : BaseType(pos,parent) {}
217 void increment()
218 {
219 OPENVDB_ASSERT(mParent != nullptr);
220 mPos = mParent->findNextOn(mPos+1);
221 OPENVDB_ASSERT(mPos <= NodeMask::SIZE);
222 }
223 void increment(Index n) { while(n-- && this->next()) ; }
224 bool next()
225 {
226 this->increment();
227 return this->test();
228 }
229 bool operator*() const {return true;}
230 OnMaskIterator& operator++()
231 {
232 this->increment();
233 return *this;
234 }
235}; // class OnMaskIterator
236
237
238 template <typename NodeMask>
239 class OffMaskIterator: public BaseMaskIterator<NodeMask>
240{
241 private:
242 using BaseType = BaseMaskIterator<NodeMask>;
243 using BaseType::mPos;//bit position;
244 using BaseType::mParent;//this iterator can't change the parent_mask!
245 public:
246 OffMaskIterator() : BaseType() {}
247 OffMaskIterator(Index32 pos,const NodeMask *parent) : BaseType(pos,parent) {}
248 void increment()
249 {
250 OPENVDB_ASSERT(mParent != nullptr);
251 mPos=mParent->findNextOff(mPos+1);
252 OPENVDB_ASSERT(mPos <= NodeMask::SIZE);
253 }
254 void increment(Index n) { while(n-- && this->next()) ; }
255 bool next()
256 {
257 this->increment();
258 return this->test();
259 }
260 bool operator*() const {return false;}
261 OffMaskIterator& operator++()
262 {
263 this->increment();
264 return *this;
265 }
266}; // class OffMaskIterator
267
268
269 template <typename NodeMask>
270 class DenseMaskIterator: public BaseMaskIterator<NodeMask>
271{
272 private:
273 using BaseType = BaseMaskIterator<NodeMask>;
274 using BaseType::mPos;//bit position;
275 using BaseType::mParent;//this iterator can't change the parent_mask!
276
277 public:
278 DenseMaskIterator() : BaseType() {}
279 DenseMaskIterator(Index32 pos,const NodeMask *parent) : BaseType(pos,parent) {}
280 void increment()
281 {
282 OPENVDB_ASSERT(mParent != nullptr);
283 mPos += 1;//careful - the increment might go beyond the end
284 OPENVDB_ASSERT(mPos<= NodeMask::SIZE);
285 }
286 void increment(Index n) { while(n-- && this->next()) ; }
287 bool next()
288 {
289 this->increment();
290 return this->test();
291 }
292 bool operator*() const {return mParent->isOn(mPos);}
293 DenseMaskIterator& operator++()
294 {
295 this->increment();
296 return *this;
297 }
298}; // class DenseMaskIterator
299
300
301/// @brief Bit mask for the internal and leaf nodes of VDB. This
302/// is a 64-bit implementation.
303///
304/// @note A template specialization for Log2Dim=1 and Log2Dim=2 are
305/// given below.
306 template<Index Log2Dim>
307 class NodeMask
308{
309 public:
310 static_assert(Log2Dim > 2, "expected NodeMask template specialization, got base template");
311
312 static const Index32 LOG2DIM = Log2Dim;
313 static const Index32 DIM = 1<<Log2Dim;
314 static const Index32 SIZE = 1<<3*Log2Dim;
315 static const Index32 WORD_COUNT = SIZE >> 6;// 2^6=64
316 using Word = Index64;
317
318 private:
319
320 // The bits are represented as a linear array of Words, and the
321 // size of a Word is 32 or 64 bits depending on the platform.
322 // The BIT_MASK is defined as the number of bits in a Word - 1
323 //static const Index32 BIT_MASK = sizeof(void*) == 8 ? 63 : 31;
324 //static const Index32 LOG2WORD = BIT_MASK == 63 ? 6 : 5;
325 //static const Index32 WORD_COUNT = SIZE >> LOG2WORD;
326 //using Word = boost::mpl::if_c<BIT_MASK == 63, Index64, Index32>::type;
327
328 Word mWords[WORD_COUNT];//only member data!
329
330 public:
331 /// Default constructor sets all bits off
332 NodeMask() { this->setOff(); }
333 /// All bits are set to the specified state
334 NodeMask(bool on) { this->set(on); }
335 /// Copy constructor
336 NodeMask(const NodeMask &other) { *this = other; }
337 /// Destructor
338 ~NodeMask() {}
339 /// Assignment operator
340 NodeMask& operator=(const NodeMask& other)
341 {
342 Index32 n = WORD_COUNT;
343 const Word* w2 = other.mWords;
344 for (Word* w1 = mWords; n--; ++w1, ++w2) *w1 = *w2;
345 return *this;
346 }
347
348 using OnIterator = OnMaskIterator<NodeMask>;
349 using OffIterator = OffMaskIterator<NodeMask>;
350 using DenseIterator = DenseMaskIterator<NodeMask>;
351
352 OnIterator beginOn() const { return OnIterator(this->findFirstOn(),this); }
353 OnIterator endOn() const { return OnIterator(SIZE,this); }
354 OffIterator beginOff() const { return OffIterator(this->findFirstOff(),this); }
355 OffIterator endOff() const { return OffIterator(SIZE,this); }
356 DenseIterator beginDense() const { return DenseIterator(0,this); }
357 DenseIterator endDense() const { return DenseIterator(SIZE,this); }
358
359 bool operator == (const NodeMask &other) const
360 {
361 int n = WORD_COUNT;
362 for (const Word *w1=mWords, *w2=other.mWords; n-- && *w1++ == *w2++;) ;
363 return n == -1;
364 }
365
366 bool operator != (const NodeMask &other) const { return !(*this == other); }
367
368 //
369 // Bitwise logical operations
370 //
371
372 /// @brief Apply a functor to the words of the this and the other mask.
373 ///
374 /// @details An example that implements the "operator&=" method:
375 /// @code
376 /// struct Op { inline void operator()(W &w1, const W& w2) const { w1 &= w2; } };
377 /// @endcode
378 template<typename WordOp>
379 const NodeMask& foreach(const NodeMask& other, const WordOp& op)
380 {
381 Word *w1 = mWords;
382 const Word *w2 = other.mWords;
383 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2) op( *w1, *w2);
384 return *this;
385 }
386 template<typename WordOp>
387 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const WordOp& op)
388 {
389 Word *w1 = mWords;
390 const Word *w2 = other1.mWords, *w3 = other2.mWords;
391 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2, ++w3) op( *w1, *w2, *w3);
392 return *this;
393 }
394 template<typename WordOp>
395 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const NodeMask& other3,
396 const WordOp& op)
397 {
398 Word *w1 = mWords;
399 const Word *w2 = other1.mWords, *w3 = other2.mWords, *w4 = other3.mWords;
400 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2, ++w3, ++w4) op( *w1, *w2, *w3, *w4);
401 return *this;
402 }
403 /// @brief Bitwise intersection
404 const NodeMask& operator&=(const NodeMask& other)
405 {
406 Word *w1 = mWords;
407 const Word *w2 = other.mWords;
408 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2) *w1 &= *w2;
409 return *this;
410 }
411 /// @brief Bitwise union
412 const NodeMask& operator|=(const NodeMask& other)
413 {
414 Word *w1 = mWords;
415 const Word *w2 = other.mWords;
416 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2) *w1 |= *w2;
417 return *this;
418 }
419 /// @brief Bitwise difference
420 const NodeMask& operator-=(const NodeMask& other)
421 {
422 Word *w1 = mWords;
423 const Word *w2 = other.mWords;
424 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2) *w1 &= ~*w2;
425 return *this;
426 }
427 /// @brief Bitwise XOR
428 const NodeMask& operator^=(const NodeMask& other)
429 {
430 Word *w1 = mWords;
431 const Word *w2 = other.mWords;
432 for (Index32 n = WORD_COUNT; n--; ++w1, ++w2) *w1 ^= *w2;
433 return *this;
434 }
435 NodeMask operator!() const { NodeMask m(*this); m.toggle(); return m; }
436 NodeMask operator&(const NodeMask& other) const { NodeMask m(*this); m &= other; return m; }
437 NodeMask operator|(const NodeMask& other) const { NodeMask m(*this); m |= other; return m; }
438 NodeMask operator^(const NodeMask& other) const { NodeMask m(*this); m ^= other; return m; }
439
440 /// Return the byte size of this NodeMask
441 static Index32 memUsage() { return static_cast<Index32>(WORD_COUNT*sizeof(Word)); }
442 /// Return the total number of on bits
443 Index32 countOn() const
444 {
445 Index32 sum = 0, n = WORD_COUNT;
446 for (const Word* w = mWords; n--; ++w) sum += CountOn(*w);
447 return sum;
448 }
449 /// Return the total number of on bits
450 Index32 countOff() const { return SIZE-this->countOn(); }
451 /// Set the <i>n</i>th bit on
452 void setOn(Index32 n) {
453 OPENVDB_ASSERT( (n >> 6) < WORD_COUNT );
454 mWords[n >> 6] |= Word(1) << (n & 63);
455 }
456 /// Set the <i>n</i>th bit off
457 void setOff(Index32 n) {
458 OPENVDB_ASSERT( (n >> 6) < WORD_COUNT );
459 mWords[n >> 6] &= ~(Word(1) << (n & 63));
460 }
461 /// Set the <i>n</i>th bit to the specified state
462 void set(Index32 n, bool On) { On ? this->setOn(n) : this->setOff(n); }
463 /// Set all bits to the specified state
464 void set(bool on)
465 {
466 const Word state = on ? ~Word(0) : Word(0);
467 Index32 n = WORD_COUNT;
468 for (Word* w = mWords; n--; ++w) *w = state;
469 }
470 /// Set all bits on
471 void setOn()
472 {
473 Index32 n = WORD_COUNT;
474 for (Word* w = mWords; n--; ++w) *w = ~Word(0);
475 }
476 /// Set all bits off
477 void setOff()
478 {
479 Index32 n = WORD_COUNT;
480 for (Word* w = mWords; n--; ++w) *w = Word(0);
481 }
482 /// Toggle the state of the <i>n</i>th bit
483 void toggle(Index32 n) {
484 OPENVDB_ASSERT( (n >> 6) < WORD_COUNT );
485 mWords[n >> 6] ^= Word(1) << (n & 63);
486 }
487 /// Toggle the state of all bits in the mask
488 void toggle()
489 {
490 Index32 n = WORD_COUNT;
491 for (Word* w = mWords; n--; ++w) *w = ~*w;
492 }
493 /// Set the first bit on
494 void setFirstOn() { this->setOn(0); }
495 /// Set the last bit on
496 void setLastOn() { this->setOn(SIZE-1); }
497 /// Set the first bit off
498 void setFirstOff() { this->setOff(0); }
499 /// Set the last bit off
500 void setLastOff() { this->setOff(SIZE-1); }
501 /// Return @c true if the <i>n</i>th bit is on
502 bool isOn(Index32 n) const
503 {
504 OPENVDB_ASSERT( (n >> 6) < WORD_COUNT );
505 return 0 != (mWords[n >> 6] & (Word(1) << (n & 63)));
506 }
507 /// Return @c true if the <i>n</i>th bit is off
508 bool isOff(Index32 n) const {return !this->isOn(n); }
509 /// Return @c true if all the bits are on
510 bool isOn() const
511 {
512 int n = WORD_COUNT;
513 for (const Word *w = mWords; n-- && *w++ == ~Word(0);) ;
514 return n == -1;
515 }
516 /// Return @c true if all the bits are off
517 bool isOff() const
518 {
519 int n = WORD_COUNT;
520 for (const Word *w = mWords; n-- && *w++ == Word(0);) ;
521 return n == -1;
522 }
523 /// Return @c true if bits are either all off OR all on.
524 /// @param isOn Takes on the values of all bits if the method
525 /// returns true - else it is undefined.
526 bool isConstant(bool &isOn) const
527 {
528 isOn = (mWords[0] == ~Word(0));//first word has all bits on
529 if ( !isOn && mWords[0] != Word(0)) return false;//early out
530 const Word *w = mWords + 1, *n = mWords + WORD_COUNT;
531 while( w<n && *w == mWords[0] ) ++w;
532 return w == n;
533 }
534 Index32 findFirstOn() const
535 {
536 Index32 n = 0;
537 const Word* w = mWords;
538 for (; n<WORD_COUNT && !*w; ++w, ++n) ;
539 return n==WORD_COUNT ? SIZE : (n << 6) + FindLowestOn(*w);
540 }
541 Index32 findFirstOff() const
542 {
543 Index32 n = 0;
544 const Word* w = mWords;
545 for (; n<WORD_COUNT && !~*w; ++w, ++n) ;
546 return n==WORD_COUNT ? SIZE : (n << 6) + FindLowestOn(~*w);
547 }
548
549 //@{
550 /// Return the <i>n</i>th word of the bit mask, for a word of arbitrary size.
551 template<typename WordT>
552 WordT getWord(Index n) const
553 {
554 OPENVDB_ASSERT(n*8*sizeof(WordT) < SIZE);
555 return reinterpret_cast<const WordT*>(mWords)[n];
556 }
557 template<typename WordT>
558 WordT& getWord(Index n)
559 {
560 OPENVDB_ASSERT(n*8*sizeof(WordT) < SIZE);
561 return reinterpret_cast<WordT*>(mWords)[n];
562 }
563 //@}
564
565 void save(std::ostream& os) const
566 {
567 os.write(reinterpret_cast<const char*>(mWords), this->memUsage());
568 }
569 void load(std::istream& is) { is.read(reinterpret_cast<char*>(mWords), this->memUsage()); }
570 void seek(std::istream& is) const { is.seekg(this->memUsage(), std::ios_base::cur); }
571 /// @brief simple print method for debugging
572 void printInfo(std::ostream& os=std::cout) const
573 {
574 os << "NodeMask: Dim=" << DIM << " Log2Dim=" << Log2Dim
575 << " Bit count=" << SIZE << " word count=" << WORD_COUNT << std::endl;
576 }
577 void printBits(std::ostream& os=std::cout, Index32 max_out=80u) const
578 {
579 const Index32 n=(SIZE>max_out ? max_out : SIZE);
580 for (Index32 i=0; i < n; ++i) {
581 if ( !(i & 63) )
582 os << "||";
583 else if ( !(i%8) )
584 os << "|";
585 os << this->isOn(i);
586 }
587 os << "|" << std::endl;
588 }
589 void printAll(std::ostream& os=std::cout, Index32 max_out=80u) const
590 {
591 this->printInfo(os);
592 this->printBits(os, max_out);
593 }
594
595 Index32 findNextOn(Index32 start) const
596 {
597 Index32 n = start >> 6;//initiate
598 if (n >= WORD_COUNT) return SIZE; // check for out of bounds
599 Index32 m = start & 63;
600 Word b = mWords[n];
601 if (b & (Word(1) << m)) return start;//simpel case: start is on
602 b &= ~Word(0) << m;// mask out lower bits
603 while(!b && ++n<WORD_COUNT) b = mWords[n];// find next none-zero word
604 return (!b ? SIZE : (n << 6) + FindLowestOn(b));//catch last word=0
605 }
606
607 Index32 findNextOff(Index32 start) const
608 {
609 Index32 n = start >> 6;//initiate
610 if (n >= WORD_COUNT) return SIZE; // check for out of bounds
611 Index32 m = start & 63;
612 Word b = ~mWords[n];
613 if (b & (Word(1) << m)) return start;//simpel case: start is on
614 b &= ~Word(0) << m;// mask out lower bits
615 while(!b && ++n<WORD_COUNT) b = ~mWords[n];// find next none-zero word
616 return (!b ? SIZE : (n << 6) + FindLowestOn(b));//catch last word=0
617 }
618};// NodeMask
619
620
621/// @brief Template specialization of NodeMask for Log2Dim=1, i.e. 2^3 nodes
622 template<>
623 class NodeMask<1>
624{
625 public:
626
627 static const Index32 LOG2DIM = 1;
628 static const Index32 DIM = 2;
629 static const Index32 SIZE = 8;
630 static const Index32 WORD_COUNT = 1;
631 using Word = Byte;
632
633 private:
634
635 Byte mByte;//only member data!
636
637 public:
638 /// Default constructor sets all bits off
639 NodeMask() : mByte(0x00U) {}
640 /// All bits are set to the specified state
641 NodeMask(bool on) : mByte(on ? 0xFFU : 0x00U) {}
642 /// Copy constructor
643 NodeMask(const NodeMask &other) : mByte(other.mByte) {}
644 /// Destructor
645 ~NodeMask() {}
646 /// Assignment operator
647 void operator = (const NodeMask &other) { mByte = other.mByte; }
648
649 using OnIterator = OnMaskIterator<NodeMask>;
650 using OffIterator = OffMaskIterator<NodeMask>;
651 using DenseIterator = DenseMaskIterator<NodeMask>;
652
653 OnIterator beginOn() const { return OnIterator(this->findFirstOn(),this); }
654 OnIterator endOn() const { return OnIterator(SIZE,this); }
655 OffIterator beginOff() const { return OffIterator(this->findFirstOff(),this); }
656 OffIterator endOff() const { return OffIterator(SIZE,this); }
657 DenseIterator beginDense() const { return DenseIterator(0,this); }
658 DenseIterator endDense() const { return DenseIterator(SIZE,this); }
659
660 bool operator == (const NodeMask &other) const { return mByte == other.mByte; }
661
662 bool operator != (const NodeMask &other) const {return mByte != other.mByte; }
663
664 //
665 // Bitwise logical operations
666 //
667
668 /// @brief Apply a functor to the words of the this and the other mask.
669 ///
670 /// @details An example that implements the "operator&=" method:
671 /// @code
672 /// struct Op { inline void operator()(Word &w1, const Word& w2) const { w1 &= w2; } };
673 /// @endcode
674 template<typename WordOp>
675 const NodeMask& foreach(const NodeMask& other, const WordOp& op)
676 {
677 op(mByte, other.mByte);
678 return *this;
679 }
680 template<typename WordOp>
681 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const WordOp& op)
682 {
683 op(mByte, other1.mByte, other2.mByte);
684 return *this;
685 }
686 template<typename WordOp>
687 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const NodeMask& other3,
688 const WordOp& op)
689 {
690 op(mByte, other1.mByte, other2.mByte, other3.mByte);
691 return *this;
692 }
693 /// @brief Bitwise intersection
694 const NodeMask& operator&=(const NodeMask& other)
695 {
696 mByte &= other.mByte;
697 return *this;
698 }
699 /// @brief Bitwise union
700 const NodeMask& operator|=(const NodeMask& other)
701 {
702 mByte |= other.mByte;
703 return *this;
704 }
705 /// @brief Bitwise difference
706 const NodeMask& operator-=(const NodeMask& other)
707 {
708 mByte &= static_cast<Byte>(~other.mByte);
709 return *this;
710 }
711 /// @brief Bitwise XOR
712 const NodeMask& operator^=(const NodeMask& other)
713 {
714 mByte ^= other.mByte;
715 return *this;
716 }
717 NodeMask operator!() const { NodeMask m(*this); m.toggle(); return m; }
718 NodeMask operator&(const NodeMask& other) const { NodeMask m(*this); m &= other; return m; }
719 NodeMask operator|(const NodeMask& other) const { NodeMask m(*this); m |= other; return m; }
720 NodeMask operator^(const NodeMask& other) const { NodeMask m(*this); m ^= other; return m; }
721 /// Return the byte size of this NodeMask
722 static Index32 memUsage() { return 1; }
723 /// Return the total number of on bits
724 Index32 countOn() const { return CountOn(mByte); }
725 /// Return the total number of on bits
726 Index32 countOff() const { return CountOff(mByte); }
727 /// Set the <i>n</i>th bit on
728 void setOn(Index32 n) {
729 OPENVDB_ASSERT( n < 8 );
730 mByte = static_cast<Byte>(mByte | 0x01U << (n & 7));
731 }
732 /// Set the <i>n</i>th bit off
733 void setOff(Index32 n) {
734 OPENVDB_ASSERT( n < 8 );
735 mByte = static_cast<Byte>(mByte & ~(0x01U << (n & 7)));
736 }
737 /// Set the <i>n</i>th bit to the specified state
738 void set(Index32 n, bool On) { On ? this->setOn(n) : this->setOff(n); }
739 /// Set all bits to the specified state
740 void set(bool on) { mByte = on ? 0xFFU : 0x00U; }
741 /// Set all bits on
742 void setOn() { mByte = 0xFFU; }
743 /// Set all bits off
744 void setOff() { mByte = 0x00U; }
745 /// Toggle the state of the <i>n</i>th bit
746 void toggle(Index32 n) {
747 OPENVDB_ASSERT( n < 8 );
748 mByte = static_cast<Byte>(mByte ^ 0x01U << (n & 7));
749 }
750 /// Toggle the state of all bits in the mask
751 void toggle() { mByte = static_cast<Byte>(~mByte); }
752 /// Set the first bit on
753 void setFirstOn() { this->setOn(0); }
754 /// Set the last bit on
755 void setLastOn() { this->setOn(7); }
756 /// Set the first bit off
757 void setFirstOff() { this->setOff(0); }
758 /// Set the last bit off
759 void setLastOff() { this->setOff(7); }
760 /// Return true if the <i>n</i>th bit is on
761 bool isOn(Index32 n) const
762 {
763 OPENVDB_ASSERT( n < 8 );
764 return mByte & (0x01U << (n & 7));
765 }
766 /// Return true if the <i>n</i>th bit is off
767 bool isOff(Index32 n) const {return !this->isOn(n); }
768 /// Return true if all the bits are on
769 bool isOn() const { return mByte == 0xFFU; }
770 /// Return true if all the bits are off
771 bool isOff() const { return mByte == 0; }
772 /// Return @c true if bits are either all off OR all on.
773 /// @param isOn Takes on the values of all bits if the method
774 /// returns true - else it is undefined.
775 bool isConstant(bool &isOn) const
776 {
777 isOn = this->isOn();
778 return isOn || this->isOff();
779 }
780 Index32 findFirstOn() const { return mByte ? FindLowestOn(mByte) : 8; }
781 Index32 findFirstOff() const
782 {
783 const Byte b = static_cast<Byte>(~mByte);
784 return b ? FindLowestOn(b) : 8;
785 }
786 /*
787 //@{
788 /// Return the <i>n</i>th word of the bit mask, for a word of arbitrary size.
789 /// @note This version assumes WordT=Byte and n=0!
790 template<typename WordT>
791 WordT getWord(Index n) const
792 {
793 static_assert(sizeof(WordT) == sizeof(Byte), "expected word size to be one byte");
794 OPENVDB_ASSERT(n == 0);
795 return reinterpret_cast<WordT>(mByte);
796 }
797 template<typename WordT>
798 WordT& getWord(Index n)
799 {
800 static_assert(sizeof(WordT) == sizeof(Byte), "expected word size to be one byte");
801 OPENVDB_ASSERT(n == 0);
802 return reinterpret_cast<WordT&>(mByte);
803 }
804 //@}
805 */
806 void save(std::ostream& os) const { os.write(reinterpret_cast<const char*>(&mByte), 1); }
807 void load(std::istream& is) { is.read(reinterpret_cast<char*>(&mByte), 1); }
808 void seek(std::istream& is) const { is.seekg(1, std::ios_base::cur); }
809 /// @brief simple print method for debugging
810 void printInfo(std::ostream& os=std::cout) const
811 {
812 os << "NodeMask: Dim=2, Log2Dim=1, Bit count=8, Word count=1"<<std::endl;
813 }
814 void printBits(std::ostream& os=std::cout) const
815 {
816 os << "||";
817 for (Index32 i=0; i < 8; ++i) os << this->isOn(i);
818 os << "||" << std::endl;
819 }
820 void printAll(std::ostream& os=std::cout) const
821 {
822 this->printInfo(os);
823 this->printBits(os);
824 }
825
826 Index32 findNextOn(Index32 start) const
827 {
828 if (start>=8) return 8;
829 const Byte b = static_cast<Byte>(mByte & (0xFFU << start));
830 return b ? FindLowestOn(b) : 8;
831 }
832
833 Index32 findNextOff(Index32 start) const
834 {
835 if (start>=8) return 8;
836 const Byte b = static_cast<Byte>(~mByte & (0xFFU << start));
837 return b ? FindLowestOn(b) : 8;
838 }
839
840};// NodeMask<1>
841
842
843/// @brief Template specialization of NodeMask for Log2Dim=2, i.e. 4^3 nodes
844 template<>
845 class NodeMask<2>
846{
847 public:
848
849 static const Index32 LOG2DIM = 2;
850 static const Index32 DIM = 4;
851 static const Index32 SIZE = 64;
852 static const Index32 WORD_COUNT = 1;
853 using Word = Index64;
854
855 private:
856
857 Word mWord;//only member data!
858
859 public:
860 /// Default constructor sets all bits off
861 NodeMask() : mWord(UINT64_C(0x00)) {}
862 /// All bits are set to the specified state
863 NodeMask(bool on) : mWord(on ? UINT64_C(0xFFFFFFFFFFFFFFFF) : UINT64_C(0x00)) {}
864 /// Copy constructor
865 NodeMask(const NodeMask &other) : mWord(other.mWord) {}
866 /// Destructor
867 ~NodeMask() {}
868 /// Assignment operator
869 void operator = (const NodeMask &other) { mWord = other.mWord; }
870
871 using OnIterator = OnMaskIterator<NodeMask>;
872 using OffIterator = OffMaskIterator<NodeMask>;
873 using DenseIterator = DenseMaskIterator<NodeMask>;
874
875 OnIterator beginOn() const { return OnIterator(this->findFirstOn(),this); }
876 OnIterator endOn() const { return OnIterator(SIZE,this); }
877 OffIterator beginOff() const { return OffIterator(this->findFirstOff(),this); }
878 OffIterator endOff() const { return OffIterator(SIZE,this); }
879 DenseIterator beginDense() const { return DenseIterator(0,this); }
880 DenseIterator endDense() const { return DenseIterator(SIZE,this); }
881
882 bool operator == (const NodeMask &other) const { return mWord == other.mWord; }
883
884 bool operator != (const NodeMask &other) const {return mWord != other.mWord; }
885
886 //
887 // Bitwise logical operations
888 //
889
890 /// @brief Apply a functor to the words of the this and the other mask.
891 ///
892 /// @details An example that implements the "operator&=" method:
893 /// @code
894 /// struct Op { inline void operator()(Word &w1, const Word& w2) const { w1 &= w2; } };
895 /// @endcode
896 template<typename WordOp>
897 const NodeMask& foreach(const NodeMask& other, const WordOp& op)
898 {
899 op(mWord, other.mWord);
900 return *this;
901 }
902 template<typename WordOp>
903 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const WordOp& op)
904 {
905 op(mWord, other1.mWord, other2.mWord);
906 return *this;
907 }
908 template<typename WordOp>
909 const NodeMask& foreach(const NodeMask& other1, const NodeMask& other2, const NodeMask& other3,
910 const WordOp& op)
911 {
912 op(mWord, other1.mWord, other2.mWord, other3.mWord);
913 return *this;
914 }
915 /// @brief Bitwise intersection
916 const NodeMask& operator&=(const NodeMask& other)
917 {
918 mWord &= other.mWord;
919 return *this;
920 }
921 /// @brief Bitwise union
922 const NodeMask& operator|=(const NodeMask& other)
923 {
924 mWord |= other.mWord;
925 return *this;
926 }
927 /// @brief Bitwise difference
928 const NodeMask& operator-=(const NodeMask& other)
929 {
930 mWord &= ~other.mWord;
931 return *this;
932 }
933 /// @brief Bitwise XOR
934 const NodeMask& operator^=(const NodeMask& other)
935 {
936 mWord ^= other.mWord;
937 return *this;
938 }
939 NodeMask operator!() const { NodeMask m(*this); m.toggle(); return m; }
940 NodeMask operator&(const NodeMask& other) const { NodeMask m(*this); m &= other; return m; }
941 NodeMask operator|(const NodeMask& other) const { NodeMask m(*this); m |= other; return m; }
942 NodeMask operator^(const NodeMask& other) const { NodeMask m(*this); m ^= other; return m; }
943 /// Return the byte size of this NodeMask
944 static Index32 memUsage() { return 8; }
945 /// Return the total number of on bits
946 Index32 countOn() const { return CountOn(mWord); }
947 /// Return the total number of on bits
948 Index32 countOff() const { return CountOff(mWord); }
949 /// Set the <i>n</i>th bit on
950 void setOn(Index32 n) {
951 OPENVDB_ASSERT( n < 64 );
952 mWord |= UINT64_C(0x01) << (n & 63);
953 }
954 /// Set the <i>n</i>th bit off
955 void setOff(Index32 n) {
956 OPENVDB_ASSERT( n < 64 );
957 mWord &= ~(UINT64_C(0x01) << (n & 63));
958 }
959 /// Set the <i>n</i>th bit to the specified state
960 void set(Index32 n, bool On) { On ? this->setOn(n) : this->setOff(n); }
961 /// Set all bits to the specified state
962 void set(bool on) { mWord = on ? UINT64_C(0xFFFFFFFFFFFFFFFF) : UINT64_C(0x00); }
963 /// Set all bits on
964 void setOn() { mWord = UINT64_C(0xFFFFFFFFFFFFFFFF); }
965 /// Set all bits off
966 void setOff() { mWord = UINT64_C(0x00); }
967 /// Toggle the state of the <i>n</i>th bit
968 void toggle(Index32 n) {
969 OPENVDB_ASSERT( n < 64 );
970 mWord ^= UINT64_C(0x01) << (n & 63);
971 }
972 /// Toggle the state of all bits in the mask
973 void toggle() { mWord = ~mWord; }
974 /// Set the first bit on
975 void setFirstOn() { this->setOn(0); }
976 /// Set the last bit on
977 void setLastOn() { this->setOn(63); }
978 /// Set the first bit off
979 void setFirstOff() { this->setOff(0); }
980 /// Set the last bit off
981 void setLastOff() { this->setOff(63); }
982 /// Return true if the <i>n</i>th bit is on
983 bool isOn(Index32 n) const
984 {
985 OPENVDB_ASSERT( n < 64 );
986 return 0 != (mWord & (UINT64_C(0x01) << (n & 63)));
987 }
988 /// Return true if the <i>n</i>th bit is off
989 bool isOff(Index32 n) const {return !this->isOn(n); }
990 /// Return true if all the bits are on
991 bool isOn() const { return mWord == UINT64_C(0xFFFFFFFFFFFFFFFF); }
992 /// Return true if all the bits are off
993 bool isOff() const { return mWord == 0; }
994 /// Return @c true if bits are either all off OR all on.
995 /// @param isOn Takes on the values of all bits if the method
996 /// returns true - else it is undefined.
997 bool isConstant(bool &isOn) const
998 { isOn = this->isOn();
999 return isOn || this->isOff();
1000 }
1001 Index32 findFirstOn() const { return mWord ? FindLowestOn(mWord) : 64; }
1002 Index32 findFirstOff() const
1003 {
1004 const Word w = ~mWord;
1005 return w ? FindLowestOn(w) : 64;
1006 }
1007 //@{
1008 /// Return the <i>n</i>th word of the bit mask, for a word of arbitrary size.
1009 template<typename WordT>
1010 WordT getWord(Index n) const
1011 {
1012 OPENVDB_ASSERT(n*8*sizeof(WordT) < SIZE);
1013 return reinterpret_cast<const WordT*>(&mWord)[n];
1014 }
1015 template<typename WordT>
1016 WordT& getWord(Index n)
1017 {
1018 OPENVDB_ASSERT(n*8*sizeof(WordT) < SIZE);
1019 return reinterpret_cast<WordT*>(mWord)[n];
1020 }
1021 //@}
1022 void save(std::ostream& os) const { os.write(reinterpret_cast<const char*>(&mWord), 8); }
1023 void load(std::istream& is) { is.read(reinterpret_cast<char*>(&mWord), 8); }
1024 void seek(std::istream& is) const { is.seekg(8, std::ios_base::cur); }
1025 /// @brief simple print method for debugging
1026 void printInfo(std::ostream& os=std::cout) const
1027 {
1028 os << "NodeMask: Dim=4, Log2Dim=2, Bit count=64, Word count=1"<<std::endl;
1029 }
1030 void printBits(std::ostream& os=std::cout) const
1031 {
1032 os << "|";
1033 for (Index32 i=0; i < 64; ++i) {
1034 if ( !(i%8) ) os << "|";
1035 os << this->isOn(i);
1036 }
1037 os << "||" << std::endl;
1038 }
1039 void printAll(std::ostream& os=std::cout) const
1040 {
1041 this->printInfo(os);
1042 this->printBits(os);
1043 }
1044
1045 Index32 findNextOn(Index32 start) const
1046 {
1047 if (start>=64) return 64;
1048 const Word w = mWord & (UINT64_C(0xFFFFFFFFFFFFFFFF) << start);
1049 return w ? FindLowestOn(w) : 64;
1050 }
1051
1052 Index32 findNextOff(Index32 start) const
1053 {
1054 if (start>=64) return 64;
1055 const Word w = ~mWord & (UINT64_C(0xFFFFFFFFFFFFFFFF) << start);
1056 return w ? FindLowestOn(w) : 64;
1057 }
1058
1059};// NodeMask<2>
1060
1061
1062} // namespace util
1063} // namespace OPENVDB_VERSION_NAME
1064} // namespace openvdb
1065
1066#endif // OPENVDB_UTIL_NODEMASKS_HAS_BEEN_INCLUDED
Assert.h
OPENVDB_ASSERT
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
COUNTONB6
#define COUNTONB6(n)
Platform.h
openvdb::v13_0::util::BaseMaskIterator::operator==
bool operator==(const BaseMaskIterator &iter) const
Definition NodeMasks.h:192
openvdb::v13_0::util::BaseMaskIterator::test
bool test() const
Definition NodeMasks.h:201
openvdb::v13_0::util::BaseMaskIterator::BaseMaskIterator
BaseMaskIterator(const BaseMaskIterator &)=default
openvdb::v13_0::util::BaseMaskIterator::operator!=
bool operator!=(const BaseMaskIterator &iter) const
Definition NodeMasks.h:193
openvdb::v13_0::util::BaseMaskIterator::BaseMaskIterator
BaseMaskIterator()
Definition NodeMasks.h:186
openvdb::v13_0::util::BaseMaskIterator::mPos
Index32 mPos
Definition NodeMasks.h:182
openvdb::v13_0::util::BaseMaskIterator::pos
Index32 pos() const
Definition NodeMasks.h:200
openvdb::v13_0::util::BaseMaskIterator::BaseMaskIterator
BaseMaskIterator(Index32 pos, const NodeMask *parent)
Definition NodeMasks.h:188
openvdb::v13_0::util::BaseMaskIterator::offset
Index32 offset() const
Definition NodeMasks.h:199
openvdb::v13_0::util::BaseMaskIterator::mParent
const NodeMask * mParent
Definition NodeMasks.h:183
openvdb::v13_0::util::BaseMaskIterator::operator=
BaseMaskIterator & operator=(const BaseMaskIterator &iter)
Definition NodeMasks.h:195
openvdb::v13_0::util::DenseMaskIterator
Definition NodeMasks.h:271
openvdb::v13_0::util::DenseMaskIterator::operator++
DenseMaskIterator & operator++()
Definition NodeMasks.h:293
openvdb::v13_0::util::DenseMaskIterator::operator*
bool operator*() const
Definition NodeMasks.h:292
openvdb::v13_0::util::DenseMaskIterator::DenseMaskIterator
DenseMaskIterator()
Definition NodeMasks.h:278
openvdb::v13_0::util::DenseMaskIterator::DenseMaskIterator
DenseMaskIterator(Index32 pos, const NodeMask *parent)
Definition NodeMasks.h:279
openvdb::v13_0::util::DenseMaskIterator::next
bool next()
Definition NodeMasks.h:287
openvdb::v13_0::util::DenseMaskIterator::increment
void increment(Index n)
Definition NodeMasks.h:286
openvdb::v13_0::util::DenseMaskIterator::increment
void increment()
Definition NodeMasks.h:280
openvdb::v13_0::util::NodeMask< 1 >::operator^=
const NodeMask & operator^=(const NodeMask &other)
Bitwise XOR.
Definition NodeMasks.h:712
openvdb::v13_0::util::NodeMask< 1 >::isOff
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition NodeMasks.h:767
openvdb::v13_0::util::NodeMask< 1 >::operator|
NodeMask operator|(const NodeMask &other) const
Definition NodeMasks.h:719
openvdb::v13_0::util::NodeMask< 1 >::operator&=
const NodeMask & operator&=(const NodeMask &other)
Bitwise intersection.
Definition NodeMasks.h:694
openvdb::v13_0::util::NodeMask< 1 >::countOn
Index32 countOn() const
Return the total number of on bits.
Definition NodeMasks.h:724
openvdb::v13_0::util::NodeMask< 1 >::operator-=
const NodeMask & operator-=(const NodeMask &other)
Bitwise difference.
Definition NodeMasks.h:706
openvdb::v13_0::util::NodeMask< 1 >::printAll
void printAll(std::ostream &os=std::cout) const
Definition NodeMasks.h:820
openvdb::v13_0::util::NodeMask< 1 >::beginOn
OnIterator beginOn() const
Definition NodeMasks.h:653
openvdb::v13_0::util::NodeMask< 1 >::operator^
NodeMask operator^(const NodeMask &other) const
Definition NodeMasks.h:720
openvdb::v13_0::util::NodeMask< 1 >::endDense
DenseIterator endDense() const
Definition NodeMasks.h:658
openvdb::v13_0::util::NodeMask< 1 >::beginDense
DenseIterator beginDense() const
Definition NodeMasks.h:657
openvdb::v13_0::util::NodeMask< 1 >::beginOff
OffIterator beginOff() const
Definition NodeMasks.h:655
openvdb::v13_0::util::NodeMask< 1 >::set
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition NodeMasks.h:738
openvdb::v13_0::util::NodeMask< 1 >::setOn
void setOn()
Set all bits on.
Definition NodeMasks.h:742
openvdb::v13_0::util::NodeMask< 1 >::DenseIterator
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:651
openvdb::v13_0::util::NodeMask< 1 >::isOn
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:761
openvdb::v13_0::util::NodeMask< 1 >::printBits
void printBits(std::ostream &os=std::cout) const
Definition NodeMasks.h:814
openvdb::v13_0::util::NodeMask< 1 >::isConstant
bool isConstant(bool &isOn) const
Definition NodeMasks.h:775
openvdb::v13_0::util::NodeMask< 1 >::WORD_COUNT
static const Index32 WORD_COUNT
Definition NodeMasks.h:630
openvdb::v13_0::util::NodeMask< 1 >::countOff
Index32 countOff() const
Return the total number of on bits.
Definition NodeMasks.h:726
openvdb::v13_0::util::NodeMask< 1 >::toggle
void toggle(Index32 n)
Toggle the state of the nth bit.
Definition NodeMasks.h:746
openvdb::v13_0::util::NodeMask< 1 >::setLastOff
void setLastOff()
Set the last bit off.
Definition NodeMasks.h:759
openvdb::v13_0::util::NodeMask< 1 >::NodeMask
NodeMask(bool on)
All bits are set to the specified state.
Definition NodeMasks.h:641
openvdb::v13_0::util::NodeMask< 1 >::findNextOff
Index32 findNextOff(Index32 start) const
Definition NodeMasks.h:833
openvdb::v13_0::util::NodeMask< 1 >::seek
void seek(std::istream &is) const
Definition NodeMasks.h:808
openvdb::v13_0::util::NodeMask< 1 >::setFirstOff
void setFirstOff()
Set the first bit off.
Definition NodeMasks.h:757
openvdb::v13_0::util::NodeMask< 1 >::OnIterator
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:649
openvdb::v13_0::util::NodeMask< 1 >::set
void set(bool on)
Set all bits to the specified state.
Definition NodeMasks.h:740
openvdb::v13_0::util::NodeMask< 1 >::operator!
NodeMask operator!() const
Definition NodeMasks.h:717
openvdb::v13_0::util::NodeMask< 1 >::SIZE
static const Index32 SIZE
Definition NodeMasks.h:629
openvdb::v13_0::util::NodeMask< 1 >::setFirstOn
void setFirstOn()
Set the first bit on.
Definition NodeMasks.h:753
openvdb::v13_0::util::NodeMask< 1 >::DIM
static const Index32 DIM
Definition NodeMasks.h:628
openvdb::v13_0::util::NodeMask< 1 >::endOn
OnIterator endOn() const
Definition NodeMasks.h:654
openvdb::v13_0::util::NodeMask< 1 >::load
void load(std::istream &is)
Definition NodeMasks.h:807
openvdb::v13_0::util::NodeMask< 1 >::operator|=
const NodeMask & operator|=(const NodeMask &other)
Bitwise union.
Definition NodeMasks.h:700
openvdb::v13_0::util::NodeMask< 1 >::save
void save(std::ostream &os) const
Definition NodeMasks.h:806
openvdb::v13_0::util::NodeMask< 1 >::findFirstOff
Index32 findFirstOff() const
Definition NodeMasks.h:781
openvdb::v13_0::util::NodeMask< 1 >::memUsage
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition NodeMasks.h:722
openvdb::v13_0::util::NodeMask< 1 >::setOff
void setOff()
Set all bits off.
Definition NodeMasks.h:744
openvdb::v13_0::util::NodeMask< 1 >::setOff
void setOff(Index32 n)
Set the nth bit off.
Definition NodeMasks.h:733
openvdb::v13_0::util::NodeMask< 1 >::setOn
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:728
openvdb::v13_0::util::NodeMask< 1 >::operator&
NodeMask operator&(const NodeMask &other) const
Definition NodeMasks.h:718
openvdb::v13_0::util::NodeMask< 1 >::isOff
bool isOff() const
Return true if all the bits are off.
Definition NodeMasks.h:771
openvdb::v13_0::util::NodeMask< 1 >::LOG2DIM
static const Index32 LOG2DIM
Definition NodeMasks.h:627
openvdb::v13_0::util::NodeMask< 1 >::NodeMask
NodeMask()
Default constructor sets all bits off.
Definition NodeMasks.h:639
openvdb::v13_0::util::NodeMask< 1 >::NodeMask
NodeMask(const NodeMask &other)
Copy constructor.
Definition NodeMasks.h:643
openvdb::v13_0::util::NodeMask< 1 >::Word
Byte Word
Definition NodeMasks.h:631
openvdb::v13_0::util::NodeMask< 1 >::toggle
void toggle()
Toggle the state of all bits in the mask.
Definition NodeMasks.h:751
openvdb::v13_0::util::NodeMask< 1 >::printInfo
void printInfo(std::ostream &os=std::cout) const
simple print method for debugging
Definition NodeMasks.h:810
openvdb::v13_0::util::NodeMask< 1 >::OffIterator
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:650
openvdb::v13_0::util::NodeMask< 1 >::findNextOn
Index32 findNextOn(Index32 start) const
Definition NodeMasks.h:826
openvdb::v13_0::util::NodeMask< 1 >::setLastOn
void setLastOn()
Set the last bit on.
Definition NodeMasks.h:755
openvdb::v13_0::util::NodeMask< 1 >::~NodeMask
~NodeMask()
Destructor.
Definition NodeMasks.h:645
openvdb::v13_0::util::NodeMask< 1 >::endOff
OffIterator endOff() const
Definition NodeMasks.h:656
openvdb::v13_0::util::NodeMask< 1 >::isOn
bool isOn() const
Return true if all the bits are on.
Definition NodeMasks.h:769
openvdb::v13_0::util::NodeMask< 1 >::findFirstOn
Index32 findFirstOn() const
Definition NodeMasks.h:780
openvdb::v13_0::util::NodeMask< 2 >::operator^=
const NodeMask & operator^=(const NodeMask &other)
Bitwise XOR.
Definition NodeMasks.h:934
openvdb::v13_0::util::NodeMask< 2 >::isOff
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition NodeMasks.h:989
openvdb::v13_0::util::NodeMask< 2 >::operator|
NodeMask operator|(const NodeMask &other) const
Definition NodeMasks.h:941
openvdb::v13_0::util::NodeMask< 2 >::operator&=
const NodeMask & operator&=(const NodeMask &other)
Bitwise intersection.
Definition NodeMasks.h:916
openvdb::v13_0::util::NodeMask< 2 >::countOn
Index32 countOn() const
Return the total number of on bits.
Definition NodeMasks.h:946
openvdb::v13_0::util::NodeMask< 2 >::operator-=
const NodeMask & operator-=(const NodeMask &other)
Bitwise difference.
Definition NodeMasks.h:928
openvdb::v13_0::util::NodeMask< 2 >::Word
Index64 Word
Definition NodeMasks.h:853
openvdb::v13_0::util::NodeMask< 2 >::printAll
void printAll(std::ostream &os=std::cout) const
Definition NodeMasks.h:1039
openvdb::v13_0::util::NodeMask< 2 >::beginOn
OnIterator beginOn() const
Definition NodeMasks.h:875
openvdb::v13_0::util::NodeMask< 2 >::getWord
WordT & getWord(Index n)
Definition NodeMasks.h:1016
openvdb::v13_0::util::NodeMask< 2 >::operator^
NodeMask operator^(const NodeMask &other) const
Definition NodeMasks.h:942
openvdb::v13_0::util::NodeMask< 2 >::endDense
DenseIterator endDense() const
Definition NodeMasks.h:880
openvdb::v13_0::util::NodeMask< 2 >::beginDense
DenseIterator beginDense() const
Definition NodeMasks.h:879
openvdb::v13_0::util::NodeMask< 2 >::beginOff
OffIterator beginOff() const
Definition NodeMasks.h:877
openvdb::v13_0::util::NodeMask< 2 >::set
void set(Index32 n, bool On)
Set the nth bit to the specified state.
Definition NodeMasks.h:960
openvdb::v13_0::util::NodeMask< 2 >::setOn
void setOn()
Set all bits on.
Definition NodeMasks.h:964
openvdb::v13_0::util::NodeMask< 2 >::DenseIterator
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:873
openvdb::v13_0::util::NodeMask< 2 >::isOn
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:983
openvdb::v13_0::util::NodeMask< 2 >::printBits
void printBits(std::ostream &os=std::cout) const
Definition NodeMasks.h:1030
openvdb::v13_0::util::NodeMask< 2 >::isConstant
bool isConstant(bool &isOn) const
Definition NodeMasks.h:997
openvdb::v13_0::util::NodeMask< 2 >::WORD_COUNT
static const Index32 WORD_COUNT
Definition NodeMasks.h:852
openvdb::v13_0::util::NodeMask< 2 >::countOff
Index32 countOff() const
Return the total number of on bits.
Definition NodeMasks.h:948
openvdb::v13_0::util::NodeMask< 2 >::toggle
void toggle(Index32 n)
Toggle the state of the nth bit.
Definition NodeMasks.h:968
openvdb::v13_0::util::NodeMask< 2 >::setLastOff
void setLastOff()
Set the last bit off.
Definition NodeMasks.h:981
openvdb::v13_0::util::NodeMask< 2 >::NodeMask
NodeMask(bool on)
All bits are set to the specified state.
Definition NodeMasks.h:863
openvdb::v13_0::util::NodeMask< 2 >::getWord
WordT getWord(Index n) const
Return the nth word of the bit mask, for a word of arbitrary size.
Definition NodeMasks.h:1010
openvdb::v13_0::util::NodeMask< 2 >::findNextOff
Index32 findNextOff(Index32 start) const
Definition NodeMasks.h:1052
openvdb::v13_0::util::NodeMask< 2 >::seek
void seek(std::istream &is) const
Definition NodeMasks.h:1024
openvdb::v13_0::util::NodeMask< 2 >::setFirstOff
void setFirstOff()
Set the first bit off.
Definition NodeMasks.h:979
openvdb::v13_0::util::NodeMask< 2 >::OnIterator
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:871
openvdb::v13_0::util::NodeMask< 2 >::set
void set(bool on)
Set all bits to the specified state.
Definition NodeMasks.h:962
openvdb::v13_0::util::NodeMask< 2 >::operator!
NodeMask operator!() const
Definition NodeMasks.h:939
openvdb::v13_0::util::NodeMask< 2 >::SIZE
static const Index32 SIZE
Definition NodeMasks.h:851
openvdb::v13_0::util::NodeMask< 2 >::setFirstOn
void setFirstOn()
Set the first bit on.
Definition NodeMasks.h:975
openvdb::v13_0::util::NodeMask< 2 >::DIM
static const Index32 DIM
Definition NodeMasks.h:850
openvdb::v13_0::util::NodeMask< 2 >::endOn
OnIterator endOn() const
Definition NodeMasks.h:876
openvdb::v13_0::util::NodeMask< 2 >::load
void load(std::istream &is)
Definition NodeMasks.h:1023
openvdb::v13_0::util::NodeMask< 2 >::operator|=
const NodeMask & operator|=(const NodeMask &other)
Bitwise union.
Definition NodeMasks.h:922
openvdb::v13_0::util::NodeMask< 2 >::save
void save(std::ostream &os) const
Definition NodeMasks.h:1022
openvdb::v13_0::util::NodeMask< 2 >::findFirstOff
Index32 findFirstOff() const
Definition NodeMasks.h:1002
openvdb::v13_0::util::NodeMask< 2 >::memUsage
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition NodeMasks.h:944
openvdb::v13_0::util::NodeMask< 2 >::setOff
void setOff()
Set all bits off.
Definition NodeMasks.h:966
openvdb::v13_0::util::NodeMask< 2 >::setOff
void setOff(Index32 n)
Set the nth bit off.
Definition NodeMasks.h:955
openvdb::v13_0::util::NodeMask< 2 >::setOn
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:950
openvdb::v13_0::util::NodeMask< 2 >::operator&
NodeMask operator&(const NodeMask &other) const
Definition NodeMasks.h:940
openvdb::v13_0::util::NodeMask< 2 >::isOff
bool isOff() const
Return true if all the bits are off.
Definition NodeMasks.h:993
openvdb::v13_0::util::NodeMask< 2 >::LOG2DIM
static const Index32 LOG2DIM
Definition NodeMasks.h:849
openvdb::v13_0::util::NodeMask< 2 >::NodeMask
NodeMask()
Default constructor sets all bits off.
Definition NodeMasks.h:861
openvdb::v13_0::util::NodeMask< 2 >::NodeMask
NodeMask(const NodeMask &other)
Copy constructor.
Definition NodeMasks.h:865
openvdb::v13_0::util::NodeMask< 2 >::toggle
void toggle()
Toggle the state of all bits in the mask.
Definition NodeMasks.h:973
openvdb::v13_0::util::NodeMask< 2 >::printInfo
void printInfo(std::ostream &os=std::cout) const
simple print method for debugging
Definition NodeMasks.h:1026
openvdb::v13_0::util::NodeMask< 2 >::OffIterator
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:872
openvdb::v13_0::util::NodeMask< 2 >::findNextOn
Index32 findNextOn(Index32 start) const
Definition NodeMasks.h:1045
openvdb::v13_0::util::NodeMask< 2 >::setLastOn
void setLastOn()
Set the last bit on.
Definition NodeMasks.h:977
openvdb::v13_0::util::NodeMask< 2 >::~NodeMask
~NodeMask()
Destructor.
Definition NodeMasks.h:867
openvdb::v13_0::util::NodeMask< 2 >::endOff
OffIterator endOff() const
Definition NodeMasks.h:878
openvdb::v13_0::util::NodeMask< 2 >::isOn
bool isOn() const
Return true if all the bits are on.
Definition NodeMasks.h:991
openvdb::v13_0::util::NodeMask< 2 >::findFirstOn
Index32 findFirstOn() const
Definition NodeMasks.h:1001
openvdb::v13_0::util::NodeMask
Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation.
Definition NodeMasks.h:308
openvdb::v13_0::util::NodeMask::operator^=
const NodeMask & operator^=(const NodeMask &other)
Bitwise XOR.
Definition NodeMasks.h:428
openvdb::v13_0::util::NodeMask::isOff
bool isOff(Index32 n) const
Return true if the nth bit is off.
Definition NodeMasks.h:508
openvdb::v13_0::util::NodeMask::operator|
NodeMask operator|(const NodeMask &other) const
Definition NodeMasks.h:437
openvdb::v13_0::util::NodeMask::operator&=
const NodeMask & operator&=(const NodeMask &other)
Bitwise intersection.
Definition NodeMasks.h:404
openvdb::v13_0::util::NodeMask::countOn
Index32 countOn() const
Return the total number of on bits.
Definition NodeMasks.h:443
openvdb::v13_0::util::NodeMask::operator-=
const NodeMask & operator-=(const NodeMask &other)
Bitwise difference.
Definition NodeMasks.h:420
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::Word
Index64 Word
Definition NodeMasks.h:316
openvdb::v13_0::util::NodeMask::beginOn
OnIterator beginOn() const
Definition NodeMasks.h:352
openvdb::v13_0::util::NodeMask::getWord
WordT & getWord(Index n)
Definition NodeMasks.h:558
openvdb::v13_0::util::NodeMask::operator^
NodeMask operator^(const NodeMask &other) const
Definition NodeMasks.h:438
openvdb::v13_0::util::NodeMask::endDense
DenseIterator endDense() const
Definition NodeMasks.h:357
openvdb::v13_0::util::NodeMask::beginDense
DenseIterator beginDense() const
Definition NodeMasks.h:356
openvdb::v13_0::util::NodeMask::beginOff
OffIterator beginOff() const
Definition NodeMasks.h:354
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::set
void set(Index32 n, bool On)
Definition NodeMasks.h:462
openvdb::v13_0::util::NodeMask::setOn
void setOn()
Set all bits on.
Definition NodeMasks.h:471
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::DenseIterator
DenseMaskIterator< NodeMask > DenseIterator
Definition NodeMasks.h:350
openvdb::v13_0::util::NodeMask::isOn
bool isOn(Index32 n) const
Return true if the nth bit is on.
Definition NodeMasks.h:502
openvdb::v13_0::util::NodeMask::isConstant
bool isConstant(bool &isOn) const
Definition NodeMasks.h:526
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::WORD_COUNT
static const Index32 WORD_COUNT
Definition NodeMasks.h:315
openvdb::v13_0::util::NodeMask::countOff
Index32 countOff() const
Return the total number of on bits.
Definition NodeMasks.h:450
openvdb::v13_0::util::NodeMask::toggle
void toggle(Index32 n)
Toggle the state of the nth bit.
Definition NodeMasks.h:483
openvdb::v13_0::util::NodeMask::setLastOff
void setLastOff()
Set the last bit off.
Definition NodeMasks.h:500
openvdb::v13_0::util::NodeMask::NodeMask
NodeMask(bool on)
All bits are set to the specified state.
Definition NodeMasks.h:334
openvdb::v13_0::util::NodeMask::getWord
WordT getWord(Index n) const
Return the nth word of the bit mask, for a word of arbitrary size.
Definition NodeMasks.h:552
openvdb::v13_0::util::NodeMask::findNextOff
Index32 findNextOff(Index32 start) const
Definition NodeMasks.h:607
openvdb::v13_0::util::NodeMask::seek
void seek(std::istream &is) const
Definition NodeMasks.h:570
openvdb::v13_0::util::NodeMask::setFirstOff
void setFirstOff()
Set the first bit off.
Definition NodeMasks.h:498
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::OnIterator
OnMaskIterator< NodeMask > OnIterator
Definition NodeMasks.h:348
openvdb::v13_0::util::NodeMask::set
void set(bool on)
Set all bits to the specified state.
Definition NodeMasks.h:464
openvdb::v13_0::util::NodeMask::operator!
NodeMask operator!() const
Definition NodeMasks.h:435
openvdb::v13_0::util::NodeMask::SIZE
static const Index32 SIZE
Definition NodeMasks.h:314
openvdb::v13_0::util::NodeMask::setFirstOn
void setFirstOn()
Set the first bit on.
Definition NodeMasks.h:494
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::DIM
static const Index32 DIM
Definition NodeMasks.h:313
openvdb::v13_0::util::NodeMask::endOn
OnIterator endOn() const
Definition NodeMasks.h:353
openvdb::v13_0::util::NodeMask::load
void load(std::istream &is)
Definition NodeMasks.h:569
openvdb::v13_0::util::NodeMask::operator|=
const NodeMask & operator|=(const NodeMask &other)
Bitwise union.
Definition NodeMasks.h:412
openvdb::v13_0::util::NodeMask::save
void save(std::ostream &os) const
Definition NodeMasks.h:565
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::findFirstOff
Index32 findFirstOff() const
Definition NodeMasks.h:541
openvdb::v13_0::util::NodeMask::printBits
void printBits(std::ostream &os=std::cout, Index32 max_out=80u) const
Definition NodeMasks.h:577
openvdb::v13_0::util::NodeMask::memUsage
static Index32 memUsage()
Return the byte size of this NodeMask.
Definition NodeMasks.h:441
openvdb::v13_0::util::NodeMask::setOff
void setOff()
Set all bits off.
Definition NodeMasks.h:477
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::setOff
void setOff(Index32 n)
Definition NodeMasks.h:457
openvdb::v13_0::util::NodeMask::setOn
void setOn(Index32 n)
Set the nth bit on.
Definition NodeMasks.h:452
openvdb::v13_0::util::NodeMask::operator&
NodeMask operator&(const NodeMask &other) const
Definition NodeMasks.h:436
openvdb::v13_0::util::NodeMask::isOff
bool isOff() const
Return true if all the bits are off.
Definition NodeMasks.h:517
openvdb::v13_0::util::NodeMask::operator=
NodeMask & operator=(const NodeMask &other)
Assignment operator.
Definition NodeMasks.h:340
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::LOG2DIM
static const Index32 LOG2DIM
Definition NodeMasks.h:312
openvdb::v13_0::util::NodeMask::NodeMask
NodeMask()
Default constructor sets all bits off.
Definition NodeMasks.h:332
openvdb::v13_0::util::NodeMask::NodeMask
NodeMask(const NodeMask &other)
Copy constructor.
Definition NodeMasks.h:336
openvdb::v13_0::util::NodeMask::toggle
void toggle()
Toggle the state of all bits in the mask.
Definition NodeMasks.h:488
openvdb::v13_0::util::NodeMask::printAll
void printAll(std::ostream &os=std::cout, Index32 max_out=80u) const
Definition NodeMasks.h:589
openvdb::v13_0::util::NodeMask::printInfo
void printInfo(std::ostream &os=std::cout) const
simple print method for debugging
Definition NodeMasks.h:572
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::OffIterator
OffMaskIterator< NodeMask > OffIterator
Definition NodeMasks.h:349
openvdb::v13_0::util::NodeMask::findNextOn
Index32 findNextOn(Index32 start) const
Definition NodeMasks.h:595
openvdb::v13_0::util::NodeMask::setLastOn
void setLastOn()
Set the last bit on.
Definition NodeMasks.h:496
openvdb::v13_0::util::NodeMask::~NodeMask
~NodeMask()
Destructor.
Definition NodeMasks.h:338
openvdb::v13_0::util::NodeMask::endOff
OffIterator endOff() const
Definition NodeMasks.h:355
openvdb::v13_0::util::NodeMask::isOn
bool isOn() const
Return true if all the bits are on.
Definition NodeMasks.h:510
openvdb::v13_0::util::NodeMask< LeafT::LOG2DIM >::findFirstOn
Index32 findFirstOn() const
Definition NodeMasks.h:534
openvdb::v13_0::util::OffMaskIterator
Definition NodeMasks.h:240
openvdb::v13_0::util::OffMaskIterator::operator*
bool operator*() const
Definition NodeMasks.h:260
openvdb::v13_0::util::OffMaskIterator::OffMaskIterator
OffMaskIterator()
Definition NodeMasks.h:246
openvdb::v13_0::util::OffMaskIterator::OffMaskIterator
OffMaskIterator(Index32 pos, const NodeMask *parent)
Definition NodeMasks.h:247
openvdb::v13_0::util::OffMaskIterator::next
bool next()
Definition NodeMasks.h:255
openvdb::v13_0::util::OffMaskIterator::operator++
OffMaskIterator & operator++()
Definition NodeMasks.h:261
openvdb::v13_0::util::OffMaskIterator::increment
void increment(Index n)
Definition NodeMasks.h:254
openvdb::v13_0::util::OffMaskIterator::increment
void increment()
Definition NodeMasks.h:248
openvdb::v13_0::util::OnMaskIterator
Definition NodeMasks.h:209
openvdb::v13_0::util::OnMaskIterator::operator*
bool operator*() const
Definition NodeMasks.h:229
openvdb::v13_0::util::OnMaskIterator::operator++
OnMaskIterator & operator++()
Definition NodeMasks.h:230
openvdb::v13_0::util::OnMaskIterator::next
bool next()
Definition NodeMasks.h:224
openvdb::v13_0::util::OnMaskIterator::OnMaskIterator
OnMaskIterator(Index32 pos, const NodeMask *parent)
Definition NodeMasks.h:216
openvdb::v13_0::util::OnMaskIterator::OnMaskIterator
OnMaskIterator()
Definition NodeMasks.h:215
openvdb::v13_0::util::OnMaskIterator::increment
void increment(Index n)
Definition NodeMasks.h:223
openvdb::v13_0::util::OnMaskIterator::increment
void increment()
Definition NodeMasks.h:217
openvdb::v13_0::util::CountOff
Index32 CountOff(Byte v)
Return the number of off bits in the given 8-bit value.
Definition NodeMasks.h:49
openvdb::v13_0::util::FindHighestOn
Index32 FindHighestOn(Index32 v)
Return the most significant on bit of the given 32-bit value.
Definition NodeMasks.h:159
openvdb::v13_0::util::FindLowestOn
Index32 FindLowestOn(Byte v)
Return the least significant on bit of the given 8-bit value.
Definition NodeMasks.h:85
openvdb::v13_0::util::CountOn
Index32 CountOn(Byte v)
Return the number of on bits in the given 8-bit value.
Definition NodeMasks.h:27
openvdb::v13_0::Index
Index32 Index
Definition Types.h:34
openvdb::v13_0::Byte
unsigned char Byte
Definition Types.h:39
openvdb::v13_0::Index32
uint32_t Index32
Definition Types.h:32
openvdb::v13_0::Index64
uint64_t Index64
Definition Types.h:33
openvdb
Definition Exceptions.h:13
Types.h
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:218