OpenVDB
3.0.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 | |
typedef TreeOrLeafManagerT::RootNodeType | RootNodeType |
Public Member Functions | |
BOOST_STATIC_ASSERT (LEVELS > 0) | |
BOOST_STATIC_ASSERT (RootNodeType::LEVEL >=LEVELS) | |
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 | 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. More... | |
template<typename NodeOp > | |
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. 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.
typedef TreeOrLeafManagerT::RootNodeType RootNodeType |
|
inline |
|
inlinevirtual |
BOOST_STATIC_ASSERT | ( | LEVELS | , |
0 | |||
) |
BOOST_STATIC_ASSERT | ( | RootNodeType::LEVEL >= | LEVELS | ) |
|
inline |
Clear all the cached tree nodes.
|
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 |
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 |
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or removed.
|
inline |
Return a reference to the root node.
|
static |
|
protected |
|
protected |