OpenVDB: NodeManager.h Source File

OpenVDB 3.1.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

NodeManager.h
Go to the documentation of this file.
1 //
3 // Copyright (c) 2012-2015 DreamWorks Animation LLC
4 //
5 // All rights reserved. This software is distributed under the
6 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
7 //
8 // Redistributions of source code must retain the above copyright
9 // and license notice and the following restrictions and disclaimer.
10 //
11 // * Neither the name of DreamWorks Animation nor the names of
12 // its contributors may be used to endorse or promote products derived
13 // from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
27 // LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
28 //
30 //
40
41 #ifndef OPENVDB_TREE_NODEMANAGER_HAS_BEEN_INCLUDED
42 #define OPENVDB_TREE_NODEMANAGER_HAS_BEEN_INCLUDED
43
44 #include <tbb/parallel_for.h>
45 #include <openvdb/Types.h>
46 #include <deque>
47
48 namespace openvdb {
49 OPENVDB_USE_VERSION_NAMESPACE
50 namespace OPENVDB_VERSION_NAME {
51 namespace tree {
52
53 // Produce linear arrays of all tree nodes, to facilitate efficient threading
54 // and bottom-up processing.
55 template<typename TreeOrLeafManagerT, Index LEVELS = TreeOrLeafManagerT::RootNodeType::LEVEL>
56 class NodeManager;
57
58
60
61
65 template<typename NodeT>
66 class NodeList
67 {
68 public:
69 typedef NodeT* value_type;
70 typedef std::deque<value_type> ListT;
71
72 NodeList() {}
73
74 void push_back(NodeT* node) { mList.push_back(node); }
75
76 NodeT& operator()(size_t n) const { assert(n<mList.size()); return *(mList[n]); }
77
78 NodeT*& operator[](size_t n) { assert(n<mList.size()); return mList[n]; }
79
80 Index64 nodeCount() const { return mList.size(); }
81
82 void clear() { mList.clear(); }
83
84 void resize(size_t n) { mList.resize(n); }
85
86 class NodeRange
87 {
88 public:
89
90 NodeRange(size_t begin, size_t end, const NodeList& nodeList, size_t grainSize=1):
91 mEnd(end), mBegin(begin), mGrainSize(grainSize), mNodeList(nodeList) {}
92
93 NodeRange(NodeRange& r, tbb::split):
94 mEnd(r.mEnd), mBegin(doSplit(r)), mGrainSize(r.mGrainSize),
95 mNodeList(r.mNodeList) {}
96
97 size_t size() const { return mEnd - mBegin; }
98
99 size_t grainsize() const { return mGrainSize; }
100
101 const NodeList& nodeList() const { return mNodeList; }
102
103 bool empty() const {return !(mBegin < mEnd);}
104
105 bool is_divisible() const {return mGrainSize < this->size();}
106
107 class Iterator
108 {
109 public:
110 Iterator(const NodeRange& range, size_t pos): mRange(range), mPos(pos)
111 {
112 assert(this->isValid());
113 }
114 Iterator& operator=(const Iterator& other)
115 {
116 mRange = other.mRange; mPos = other.mPos; return *this;
117 }
119 Iterator& operator++() { ++mPos; return *this; }
121 NodeT& operator*() const { return mRange.mNodeList(mPos); }
123 NodeT* operator->() const { return &(this->operator*()); }
125 size_t pos() const { return mPos; }
126 bool isValid() const { return mPos>=mRange.mBegin && mPos<=mRange.mEnd; }
128 bool test() const { return mPos < mRange.mEnd; }
130 operator bool() const { return this->test(); }
132 bool empty() const { return !this->test(); }
133 bool operator!=(const Iterator& other) const
134 {
135 return (mPos != other.mPos) || (&mRange != &other.mRange);
136 }
137 bool operator==(const Iterator& other) const { return !(*this != other); }
138 const NodeRange& nodeRange() const { return mRange; }
139
140 private:
141 const NodeRange& mRange;
142 size_t mPos;
143 };// NodeList::NodeRange::Iterator
144
145 Iterator begin() const {return Iterator(*this, mBegin);}
146
147 Iterator end() const {return Iterator(*this, mEnd);}
148
149 private:
150 size_t mEnd, mBegin, mGrainSize;
151 const NodeList& mNodeList;
152
153 static size_t doSplit(NodeRange& r)
154 {
155 assert(r.is_divisible());
156 size_t middle = r.mBegin + (r.mEnd - r.mBegin) / 2u;
157 r.mEnd = middle;
158 return middle;
159 }
160 };// NodeList::NodeRange
161
163 NodeRange nodeRange(size_t grainsize = 1) const
164 {
165 return NodeRange(0, this->nodeCount(), *this, grainsize);
166 }
167
168 template<typename NodeOp>
169 struct NodeTransformer
170 {
171 NodeTransformer(const NodeOp& nodeOp) : mNodeOp(nodeOp) {}
172 void run(const NodeRange& range, bool threaded = true)
173 {
174 threaded ? tbb::parallel_for(range, *this) : (*this)(range);
175 }
176 void operator()(const NodeRange& range) const
177 {
178 for (typename NodeRange::Iterator it = range.begin(); it; ++it) mNodeOp(*it);
179 }
180 const NodeOp mNodeOp;
181 };// NodeRange
182
183 template<typename NodeOp>
184 void foreach(const NodeOp& op, bool threaded = true, size_t grainSize=1)
185 {
186 NodeTransformer<NodeOp> transform(op);
187 transform.run(this->nodeRange(grainSize), threaded);
188 }
189
190 protected:
191 ListT mList;
192 };// NodeList
193
194
196
197
202 template<typename NodeT, Index LEVEL>
203 class NodeManagerLink
204 {
205 public:
206 NodeManagerLink() {}
207
208 virtual ~NodeManagerLink() {}
209
210 void clear() { mList.clear(); mNext.clear(); }
211
212 template<typename ParentT, typename TreeOrLeafManagerT>
213 void init(ParentT& parent, TreeOrLeafManagerT& tree)
214 {
215 parent.getNodes(mList);
216 for (size_t i=0, n=mList.nodeCount(); i<n; ++i) mNext.init(mList(i), tree);
217 }
218
219 template<typename ParentT>
220 void rebuild(ParentT& parent)
221 {
222 mList.clear();
223 parent.getNodes(mList);
224 for (size_t i=0, n=mList.nodeCount(); i<n; ++i) mNext.rebuild(mList(i));
225 }
226
227 Index64 nodeCount() const { return mList.nodeCount() + mNext.nodeCount(); }
228
229 Index64 nodeCount(Index i) const
230 {
231 return i==NodeT::LEVEL ? mList.nodeCount() : mNext.nodeCount(i);
232 }
233
234 template<typename NodeOp>
235 void processBottomUp(const NodeOp& op, bool threaded, size_t grainSize)
236 {
237 mNext.processBottomUp(op, threaded, grainSize);
238 mList.foreach(op, threaded, grainSize);
239 }
240
241 template<typename NodeOp>
242 void processTopDown(const NodeOp& op, bool threaded, size_t grainSize)
243 {
244 mList.foreach(op, threaded, grainSize);
245 mNext.processTopDown(op, threaded, grainSize);
246 }
247
248 protected:
249 NodeList<NodeT> mList;
250 NodeManagerLink<typename NodeT::ChildNodeType, LEVEL-1> mNext;
251 };// NodeManagerLink class
252
253
255
256
260 template<typename NodeT>
261 class NodeManagerLink<NodeT, 0>
262 {
263 public:
264 NodeManagerLink() {}
265
266 virtual ~NodeManagerLink() {}
267
269 void clear() { mList.clear(); }
270
271 template<typename ParentT>
272 void rebuild(ParentT& parent) { mList.clear(); parent.getNodes(mList); }
273
274 Index64 nodeCount() const { return mList.nodeCount(); }
275
276 Index64 nodeCount(Index) const { return mList.nodeCount(); }
277
278 template<typename NodeOp>
279 void processBottomUp(const NodeOp& op, bool threaded, size_t grainSize)
280 {
281 mList.foreach(op, threaded, grainSize);
282 }
283
284 template<typename NodeOp>
285 void processTopDown(const NodeOp& op, bool threaded, size_t grainSize)
286 {
287 mList.foreach(op, threaded, grainSize);
288 }
289
290 template<typename ParentT, typename TreeOrLeafManagerT>
291 void init(ParentT& parent, TreeOrLeafManagerT& tree)
292 {
293 OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
294 if (TreeOrLeafManagerT::DEPTH == 2 && NodeT::LEVEL == 0) {
295 tree.getNodes(mList);
296 } else {
297 parent.getNodes(mList);
298 }
299 OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
300 }
301 protected:
302 NodeList<NodeT> mList;
303 };// NodeManagerLink class
304
305
307
308
314 template<typename TreeOrLeafManagerT, Index _LEVELS>
315 class NodeManager
316 {
317 public:
318 static const Index LEVELS = _LEVELS;
319 BOOST_STATIC_ASSERT(LEVELS > 0);//special implementation below
320 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
321 BOOST_STATIC_ASSERT(RootNodeType::LEVEL >= LEVELS);
322
323 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root()) { mChain.init(mRoot, tree); }
324
325 virtual ~NodeManager() {}
326
328 void clear() { mChain.clear(); }
329
332 void rebuild() { mChain.rebuild(mRoot); }
333
335 const RootNodeType& root() const { return mRoot; }
336
338 Index64 nodeCount() const { return mChain.nodeCount(); }
339
342 Index64 nodeCount(Index i) const { return mChain.nodeCount(i); }
343
345 template<typename NodeOp>
401 void processBottomUp(const NodeOp& op, bool threaded = true, size_t grainSize=1)
402 {
403 mChain.processBottomUp(op, threaded, grainSize);
404 op(mRoot);
405 }
406
407 template<typename NodeOp>
408 void processTopDown(const NodeOp& op, bool threaded = true, size_t grainSize=1)
409 {
410 op(mRoot);
411 mChain.processTopDown(op, threaded, grainSize);
412 }
414
415 protected:
416 RootNodeType& mRoot;
417 NodeManagerLink<typename RootNodeType::ChildNodeType, LEVELS-1> mChain;
418
419 private:
420 NodeManager(const NodeManager&) {}//disallow copy-construction
421 };// NodeManager class
422
423
425
426
428 template<typename TreeOrLeafManagerT>
429 class NodeManager<TreeOrLeafManagerT, 0>
430 {
431 public:
432 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
433 static const Index LEVELS = 0;
434
435 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root()) {}
436
437 virtual ~NodeManager() {}
438
440 void clear() {}
441
444 void rebuild() {}
445
447 const RootNodeType& root() const { return mRoot; }
448
450 Index64 nodeCount() const { return 0; }
451
452 Index64 nodeCount(Index) const { return 0; }
453
454 template<typename NodeOp>
455 void processBottomUp(const NodeOp& op, bool, size_t) { op(mRoot); }
456
457 template<typename NodeOp>
458 void processTopDown(const NodeOp& op, bool, size_t) { op(mRoot); }
459
460 protected:
461 RootNodeType& mRoot;
462
463 private:
464 NodeManager(const NodeManager&) {} // disallow copy-construction
465 }; // NodeManager<0>
466
467
469
470
472 template<typename TreeOrLeafManagerT>
473 class NodeManager<TreeOrLeafManagerT, 1>
474 {
475 public:
476 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
477 BOOST_STATIC_ASSERT(RootNodeType::LEVEL > 0);
478 static const Index LEVELS = 1;
479
480 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root())
481 {
482 OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
483 if (TreeOrLeafManagerT::DEPTH == 2 && NodeT0::LEVEL == 0) {
484 tree.getNodes(mList0);
485 } else {
486 mRoot.getNodes(mList0);
487 }
488 OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
489 }
490
491 virtual ~NodeManager() {}
492
494 void clear() { mList0.clear(); }
495
498 void rebuild() { mList0.clear(); mRoot.getNodes(mList0); }
499
501 const RootNodeType& root() const { return mRoot; }
502
504 Index64 nodeCount() const { return mList0.nodeCount(); }
505
508 Index64 nodeCount(Index i) const { return i==0 ? mList0.nodeCount() : 0; }
509
510 template<typename NodeOp>
511 void processBottomUp(const NodeOp& op, bool threaded = true, size_t grainSize=1)
512 {
513 mList0.foreach(op, threaded, grainSize);
514 op(mRoot);
515 }
516
517 template<typename NodeOp>
518 void processTopDown(const NodeOp& op, bool threaded = true, size_t grainSize=1)
519 {
520 op(mRoot);
521 mList0.foreach(op, threaded, grainSize);
522 }
523
524 protected:
525 typedef RootNodeType NodeT1;
526 typedef typename NodeT1::ChildNodeType NodeT0;
527 typedef NodeList<NodeT0> ListT0;
528
529 NodeT1& mRoot;
530 ListT0 mList0;
531
532 private:
533 NodeManager(const NodeManager&) {} // disallow copy-construction
534 }; // NodeManager<1>
535
536
538
539
541 template<typename TreeOrLeafManagerT>
542 class NodeManager<TreeOrLeafManagerT, 2>
543 {
544 public:
545 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
546 BOOST_STATIC_ASSERT(RootNodeType::LEVEL > 1);
547 static const Index LEVELS = 2;
548
549 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root())
550 {
551 mRoot.getNodes(mList1);
552
553 OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
554 if (TreeOrLeafManagerT::DEPTH == 2 && NodeT0::LEVEL == 0) {
555 tree.getNodes(mList0);
556 } else {
557 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
558 }
559 OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
560 }
561
562 virtual ~NodeManager() {}
563
565 void clear() { mList0.clear(); mList1.clear(); }
566
569 void rebuild()
570 {
571 this->clear();
572 mRoot.getNodes(mList1);
573 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
574 }
575
577 const RootNodeType& root() const { return mRoot; }
578
580 Index64 nodeCount() const { return mList0.nodeCount() + mList1.nodeCount(); }
581
584 Index64 nodeCount(Index i) const
585 {
586 return i==0 ? mList0.nodeCount() : i==1 ? mList1.nodeCount() : 0;
587 }
588
589 template<typename NodeOp>
590 void processBottomUp(const NodeOp& op, bool threaded = true, size_t grainSize=1)
591 {
592 mList0.foreach(op, threaded, grainSize);
593 mList1.foreach(op, threaded, grainSize);
594 op(mRoot);
595 }
596
597 template<typename NodeOp>
598 void processTopDown(const NodeOp& op, bool threaded = true, size_t grainSize=1)
599 {
600 op(mRoot);
601 mList1.foreach(op, threaded, grainSize);
602 mList0.foreach(op, threaded, grainSize);
603 }
604
605 protected:
606 typedef RootNodeType NodeT2;
607 typedef typename NodeT2::ChildNodeType NodeT1;//upper level
608 typedef typename NodeT1::ChildNodeType NodeT0;//lower level
609
610 typedef NodeList<NodeT1> ListT1;//upper level
611 typedef NodeList<NodeT0> ListT0;//lower level
612
613 NodeT2& mRoot;
614 ListT1 mList1;
615 ListT0 mList0;
616
617 private:
618 NodeManager(const NodeManager&) {} // disallow copy-construction
619 }; // NodeManager<2>
620
621
623
624
626 template<typename TreeOrLeafManagerT>
627 class NodeManager<TreeOrLeafManagerT, 3>
628 {
629 public:
630 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
631 BOOST_STATIC_ASSERT(RootNodeType::LEVEL > 2);
632 static const Index LEVELS = 3;
633
634 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root())
635 {
636 mRoot.getNodes(mList2);
637 for (size_t i=0, n=mList2.nodeCount(); i<n; ++i) mList2(i).getNodes(mList1);
638
639 OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
640 if (TreeOrLeafManagerT::DEPTH == 2 && NodeT0::LEVEL == 0) {
641 tree.getNodes(mList0);
642 } else {
643 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
644 }
645 OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
646 }
647
648 virtual ~NodeManager() {}
649
651 void clear() { mList0.clear(); mList1.clear(); mList2.clear(); }
652
655 void rebuild()
656 {
657 this->clear();
658 mRoot.getNodes(mList2);
659 for (size_t i=0, n=mList2.nodeCount(); i<n; ++i) mList2(i).getNodes(mList1);
660 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
661 }
662
664 const RootNodeType& root() const { return mRoot; }
665
667 Index64 nodeCount() const { return mList0.nodeCount()+mList1.nodeCount()+mList2.nodeCount(); }
668
671 Index64 nodeCount(Index i) const
672 {
673 return i==0 ? mList0.nodeCount() : i==1 ? mList1.nodeCount()
674 : i==2 ? mList2.nodeCount() : 0;
675 }
676
677 template<typename NodeOp>
678 void processBottomUp(const NodeOp& op, bool threaded = true, size_t grainSize=1)
679 {
680 mList0.foreach(op, threaded, grainSize);
681 mList1.foreach(op, threaded, grainSize);
682 mList2.foreach(op, threaded, grainSize);
683 op(mRoot);
684 }
685
686 template<typename NodeOp>
687 void processTopDown(const NodeOp& op, bool threaded = true, size_t grainSize=1)
688 {
689 op(mRoot);
690 mList2.foreach(op, threaded, grainSize);
691 mList1.foreach(op, threaded, grainSize);
692 mList0.foreach(op, threaded, grainSize);
693 }
694
695 protected:
696 typedef RootNodeType NodeT3;
697 typedef typename NodeT3::ChildNodeType NodeT2;//upper level
698 typedef typename NodeT2::ChildNodeType NodeT1;//mid level
699 typedef typename NodeT1::ChildNodeType NodeT0;//lower level
700
701 typedef NodeList<NodeT2> ListT2;//upper level of internal nodes
702 typedef NodeList<NodeT1> ListT1;//lower level of internal nodes
703 typedef NodeList<NodeT0> ListT0;//lower level of internal nodes or leafs
704
705 NodeT3& mRoot;
706 ListT2 mList2;
707 ListT1 mList1;
708 ListT0 mList0;
709
710 private:
711 NodeManager(const NodeManager&) {} // disallow copy-construction
712 }; // NodeManager<3>
713
714
716
717
719 template<typename TreeOrLeafManagerT>
720 class NodeManager<TreeOrLeafManagerT, 4>
721 {
722 public:
723 typedef typename TreeOrLeafManagerT::RootNodeType RootNodeType;
724 BOOST_STATIC_ASSERT(RootNodeType::LEVEL > 3);
725 static const Index LEVELS = 4;
726
727 NodeManager(TreeOrLeafManagerT& tree) : mRoot(tree.root())
728 {
729 mRoot.getNodes(mList3);
730 for (size_t i=0, n=mList3.nodeCount(); i<n; ++i) mList3(i).getNodes(mList2);
731 for (size_t i=0, n=mList2.nodeCount(); i<n; ++i) mList2(i).getNodes(mList1);
732
733 OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
734 if (TreeOrLeafManagerT::DEPTH == 2 && NodeT0::LEVEL == 0) {
735 tree.getNodes(mList0);
736 } else {
737 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
738 }
739 OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
740 }
741
742 virtual ~NodeManager() {}
743
745 void clear() { mList0.clear(); mList1.clear(); mList2.clear(); mList3.clear; }
746
749 void rebuild()
750 {
751 this->clear();
752 mRoot.getNodes(mList3);
753 for (size_t i=0, n=mList3.nodeCount(); i<n; ++i) mList3(i).getNodes(mList2);
754 for (size_t i=0, n=mList2.nodeCount(); i<n; ++i) mList2(i).getNodes(mList1);
755 for (size_t i=0, n=mList1.nodeCount(); i<n; ++i) mList1(i).getNodes(mList0);
756 }
757
759 const RootNodeType& root() const { return mRoot; }
760
762 Index64 nodeCount() const
763 {
764 return mList0.nodeCount() + mList1.nodeCount()
765 + mList2.nodeCount() + mList3.nodeCount();
766 }
767
770 Index64 nodeCount(Index i) const
771 {
772 return i==0 ? mList0.nodeCount() : i==1 ? mList1.nodeCount() :
773 i==2 ? mList2.nodeCount() : i==3 ? mList3.nodeCount() : 0;
774 }
775
776 template<typename NodeOp>
777 void processBottomUp(const NodeOp& op, bool threaded = true, size_t grainSize=1)
778 {
779 mList0.foreach(op, threaded, grainSize);
780 mList1.foreach(op, threaded, grainSize);
781 mList2.foreach(op, threaded, grainSize);
782 mList3.foreach(op, threaded, grainSize);
783 op(mRoot);
784 }
785
786 template<typename NodeOp>
787 void processTopDown(const NodeOp& op, bool threaded = true, size_t grainSize=1)
788 {
789 op(mRoot);
790 mList3.foreach(op, threaded, grainSize);
791 mList2.foreach(op, threaded, grainSize);
792 mList1.foreach(op, threaded, grainSize);
793 mList0.foreach(op, threaded, grainSize);
794 }
795
796 protected:
797 typedef RootNodeType NodeT4;
798 typedef typename NodeT4::ChildNodeType NodeT3;//upper level
799 typedef typename NodeT3::ChildNodeType NodeT2;//upper mid level
800 typedef typename NodeT2::ChildNodeType NodeT1;//lower mid level
801 typedef typename NodeT1::ChildNodeType NodeT0;//lower level
802
803 typedef NodeList<NodeT3> ListT3;//upper level of internal nodes
804 typedef NodeList<NodeT2> ListT2;//upper mid level of internal nodes
805 typedef NodeList<NodeT1> ListT1;//lower mid level of internal nodes
806 typedef NodeList<NodeT0> ListT0;//lower level of internal nodes or leafs
807
808 NodeT4& mRoot;
809 ListT3 mList3;
810 ListT2 mList2;
811 ListT1 mList1;
812 ListT0 mList0;
813
814 private:
815 NodeManager(const NodeManager&) {} // disallow copy-construction
816 }; // NodeManager<4>
817
818 } // namespace tree
819 } // namespace OPENVDB_VERSION_NAME
820 } // namespace openvdb
821
822 #endif // OPENVDB_TREE_NODEMANAGER_HAS_BEEN_INCLUDED
823
824 // Copyright (c) 2012-2015 DreamWorks Animation LLC
825 // All rights reserved. This software is distributed under the
826 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::nodeCount
Index64 nodeCount(Index i) const
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition: NodeManager.h:671
openvdb::v3_1_0::tree::NodeList::NodeRange::nodeList
const NodeList & nodeList() const
Definition: NodeManager.h:101
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::processTopDown
void processTopDown(const NodeOp &op, bool, size_t)
Definition: NodeManager.h:458
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:498
openvdb::v3_1_0::math::operator*
Mat3< typename promote< T0, T1 >::type > operator*(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Matrix multiplication.
Definition: Mat3.h:608
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:504
openvdb::v3_1_0::tree::NodeList::operator[]
NodeT *& operator[](size_t n)
Definition: NodeManager.h:78
openvdb::v3_1_0::tree::NodeManager::processTopDown
void processTopDown(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Threaded method that applies a user-supplied functor to all the nodes in the tree.
Definition: NodeManager.h:408
openvdb::v3_1_0::Index
Index32 Index
Definition: Types.h:58
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:444
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::rebuild
void rebuild(ParentT &parent)
Definition: NodeManager.h:272
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeT2
NodeT3::ChildNodeType NodeT2
Definition: NodeManager.h:799
openvdb::v3_1_0::tree::NodeList::NodeRange::empty
bool empty() const
Definition: NodeManager.h:103
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::isValid
bool isValid() const
Definition: NodeManager.h:126
openvdb::v3_1_0::tree::NodeList::ListT
std::deque< value_type > ListT
Definition: NodeManager.h:70
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeT3
NodeT4::ChildNodeType NodeT3
Definition: NodeManager.h:798
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::NodeT0
NodeT1::ChildNodeType NodeT0
Definition: NodeManager.h:608
Types.h
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::processTopDown
void processTopDown(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:598
openvdb::v3_1_0::tree::NodeManager::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:338
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::processTopDown
void processTopDown(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:518
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:745
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::mRoot
NodeT3 & mRoot
Definition: NodeManager.h:705
openvdb::v3_1_0::tree::NodeList::NodeRange::is_divisible
bool is_divisible() const
Definition: NodeManager.h:105
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:437
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::NodeT2
NodeT3::ChildNodeType NodeT2
Definition: NodeManager.h:697
openvdb::v3_1_0::tree::NodeList::NodeRange::begin
Iterator begin() const
Definition: NodeManager.h:145
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:651
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:491
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator
Definition: NodeManager.h:107
openvdb::v3_1_0::tree::NodeManager::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Threaded method that applies a user-supplied functor to all the nodes in the tree.
Definition: NodeManager.h:401
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::processTopDown
void processTopDown(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:687
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:511
openvdb::v3_1_0::tree::NodeList::NodeTransformer::NodeTransformer
NodeTransformer(const NodeOp &nodeOp)
Definition: NodeManager.h:171
openvdb::v3_1_0::tree::NodeManagerLink::clear
void clear()
Definition: NodeManager.h:210
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:634
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::processTopDown
void processTopDown(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:787
openvdb::v3_1_0::tree::NodeManagerLink::rebuild
void rebuild(ParentT &parent)
Definition: NodeManager.h:220
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::mList
NodeList< NodeT > mList
Definition: NodeManager.h:302
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:565
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:678
openvdb::v3_1_0::tree::NodeList::operator()
NodeT & operator()(size_t n) const
Definition: NodeManager.h:76
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:742
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:545
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:777
openvdb::v3_1_0::tree::NodeManagerLink::nodeCount
Index64 nodeCount(Index i) const
Definition: NodeManager.h:229
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:759
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:727
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::NodeT1
NodeT2::ChildNodeType NodeT1
Definition: NodeManager.h:698
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::nodeCount
Index64 nodeCount(Index i) const
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition: NodeManager.h:508
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:655
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::mRoot
NodeT2 & mRoot
Definition: NodeManager.h:613
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:648
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::ListT2
NodeList< NodeT2 > ListT2
Definition: NodeManager.h:701
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::mList1
ListT1 mList1
Definition: NodeManager.h:707
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::mList0
ListT0 mList0
Definition: NodeManager.h:530
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:562
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:664
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:480
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeT1
NodeT2::ChildNodeType NodeT1
Definition: NodeManager.h:800
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::ListT2
NodeList< NodeT2 > ListT2
Definition: NodeManager.h:804
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::mList1
ListT1 mList1
Definition: NodeManager.h:811
openvdb::v3_1_0::tree::NodeList::NodeTransformer::operator()
void operator()(const NodeRange &range) const
Definition: NodeManager.h:176
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:435
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:749
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::ListT1
NodeList< NodeT1 > ListT1
Definition: NodeManager.h:805
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator++
Iterator & operator++()
Advance to the next node.
Definition: NodeManager.h:119
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::NodeT0
NodeT1::ChildNodeType NodeT0
Definition: NodeManager.h:526
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::mRoot
RootNodeType & mRoot
Definition: NodeManager.h:461
openvdb::v3_1_0::tree::NodeManagerLink::mList
NodeList< NodeT > mList
Definition: NodeManager.h:249
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::ListT1
NodeList< NodeT1 > ListT1
Definition: NodeManager.h:702
openvdb::v3_1_0::tree::NodeList::NodeTransformer::mNodeOp
const NodeOp mNodeOp
Definition: NodeManager.h:180
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::NodeT0
NodeT1::ChildNodeType NodeT0
Definition: NodeManager.h:699
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator=
Iterator & operator=(const Iterator &other)
Definition: NodeManager.h:114
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:549
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::mRoot
NodeT1 & mRoot
Definition: NodeManager.h:529
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::ListT3
NodeList< NodeT3 > ListT3
Definition: NodeManager.h:803
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeT0
NodeT1::ChildNodeType NodeT0
Definition: NodeManager.h:801
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::ListT1
NodeList< NodeT1 > ListT1
Definition: NodeManager.h:610
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
Definition: version.h:43
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::empty
bool empty() const
Return true if this iterator is exhausted.
Definition: NodeManager.h:132
openvdb::v3_1_0::tree::NodeList::NodeRange::size
size_t size() const
Definition: NodeManager.h:97
openvdb::v3_1_0::tree::NodeList::NodeRange::grainsize
size_t grainsize() const
Definition: NodeManager.h:99
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded, size_t grainSize)
Definition: NodeManager.h:279
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:723
openvdb::v3_1_0::tree::NodeList::nodeRange
NodeRange nodeRange(size_t grainsize=1) const
Return a TBB-compatible NodeRange.
Definition: NodeManager.h:163
openvdb::v3_1_0::tree::NodeManager::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:335
openvdb::v3_1_0::tree::NodeManager::nodeCount
Index64 nodeCount(Index i) const
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition: NodeManager.h:342
openvdb::v3_1_0::tree::NodeList::NodeRange::NodeRange
NodeRange(NodeRange &r, tbb::split)
Definition: NodeManager.h:93
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::pos
size_t pos() const
Return the index into the list of the current node.
Definition: NodeManager.h:125
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::nodeCount
Index64 nodeCount(Index) const
Definition: NodeManager.h:452
openvdb::v3_1_0::tree::NodeList::NodeRange
Definition: NodeManager.h:86
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::~NodeManagerLink
virtual ~NodeManagerLink()
Definition: NodeManager.h:266
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::ListT0
NodeList< NodeT0 > ListT0
Definition: NodeManager.h:527
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::Iterator
Iterator(const NodeRange &range, size_t pos)
Definition: NodeManager.h:110
openvdb::v3_1_0::tree::NodeManager::NodeManager
NodeManager(TreeOrLeafManagerT &tree)
Definition: NodeManager.h:323
openvdb
Definition: Exceptions.h:39
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::NodeT4
RootNodeType NodeT4
Definition: NodeManager.h:797
openvdb::v3_1_0::tree::NodeManager::~NodeManager
virtual ~NodeManager()
Definition: NodeManager.h:325
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::mList3
ListT3 mList3
Definition: NodeManager.h:809
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:630
OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
Definition: Platform.h:129
openvdb::v3_1_0::tree::NodeManagerLink::nodeCount
Index64 nodeCount() const
Definition: NodeManager.h:227
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:432
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::init
void init(ParentT &parent, TreeOrLeafManagerT &tree)
Definition: NodeManager.h:291
openvdb::v3_1_0::tree::NodeList::nodeCount
Index64 nodeCount() const
Definition: NodeManager.h:80
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:569
openvdb::v3_1_0::tree::NodeManagerLink
This class is a link in a chain that each caches tree nodes of a specific type in a linear array...
Definition: NodeManager.h:203
openvdb::v3_1_0::tree::NodeList::value_type
NodeT * value_type
Definition: NodeManager.h:69
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:476
openvdb::v3_1_0::tree::NodeManagerLink::init
void init(ParentT &parent, TreeOrLeafManagerT &tree)
Definition: NodeManager.h:213
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:269
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::nodeCount
Index64 nodeCount(Index i) const
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition: NodeManager.h:584
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::test
bool test() const
Return true if this iterator is not yet exhausted.
Definition: NodeManager.h:128
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::nodeRange
const NodeRange & nodeRange() const
Definition: NodeManager.h:138
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:762
openvdb::v3_1_0::tree::NodeManager::RootNodeType
TreeOrLeafManagerT::RootNodeType RootNodeType
Definition: NodeManager.h:320
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::nodeCount
Index64 nodeCount() const
Definition: NodeManager.h:274
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::NodeT3
RootNodeType NodeT3
Definition: NodeManager.h:696
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::NodeManagerLink
NodeManagerLink()
Definition: NodeManager.h:264
openvdb::v3_1_0::tree::NodeManagerLink::~NodeManagerLink
virtual ~NodeManagerLink()
Definition: NodeManager.h:208
openvdb::v3_1_0::tree::NodeManagerLink::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded, size_t grainSize)
Definition: NodeManager.h:235
openvdb::v3_1_0::tree::NodeList::NodeRange::NodeRange
NodeRange(size_t begin, size_t end, const NodeList &nodeList, size_t grainSize=1)
Definition: NodeManager.h:90
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::mList2
ListT2 mList2
Definition: NodeManager.h:810
openvdb::v3_1_0::tree::NodeList::NodeList
NodeList()
Definition: NodeManager.h:72
openvdb::v3_1_0::tree::NodeManagerLink::processTopDown
void processTopDown(const NodeOp &op, bool threaded, size_t grainSize)
Definition: NodeManager.h:242
OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
Definition: Platform.h:130
openvdb::v3_1_0::tree::NodeManagerLink::mNext
NodeManagerLink< typename NodeT::ChildNodeType, LEVEL-1 > mNext
Definition: NodeManager.h:250
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::mList2
ListT2 mList2
Definition: NodeManager.h:706
openvdb::v3_1_0::tree::NodeManager
To facilitate threading over the nodes of a tree, cache node pointers in linear arrays, one for each level of the tree.
Definition: NodeManager.h:56
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:667
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator!=
bool operator!=(const Iterator &other) const
Definition: NodeManager.h:133
openvdb::v3_1_0::tree::NodeManager::mChain
NodeManagerLink< typename RootNodeType::ChildNodeType, LEVELS-1 > mChain
Definition: NodeManager.h:417
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:494
openvdb::v3_1_0::tree::NodeList
This class caches tree nodes of a specific type in a linear array.
Definition: NodeManager.h:66
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::NodeT1
NodeT2::ChildNodeType NodeT1
Definition: NodeManager.h:607
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::mRoot
NodeT4 & mRoot
Definition: NodeManager.h:808
openvdb::v3_1_0::Index64
uint64_t Index64
Definition: Types.h:57
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:577
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:440
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::ListT0
NodeList< NodeT0 > ListT0
Definition: NodeManager.h:703
openvdb::v3_1_0::tree::NodeList::mList
ListT mList
Definition: NodeManager.h:191
openvdb::v3_1_0::tree::NodeList::NodeRange::end
Iterator end() const
Definition: NodeManager.h:147
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::ListT0
NodeList< NodeT0 > ListT0
Definition: NodeManager.h:611
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::ListT0
NodeList< NodeT0 > ListT0
Definition: NodeManager.h:806
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::NodeT1
RootNodeType NodeT1
Definition: NodeManager.h:525
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator->
NodeT * operator->() const
Return a pointer to the node to which this iterator is pointing.
Definition: NodeManager.h:123
openvdb::v3_1_0::tree::NodeManager::mRoot
RootNodeType & mRoot
Definition: NodeManager.h:416
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::processBottomUp
void processBottomUp(const NodeOp &op, bool threaded=true, size_t grainSize=1)
Definition: NodeManager.h:590
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator==
bool operator==(const Iterator &other) const
Definition: NodeManager.h:137
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::mList0
ListT0 mList0
Definition: NodeManager.h:615
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::processTopDown
void processTopDown(const NodeOp &op, bool threaded, size_t grainSize)
Definition: NodeManager.h:285
openvdb::v3_1_0::tree::NodeList::NodeTransformer
Definition: NodeManager.h:169
openvdb::v3_1_0::tree::NodeList::NodeRange::Iterator::operator*
NodeT & operator*() const
Return a reference to the node to which this iterator is pointing.
Definition: NodeManager.h:121
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::NodeT2
RootNodeType NodeT2
Definition: NodeManager.h:606
openvdb::v3_1_0::tree::NodeList::resize
void resize(size_t n)
Definition: NodeManager.h:84
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::processBottomUp
void processBottomUp(const NodeOp &op, bool, size_t)
Definition: NodeManager.h:455
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:447
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::nodeCount
Index64 nodeCount(Index i) const
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition: NodeManager.h:770
openvdb::v3_1_0::tree::NodeManagerLink< NodeT, 0 >::nodeCount
Index64 nodeCount(Index) const
Definition: NodeManager.h:276
openvdb::v3_1_0::tree::NodeList::NodeTransformer::run
void run(const NodeRange &range, bool threaded=true)
Definition: NodeManager.h:172
openvdb::v3_1_0::tree::NodeList::clear
void clear()
Definition: NodeManager.h:82
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::mList1
ListT1 mList1
Definition: NodeManager.h:614
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 3 >::mList0
ListT0 mList0
Definition: NodeManager.h:708
openvdb::v3_1_0::tree::NodeList::push_back
void push_back(NodeT *node)
Definition: NodeManager.h:74
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 1 >::root
const RootNodeType & root() const
Return a reference to the root node.
Definition: NodeManager.h:501
openvdb::v3_1_0::tree::NodeManagerLink::NodeManagerLink
NodeManagerLink()
Definition: NodeManager.h:206
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 2 >::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:580
openvdb::v3_1_0::tree::NodeManager::clear
void clear()
Clear all the cached tree nodes.
Definition: NodeManager.h:328
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 4 >::mList0
ListT0 mList0
Definition: NodeManager.h:812
openvdb::v3_1_0::tree::NodeManager< TreeOrLeafManagerT, 0 >::nodeCount
Index64 nodeCount() const
Return the total number of cached nodes (excluding the root node)
Definition: NodeManager.h:450
openvdb::v3_1_0::tree::NodeManager::rebuild
void rebuild()
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or...
Definition: NodeManager.h:332