HDK
|
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 | 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.
Definition at line 30 of file NodeManager.h.
using openvdb::OPENVDB_VERSION_NAME::tree::NodeManager< TreeOrLeafManagerT, LEVELS >::ChildNodeType = typename CopyConstness<TreeOrLeafManagerT, NonConstChildNodeType>::Type |
Definition at line 539 of file NodeManager.h.
using openvdb::OPENVDB_VERSION_NAME::tree::NodeManager< TreeOrLeafManagerT, LEVELS >::NonConstChildNodeType = typename RootNodeType::ChildNodeType |
Definition at line 538 of file NodeManager.h.
using openvdb::OPENVDB_VERSION_NAME::tree::NodeManager< TreeOrLeafManagerT, LEVELS >::NonConstRootNodeType = typename TreeOrLeafManagerT::RootNodeType |
Definition at line 536 of file NodeManager.h.
using openvdb::OPENVDB_VERSION_NAME::tree::NodeManager< TreeOrLeafManagerT, LEVELS >::RootNodeType = typename CopyConstness<TreeOrLeafManagerT, NonConstRootNodeType>::Type |
Definition at line 537 of file NodeManager.h.
|
inline |
Definition at line 542 of file NodeManager.h.
|
delete |
|
inline |
Clear all the cached tree nodes.
Definition at line 551 of file NodeManager.h.
|
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. |
Definition at line 624 of file NodeManager.h.
|
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. |
Definition at line 631 of file NodeManager.h.
|
inline |
Return the total number of cached nodes (excluding the root node)
Definition at line 561 of file NodeManager.h.
|
inline |
Return the number of cached nodes at level i, where 0 corresponds to the lowest level.
Definition at line 565 of file NodeManager.h.
|
inline |
Clear and recache all the tree nodes from the tree. This is required if tree nodes have been added or removed.
Definition at line 555 of file NodeManager.h.
|
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. |
Definition at line 698 of file NodeManager.h.
|
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. |
Definition at line 705 of file NodeManager.h.
|
inline |
Return a reference to the root node.
Definition at line 558 of file NodeManager.h.
|
static |
Definition at line 533 of file NodeManager.h.
|
protected |
Definition at line 714 of file NodeManager.h.
|
protected |
Definition at line 713 of file NodeManager.h.