OpenVDB: Morphology< TreeType >::NodeMaskOp Struct Reference

OpenVDB 12.0.1 |

Loading...
Searching...
No Matches
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

## 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.
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.
MaskType | erode (const LeafType &leaf)
| Erode a single leaf node by the current spatial scheme stored on the instance of this NodeMaskOp.
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.

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

## ◆ Word

template<typename TreeType>

using Word

Initial value:
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
openvdb::v12_0::tools::morphology::Morphology::NodeMaskOp::LOG2DIM
static const Int32 LOG2DIM
Definition Morphology.h:245

## Constructor & Destructor Documentation

## ◆ NodeMaskOp()

template<typename TreeType>

NodeMaskOp | ( | AccessorType & | accessor,
|  | const NearestNeighbors | op )
| inline

## Member Function Documentation

## ◆ dilate() [1/2]

template<typename TreeType>

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

  leaf | The leaf to dilate. The leaf's origin and value mask are used to calculate the result of the dilation.

## ◆ dilate() [2/2]

template<typename TreeType>

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

  leaf | The leaf to dilate. The leaf's origin is used to calculate the result of the dilation.
  mask | The node mask to use in place of the current leaf node mask.

## ◆ erode() [1/2]

template<typename TreeType>

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

  leaf | The leaf to erode. The leaf's origin is used to calculate the result of the erosion.

Returns
  The eroded mask

## ◆ erode() [2/2]

template<typename TreeType>

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

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

## Member Data Documentation

## ◆ DIM

template<typename TreeType>

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

## ◆ LOG2DIM

template<typename TreeType>

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