HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType > Class Template Reference

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

#include <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. More...
 
void setThreaded (const bool threaded)
 Set whether to use multi-threading. More...
 
const tree::LeafManager
< TreeType > & 
leafManager () const
 Return a const reference to the leaf manager. More...
 
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. More...
 
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. More...
 
void copyMasks (std::vector< MaskType > &masks) const
 Copy the current node masks onto the provided vector. The vector is resized if necessary. More...
 

Detailed Description

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

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

Definition at line 154 of file Morphology.h.

Member Typedef Documentation

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::AccessorType = tree::ValueAccessor<TreeType>

Definition at line 162 of file Morphology.h.

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::LeafType = typename TreeType::LeafNodeType

Definition at line 157 of file Morphology.h.

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::MaskLeafT = typename MaskTreeT::LeafNodeType

Definition at line 161 of file Morphology.h.

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::MaskTreeT = typename TreeType::template ValueConverter<ValueMask>::Type

Definition at line 160 of file Morphology.h.

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::MaskType = typename LeafType::NodeMaskType

Definition at line 158 of file Morphology.h.

template<typename TreeType>
using openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::ValueType = typename TreeType::ValueType

Definition at line 159 of file Morphology.h.

Constructor & Destructor Documentation

template<typename TreeType>
openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::Morphology ( TreeType &  tree)
inline

Definition at line 164 of file Morphology.h.

template<typename TreeType>
openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::Morphology ( tree::LeafManager< TreeType > &  tree)
inline

Definition at line 169 of file Morphology.h.

Member Function Documentation

template<typename TreeType>
void openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::copyMasks ( std::vector< MaskType > &  masks) const
inline

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

Parameters
masksThe vector of NodeMasks to copy onto

Definition at line 214 of file Morphology.h.

template<typename TreeType >
void openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::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
iterNumber of dilation iterations
nnConnectivity pattern of the dilation
pruneWhether to collapse constant leaf nodes after the dilation
preserveMaskLeafNodesWhen 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.

Definition at line 612 of file Morphology.h.

template<typename TreeType >
void openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::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
iterNumber of erosion iterations
nnConnectivity pattern of the erosion
pruneWhether to collapse constant leaf nodes after the erosion

Definition at line 457 of file Morphology.h.

template<typename TreeType>
bool openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::getThreaded ( ) const
inline

Return whether this class is using multi-threading.

Definition at line 175 of file Morphology.h.

template<typename TreeType>
const tree::LeafManager<TreeType>& openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::leafManager ( ) const
inline

Return a const reference to the leaf manager.

Definition at line 181 of file Morphology.h.

template<typename TreeType>
void openvdb::OPENVDB_VERSION_NAME::tools::morphology::Morphology< TreeType >::setThreaded ( const bool  threaded)
inline

Set whether to use multi-threading.

Note
The grain size is not exposed

Definition at line 178 of file Morphology.h.


The documentation for this class was generated from the following file: