OpenVDB  12.0.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
Morphology< TreeType >::NodeMaskOp Struct Reference

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...

#include <openvdb/tools/Morphology.h>

Public Types

using Word = typename std::conditional< LOG2DIM==3, uint8_t, typename std::conditional< LOG2DIM==4, uint16_t, typename std::conditional< LOG2DIM==5, uint32_t, typename std::conditional< LOG2DIM==6, uint64_t, void >::type >::type >::type >::type
 

Public Member Functions

 NodeMaskOp (AccessorType &accessor, const NearestNeighbors op)
 
void dilate (LeafType &leaf)
 Dilate a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. Neighbor leaf nodes are also updated. More...
 
void dilate (LeafType &leaf, const MaskType &mask)
 Dilate a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. The provided mask is used in place of the actual leaf's node mask and applied to the leaf afterwards. Neighbor leaf nodes are also updated. More...
 
MaskType erode (const LeafType &leaf)
 Erode a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. More...
 
void erode (const LeafType &leaf, MaskType &mask)
 Erode a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. The provided mask is used in place of the actual leaf's node mask and stores the erosion result. More...
 

Static Public Attributes

static const Int32 DIM = static_cast<Int32>(LeafType::DIM)
 
static const Int32 LOG2DIM = static_cast<Int32>(LeafType::LOG2DIM)
 

Detailed Description

template<typename TreeType>
struct openvdb::v12_0::tools::morphology::Morphology< TreeType >::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.

Member Typedef Documentation

using Word = typename std::conditional<LOG2DIM == 3, uint8_t, typename std::conditional<LOG2DIM == 4, uint16_t, typename std::conditional<LOG2DIM == 5, uint32_t, typename std::conditional<LOG2DIM == 6, uint64_t, void>::type>::type>::type>::type

Constructor & Destructor Documentation

NodeMaskOp ( AccessorType accessor,
const NearestNeighbors  op 
)
inline

Member Function Documentation

void dilate ( LeafType leaf)
inline

Dilate a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. Neighbor leaf nodes are also updated.

Unlike erode, dilate is expected to be called in a single threaded context as it will update the node masks of neighboring leaf nodes as well as the provided leaf.

Parameters
leafThe leaf to dilate. The leaf's origin and value mask are used to calculate the result of the dilation.
void dilate ( LeafType leaf,
const MaskType mask 
)
inline

Dilate a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. The provided mask is used in place of the actual leaf's node mask and applied to the leaf afterwards. Neighbor leaf nodes are also updated.

Unlike erode, dilate is expected to be called in a single threaded context as it will update the node masks of neighboring leaf nodes as well as the provided leaf.

Parameters
leafThe leaf to dilate. The leaf's origin is used to calculate the result of the dilation.
maskThe node mask to use in place of the current leaf node mask.
MaskType erode ( const LeafType leaf)
inline

Erode a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp.

Unlike dilate, this method updates the provided mask and does not apply the result to the leaf node. The leaf node is simply used to infer the position in the tree to find it's neighbors. This allows erode to be called from multiple threads

Parameters
leafThe leaf to erode. The leaf's origin is used to calculate the result of the erosion.
Returns
The eroded mask
void erode ( const LeafType leaf,
MaskType mask 
)
inline

Erode a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp. The provided mask is used in place of the actual leaf's node mask and stores the erosion result.

Unlike dilate, this method updates the provided mask and does not apply the result to the leaf node. The leaf node is simply used to infer the position in the tree to find it's neighbors.

Parameters
leafThe leaf to erode. The leaf's origin is used to calculate the result of the erosion.
maskThe node mask to use in place of the current leaf node mask.

Member Data Documentation

const Int32 DIM = static_cast<Int32>(LeafType::DIM)
static
const Int32 LOG2DIM = static_cast<Int32>(LeafType::LOG2DIM)
static