OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
TreeToMerge< TreeT >::MaskUnionOp Struct Reference

DynamicNodeManager operator used to generate a mask of the input tree, but with dense leaf nodes replaced with active tiles for compactness. More...

#include <openvdb/tools/Merge.h>

Public Types

using MaskT = MaskTreeType
 
using RootT = typename MaskT::RootNodeType
 
using LeafT = typename MaskT::LeafNodeType
 
using TreeType
 
using RootNodeType
 
using ValueType
 
using MaskTreeType
 

Public Member Functions

 MaskUnionOp (const TreeT &tree)
 
bool operator() (RootT &root, size_t) const
 
template<typename NodeT>
bool operator() (NodeT &node, size_t) const
 
bool operator() (LeafT &, size_t) const
 
 TreeToMerge ()=delete
 
 TreeToMerge (TreeType &tree, Steal)
 Non-const pointer tree constructor for stealing data.
 
 TreeToMerge (typename TreeType::Ptr treePtr, Steal)
 Non-const shared pointer tree constructor for stealing data.
 
 TreeToMerge (const TreeType &tree, DeepCopy, bool initialize=true)
 Const tree pointer constructor for deep-copying data. As the tree is not mutable and thus cannot be pruned, a lightweight mask tree with the same topology is created that can be pruned to use as a reference. Initialization of this mask tree can optionally be disabled for delayed construction.
 
 TreeToMerge (TreeType &tree, DeepCopy tag, bool initialize=true)
 Non-const tree pointer constructor for deep-copying data. The tree is not intended to be modified so is not pruned, instead a lightweight mask tree with the same topology is created that can be pruned to use as a reference. Initialization of this mask tree can optionally be disabled for delayed construction.
 
void reset (typename TreeType::Ptr treePtr, Steal)
 Reset the non-const tree shared pointer. This is primarily used to preserve the order of trees to merge in a container but have the data in the tree be lazily loaded or resampled.
 
TreeTypetreeToSteal ()
 Return a pointer to the tree to be stolen.
 
const TreeTypetreeToDeepCopy ()
 Return a pointer to the tree to be deep-copied.
 
const RootNodeTyperootPtr () const
 Retrieve a const pointer to the root node.
 
const NodeT * probeConstNode (const Coord &ijk) const
 Return a pointer to the node of type NodeT that contains voxel (x, y, z). If no such node exists, return nullptr.
 
void pruneMask (Index level, const Coord &ijk)
 Prune the mask and remove the node associated with this coord.
 
std::unique_ptr< NodeT > stealOrDeepCopyNode (const Coord &ijk, const ValueType &value)
 Return a pointer to the node of type NodeT that contains voxel (x, y, z). If the tree is non-const, steal the node and replace it with the value provided. If the tree is const, deep-copy the node and modify the mask tree to prune the node.
 
std::unique_ptr< NodeT > stealOrDeepCopyNode (const Coord &ijk)
 Return a pointer to the node of type NodeT that contains voxel (x, y, z). If the tree is non-const, steal the node and replace it with an inactive background-value tile. If the tree is const, deep-copy the node and modify the mask tree to prune the node.
 
void addTile (const Coord &ijk, const ValueType &value, bool active)
 Add a tile containing voxel (x, y, z) at the level of NodeT, deleting the existing branch if necessary.
 
void initializeMask ()
 
bool hasMask () const
 
MaskTreeTypemask ()
 
const MaskTreeTypemask () const
 

Detailed Description

template<typename TreeT>
struct openvdb::v12_0::tools::TreeToMerge< TreeT >::MaskUnionOp

DynamicNodeManager operator used to generate a mask of the input tree, but with dense leaf nodes replaced with active tiles for compactness.

Member Typedef Documentation

◆ LeafT

template<typename TreeT>
using LeafT = typename MaskT::LeafNodeType

◆ MaskT

template<typename TreeT>
using MaskT = MaskTreeType

◆ MaskTreeType

using MaskTreeType

◆ RootNodeType

using RootNodeType

◆ RootT

template<typename TreeT>
using RootT = typename MaskT::RootNodeType

◆ TreeType

using TreeType

◆ ValueType

using ValueType

Constructor & Destructor Documentation

◆ MaskUnionOp()

template<typename TreeT>
MaskUnionOp ( const TreeT & tree)
inlineexplicit

Member Function Documentation

◆ addTile()

void addTile ( const Coord & ijk,
const ValueType & value,
bool active )

Add a tile containing voxel (x, y, z) at the level of NodeT, deleting the existing branch if necessary.

◆ hasMask()

bool hasMask ( ) const

◆ initializeMask()

void initializeMask ( )

◆ mask() [1/2]

MaskTreeType * mask ( )
inline

◆ mask() [2/2]

const MaskTreeType * mask ( ) const
inline

◆ operator()() [1/3]

template<typename TreeT>
bool operator() ( LeafT & ,
size_t  ) const
inline

◆ operator()() [2/3]

template<typename TreeT>
template<typename NodeT>
bool operator() ( NodeT & node,
size_t  ) const

◆ operator()() [3/3]

template<typename TreeT>
bool operator() ( RootT & root,
size_t  ) const

◆ probeConstNode()

const NodeT * probeConstNode ( const Coord & ijk) const

Return a pointer to the node of type NodeT that contains voxel (x, y, z). If no such node exists, return nullptr.

◆ pruneMask()

void pruneMask ( Index level,
const Coord & ijk )

Prune the mask and remove the node associated with this coord.

◆ reset()

void reset ( typename TreeType::Ptr treePtr,
Steal  )

Reset the non-const tree shared pointer. This is primarily used to preserve the order of trees to merge in a container but have the data in the tree be lazily loaded or resampled.

◆ rootPtr()

const TreeToMerge< TreeT >::RootNodeType * rootPtr ( ) const

Retrieve a const pointer to the root node.

◆ stealOrDeepCopyNode() [1/2]

std::unique_ptr< NodeT > stealOrDeepCopyNode ( const Coord & ijk)

Return a pointer to the node of type NodeT that contains voxel (x, y, z). If the tree is non-const, steal the node and replace it with an inactive background-value tile. If the tree is const, deep-copy the node and modify the mask tree to prune the node.

◆ stealOrDeepCopyNode() [2/2]

std::unique_ptr< NodeT > stealOrDeepCopyNode ( const Coord & ijk,
const ValueType & value )

Return a pointer to the node of type NodeT that contains voxel (x, y, z). If the tree is non-const, steal the node and replace it with the value provided. If the tree is const, deep-copy the node and modify the mask tree to prune the node.

◆ treeToDeepCopy()

const TreeType * treeToDeepCopy ( )
inline

Return a pointer to the tree to be deep-copied.

◆ TreeToMerge() [1/5]

TreeToMerge ( )
delete

◆ TreeToMerge() [2/5]

TreeToMerge ( const TreeType & tree,
DeepCopy ,
bool initialize = true )
inline

Const tree pointer constructor for deep-copying data. As the tree is not mutable and thus cannot be pruned, a lightweight mask tree with the same topology is created that can be pruned to use as a reference. Initialization of this mask tree can optionally be disabled for delayed construction.

◆ TreeToMerge() [3/5]

TreeToMerge ( TreeType & tree,
DeepCopy tag,
bool initialize = true )
inline

Non-const tree pointer constructor for deep-copying data. The tree is not intended to be modified so is not pruned, instead a lightweight mask tree with the same topology is created that can be pruned to use as a reference. Initialization of this mask tree can optionally be disabled for delayed construction.

◆ TreeToMerge() [4/5]

TreeToMerge ( TreeType & tree,
Steal  )
inline

Non-const pointer tree constructor for stealing data.

◆ TreeToMerge() [5/5]

TreeToMerge ( typename TreeType::Ptr treePtr,
Steal  )
inline

Non-const shared pointer tree constructor for stealing data.

◆ treeToSteal()

TreeType * treeToSteal ( )
inline

Return a pointer to the tree to be stolen.