OpenVDB
9.0.1
|
To facilitate threading over the nodes of a tree, cache node pointers in linear arrays, one for each level of the tree. More...
#include <openvdb/tree/NodeManager.h>
Public Types | |
using | NonConstRootNodeType = typename TreeOrLeafManagerT::RootNodeType |
using | RootNodeType = typename CopyConstness< TreeOrLeafManagerT, NonConstRootNodeType >::Type |
using | NonConstChildNodeType = typename RootNodeType::ChildNodeType |
using | ChildNodeType = typename CopyConstness< TreeOrLeafManagerT, NonConstChildNodeType >::Type |
Public Member Functions | |
NodeManager (TreeOrLeafManagerT &tree, bool serial=false) | |
NodeManager (const NodeManager &)=delete | |
void | clear () |
Clear all the cached tree nodes. More... | |
void | rebuild (bool serial=false) |
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< 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 ChildNodeType = typename CopyConstness<TreeOrLeafManagerT, NonConstChildNodeType>::Type |
using NonConstChildNodeType = typename RootNodeType::ChildNodeType |
using NonConstRootNodeType = typename TreeOrLeafManagerT::RootNodeType |
using RootNodeType = typename CopyConstness<TreeOrLeafManagerT, NonConstRootNodeType>::Type |
|
inline |
|
delete |
|
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 |