OpenVDB 11.0.0

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
Morphology< TreeType > Class Template Reference

Dilation/Erosion operations over a Trees leaf level voxel topology. More...

`#include <openvdb/tools/Morphology.h>`

## Classes
struct | NodeMaskOp
| Node Mask dilation/erosion operations for individual leaf nodes on a given tree. The leaf node may optionally belong to a different tree than the provided accessor, which will have the effect of dilating the leaf node mask into a different tree, or eroding the node mask based on corresponding neighbors in a different tree. More...

## Public Types
using | LeafType = typename TreeType::LeafNodeType
using | MaskType = typename LeafType::NodeMaskType
using | ValueType = typename TreeType::ValueType
using | MaskTreeT = typename TreeType::template ValueConverter< ValueMask >::Type
using | MaskLeafT = typename MaskTreeT::LeafNodeType
using | AccessorType = tree::ValueAccessor< TreeType >

## Public Member Functions
| Morphology (TreeType &tree)
| Morphology (tree::LeafManager< TreeType > &tree)
bool | getThreaded () const
| Return whether this class is using multi-threading.
void | setThreaded (const bool threaded)
| Set whether to use multi-threading.
const tree::LeafManager< TreeType > & | leafManager () const
| Return a const reference to the leaf manager.
void | erodeVoxels (const size_t iter, const NearestNeighbors nn, const bool prune=false)
| Topologically erode all voxels by the provided nearest neighbor scheme and optionally collapse constant leaf nodes.
void | dilateVoxels (const size_t iter, const NearestNeighbors nn, const bool prune=false, const bool preserveMaskLeafNodes=false)
| Topologically dilate all voxels by the provided nearest neighbor scheme and optionally collapse constant leaf nodes.
void | copyMasks (std::vector< MaskType > &masks) const
| Copy the current node masks onto the provided vector. The vector is resized if necessary.

## Detailed Description

template<typename TreeType>
class openvdb::v11_0::tools::morphology::Morphology< TreeType >

Dilation/Erosion operations over a Trees leaf level voxel topology.

## Member Typedef Documentation

## ◆ AccessorType

template<typename TreeType >

using AccessorType = tree::ValueAccessor<TreeType>

## ◆ LeafType

template<typename TreeType >

using LeafType = typename TreeType::LeafNodeType

## ◆ MaskLeafT

template<typename TreeType >

using MaskLeafT = typename MaskTreeT::LeafNodeType

## ◆ MaskTreeT

template<typename TreeType >

using MaskTreeT = typename TreeType::template ValueConverter<ValueMask>::Type

## ◆ MaskType

template<typename TreeType >

using MaskType = typename LeafType::NodeMaskType

## ◆ ValueType

template<typename TreeType >

using ValueType = typename TreeType::ValueType

## Constructor & Destructor Documentation

## ◆ Morphology() [1/2]

template<typename TreeType >

Morphology | ( | TreeType & | tree | ) |
| inline

## ◆ Morphology() [2/2]

template<typename TreeType >

Morphology | ( | tree::LeafManager< TreeType > & | tree | ) |
| inline

## Member Function Documentation

## ◆ copyMasks()

template<typename TreeType >

void copyMasks | ( | std::vector< MaskType > & | masks | ) | const
| inline

Copy the current node masks onto the provided vector. The vector is resized if necessary.

Parameters

  masks | The vector of NodeMasks to copy onto

## ◆ dilateVoxels()

template<typename TreeType >

void dilateVoxels | ( | const size_t | iter,
|  | const NearestNeighbors | nn,
|  | const bool | prune = `false`,
|  | const bool | preserveMaskLeafNodes = `false`
| ) |  |

Topologically dilate all voxels by the provided nearest neighbor scheme and optionally collapse constant leaf nodes.

Voxel values are unchanged and only leaf nodes are used to propagate the dilation.

Parameters

  iter | Number of dilation iterations
  nn | Connectivity pattern of the dilation
  prune | Whether to collapse constant leaf nodes after the dilation
  preserveMaskLeafNodes | When dilating mask trees, the default behaviour chooses to steal the mask nodes rather than copy them. Although faster, this means that leaf nodes may be re-allocated. Set this to true if you need the original topology pointers to be preserved.

## ◆ erodeVoxels()

template<typename TreeType >

void erodeVoxels | ( | const size_t | iter,
|  | const NearestNeighbors | nn,
|  | const bool | prune = `false`
| ) |  |

Topologically erode all voxels by the provided nearest neighbor scheme and optionally collapse constant leaf nodes.

Inactive Tiles contribute to the erosion but active tiles are not modified.

Parameters

  iter | Number of erosion iterations
  nn | Connectivity pattern of the erosion
  prune | Whether to collapse constant leaf nodes after the erosion

## ◆ getThreaded()

template<typename TreeType >

bool getThreaded | ( |  | ) | const
| inline

Return whether this class is using multi-threading.

## ◆ leafManager()

template<typename TreeType >

const tree::LeafManager< TreeType > & leafManager | ( |  | ) | const
| inline

Return a const reference to the leaf manager.

## ◆ setThreaded()

template<typename TreeType >

void setThreaded | ( | const bool | threaded | ) |
| inline

Set whether to use multi-threading.

Note
  The grain size is not exposed