|
| template<typename IterT, typename XformOp> |
| void | foreach (const IterT &iter, XformOp &op, bool threaded=true, bool shareOp=true) |
| |
| template<typename IterT, typename XformOp> |
| void | foreach (const IterT &iter, const XformOp &op, bool threaded=true, bool shareOp=true) |
| |
| template<typename InIterT, typename OutGridT, typename XformOp> |
| | OPENVDB_UBSAN_SUPPRESS ("undefined") void transformValues(const InIterT &inIter |
| |
| template<typename IterT, typename XformOp> |
| void | accumulate (const IterT &iter, XformOp &op, bool threaded=true) |
| |
| template<typename TreeT> |
| void | setValueOnMin (TreeT &tree, const Coord &xyz, const typename TreeT::ValueType &value) |
| | Set the value of the voxel at the given coordinates in tree to the minimum of its current value and value, and mark the voxel as active.
|
| |
| template<typename TreeT> |
| void | setValueOnMax (TreeT &tree, const Coord &xyz, const typename TreeT::ValueType &value) |
| | Set the value of the voxel at the given coordinates in tree to the maximum of its current value and value, and mark the voxel as active.
|
| |
| template<typename TreeT> |
| void | setValueOnSum (TreeT &tree, const Coord &xyz, const typename TreeT::ValueType &value) |
| | Set the value of the voxel at the given coordinates in tree to the sum of its current value and value, and mark the voxel as active.
|
| |
| template<typename TreeT> |
| void | setValueOnMult (TreeT &tree, const Coord &xyz, const typename TreeT::ValueType &value) |
| | Set the value of the voxel at the given coordinates in tree to the product of its current value and value, and mark the voxel as active.
|
| |
| | if (shared) |
| |
| Processor | proc (inIter, Adapter::tree(outGrid), op, merge) |
| |
| proc | process (threaded) |
| |
- Author
- Peter Cucka
tools::foreach() and tools::transformValues() transform the values in a grid by iterating over the grid with a user-supplied iterator and applying a user-supplied functor at each step of the iteration. With tools::foreach(), the transformation is done in-place on the input grid, whereas with tools::transformValues(), transformed values are written to an output grid (which can, for example, have a different value type than the input grid). Both functions can optionally transform multiple values of the grid in parallel.
tools::accumulate() can be used to accumulate the results of applying a functor at each step of a grid iteration. (The functor is responsible for storing and updating intermediate results.) When the iteration is done serially the behavior is the same as with tools::foreach(), but when multiple values are processed in parallel, an additional step is performed: when any two threads finish processing, op.join(otherOp) is called on one thread's functor to allow it to coalesce its intermediate result with the other thread's.
Finally, tools::setValueOnMin(), tools::setValueOnMax(), tools::setValueOnSum() and tools::setValueOnMult() are wrappers around Tree::modifyValue() (or ValueAccessor::modifyValue()) for some commmon in-place operations. These are typically significantly faster than calling getValue() followed by setValue().