OpenVDB
5.2.0
|
To facilitate threading over the nodes of a tree, cache node pointers in linear arrays, one for each level of the tree. More...
#include <NodeManager.h>
Public Types | |
using | RootNodeType = typename TreeOrLeafManagerT::RootNodeType |
Public Member Functions | |
NodeManager (TreeOrLeafManagerT &tree) | |
virtual | ~NodeManager () |
void | clear () |
Clear all the cached tree nodes. More... | |
void | rebuild () |
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or removed. More... | |
const RootNodeType & | root () const |
Return a reference to the root node. More... | |
Index64 | nodeCount () const |
Return the total number of cached nodes (excluding the root node) More... | |
Index64 | nodeCount (Index i) const |
Return the number of cached nodes at level i, where 0 corresponds to the lowest level. More... | |
template<typename NodeOp > | |
void | foreachBottomUp (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. More... | |
template<typename NodeOp > | |
void | foreachTopDown (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. More... | |
template<typename NodeOp > | |
void | reduceBottomUp (NodeOp &op, bool threaded=true, size_t grainSize=1) |
Threaded method that processes nodes with a user supplied functor. More... | |
template<typename NodeOp > | |
void | reduceTopDown (NodeOp &op, bool threaded=true, size_t grainSize=1) |
Threaded method that processes nodes with a user supplied functor. More... | |
Static Public Attributes | |
static const Index | LEVELS = _LEVELS |
Protected Attributes | |
RootNodeType & | mRoot |
NodeManagerLink< typename RootNodeType::ChildNodeType, LEVELS-1 > | mChain |
To facilitate threading over the nodes of a tree, cache node pointers in linear arrays, one for each level of the tree.
This implementation works with trees of any depth, but optimized specializations are provided for the most typical tree depths.
using RootNodeType = typename TreeOrLeafManagerT::RootNodeType |
|
inline |
|
inlinevirtual |
|
inline |
Clear all the cached tree nodes.
|
inline |
Threaded method that applies a user-supplied functor to all the nodes in the tree.
op | user-supplied functor, see examples for interface details. |
threaded | optional toggle to disable threading, on by default. |
grainSize | optional parameter to specify the grainsize for threading, one by default. |
|
inline |
Threaded method that applies a user-supplied functor to all the nodes in the tree.
op | user-supplied functor, see examples for interface details. |
threaded | optional toggle to disable threading, on by default. |
grainSize | optional parameter to specify the grainsize for threading, one by default. |
|
inline |
Return the total number of cached nodes (excluding the root node)
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
|
inline |
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or removed.
|
inline |
Threaded method that processes nodes with a user supplied functor.
op | user-supplied functor, see examples for interface details. |
threaded | optional toggle to disable threading, on by default. |
grainSize | optional parameter to specify the grainsize for threading, one by default. |
|
inline |
Threaded method that processes nodes with a user supplied functor.
op | user-supplied functor, see examples for interface details. |
threaded | optional toggle to disable threading, on by default. |
grainSize | optional parameter to specify the grainsize for threading, one by default. |
|
inline |
Return a reference to the root node.
|
static |
|
protected |
|
protected |