This is a range and iterator class useful for multithreading computations on leaf values that require the use of multiple temporal buffers but static tree topology (i.e. only voxel values are dynamic). The internal buffer in LeafNodes is referred to as the read buffer, and the external buffers allocated by the LeafArray class are called write buffers. LeafArray::swapBuffers implements a multi-threaded method to efficiently swap the read buffer with any of the write buffers. See tools/Filter.h for an application.
More...
#include <LeafArray.h>
template<typename TreeT, int BufferCount>
class openvdb::v0_104_0::tree::LeafArray< TreeT, BufferCount >
This is a range and iterator class useful for multithreading computations on leaf values that require the use of multiple temporal buffers but static tree topology (i.e. only voxel values are dynamic). The internal buffer in LeafNodes is referred to as the read buffer, and the external buffers allocated by the LeafArray class are called write buffers. LeafArray::swapBuffers implements a multi-threaded method to efficiently swap the read buffer with any of the write buffers. See tools/Filter.h for an application.
Constructor from a Tree reference.
For each leaf node in the given range, copy the leaf node's internal buffer into its nth external write buffer.
- Parameters
-
r | the range of leaf nodes to process |
n | the index of the external write buffer |
- Note
- Consider using the non-static method copyBuffers() instead, since it supports multithreading and has a simpler API.
void copyBuffers |
( |
Index |
n = 0 , |
|
|
bool |
serial = false |
|
) |
| |
|
inline |
Copy each leaf node's internal buffer into its nth external write buffer.
- Parameters
-
n | the index of the external write buffer |
serial | if false, copy buffers in parallel using multiple threads |
Return range of the buffer-array. Needed for multithreading by tbb.
void init |
( |
TreeType & |
tree, |
|
|
bool |
sync |
|
) |
| |
|
inline |
For each leaf node in the given range, swap the leaf node's internal buffer with its nth external write buffer.
- Parameters
-
r | the range of leaf nodes to process |
n | the index of the external write buffer |
- Note
- Consider using the non-static method swapBuffers() instead, since it supports multithreading and has a simpler API.
void swapBuffers |
( |
Index |
n = 0 , |
|
|
bool |
serial = false |
|
) |
| |
|
inline |
Swap each leaf node's internal buffer with its nth external write buffer.
- Parameters
-
n | the index of the external write buffer |
serial | if false, swap buffers in parallel using multiple threads |
For each leaf node in the given range, sync the leaf node's internal buffer with all the external write buffers.
- Parameters
-
r | the range of leaf nodes to process |
- Note
- Consider using the non-static method syncBuffers() instead, since it supports multithreading and has a simpler API.
void syncBuffers |
( |
bool |
serial = false | ) |
|
|
inline |
Sync each leaf node's internal buffer with all its external write buffer.
- Parameters
-
serial | if false, sync buffers in parallel using multiple threads |
The documentation for this class was generated from the following file: