Loading...
Searching...
No Matches
CsgUnionOrIntersectionOp< TreeT, Union > Struct Template Reference

DynamicNodeManager operator to merge trees using a CSG union or intersection. More...

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

## Public Types

using | ValueT = typename TreeT::ValueType
using | RootT = typename TreeT::RootNodeType
using | LeafT = typename TreeT::LeafNodeType

## Public Member Functions

template<typename TagT>
| CsgUnionOrIntersectionOp (TreeT &tree, TagT tag)
| Convenience constructor to CSG union or intersect a single non-const tree with another. This constructor takes a Steal or DeepCopy tag dispatch class.
| CsgUnionOrIntersectionOp (const TreeT &tree, DeepCopy tag)
| Convenience constructor to CSG union or intersect a single const tree with another. This constructor requires a DeepCopy tag dispatch class.
template<typename TreesT, typename TagT>
| CsgUnionOrIntersectionOp (TreesT &trees, TagT tag)
| Constructor to CSG union or intersect a container of multiple const or non-const tree pointers. A Steal tag requires a container of non-const trees, a DeepCopy tag will accept either const or non-const trees.
| CsgUnionOrIntersectionOp (const std::vector< TreeToMerge< TreeT > > &trees)
| Constructor to accept a vector of TreeToMerge objects, primarily used when mixing const/non-const trees.
| CsgUnionOrIntersectionOp (const std::deque< TreeToMerge< TreeT > > &trees)
| Constructor to accept a deque of TreeToMerge objects, primarily used when mixing const/non-const trees.
bool | empty () const
| Return true if no trees being merged.
size_t | size () const
| Return the number of trees being merged.
void | setPruneCancelledTiles (bool doprune)
| Enables immediate pruning of tiles that cancel each other out.
bool | operator() (RootT &root, size_t idx) const
template<typename NodeT>
bool | operator() (NodeT &node, size_t idx) const
bool | operator() (LeafT &leaf, size_t idx) const

## Detailed Description

template<typename TreeT, bool Union>
struct openvdb::v10_0::tools::CsgUnionOrIntersectionOp< TreeT, Union >

DynamicNodeManager operator to merge trees using a CSG union or intersection.

Note
  This class modifies the topology of the tree so is designed to be used from DynamicNodeManager::foreachTopDown().

A union and an intersection are opposite operations to each other so implemented in a combined class. Use the CsgUnionOp and CsgIntersectionOp aliases for convenience.

## Member Typedef Documentation

## LeafT

template<typename TreeT, bool Union>

using LeafT = typename TreeT::LeafNodeType

## RootT

template<typename TreeT, bool Union>

using RootT = typename TreeT::RootNodeType

## ValueT

template<typename TreeT, bool Union>

using ValueT = typename TreeT::ValueType

## Constructor & Destructor Documentation

## CsgUnionOrIntersectionOp() [1/5]

template<typename TreeT, bool Union>
template<typename TagT>

CsgUnionOrIntersectionOp | ( | TreeT & | tree,
|  | TagT | tag )

inline

Convenience constructor to CSG union or intersect a single non-const tree with another. This constructor takes a Steal or DeepCopy tag dispatch class.

## CsgUnionOrIntersectionOp() [2/5]

template<typename TreeT, bool Union>

CsgUnionOrIntersectionOp | ( | const TreeT & | tree,
|  | DeepCopy | tag )

inline

Convenience constructor to CSG union or intersect a single const tree with another. This constructor requires a DeepCopy tag dispatch class.

## CsgUnionOrIntersectionOp() [3/5]

template<typename TreeT, bool Union>
template<typename TreesT, typename TagT>

CsgUnionOrIntersectionOp | ( | TreesT & | trees,
|  | TagT | tag )

inline

Constructor to CSG union or intersect a container of multiple const or non-const tree pointers. A Steal tag requires a container of non-const trees, a DeepCopy tag will accept either const or non-const trees.

## CsgUnionOrIntersectionOp() [4/5]

template<typename TreeT, bool Union>

CsgUnionOrIntersectionOp | ( | const std::vector< TreeToMerge< TreeT > > & | trees | ) |

inline explicit

Constructor to accept a vector of TreeToMerge objects, primarily used when mixing const/non-const trees.

Note
  Union/intersection order is preserved.

## CsgUnionOrIntersectionOp() [5/5]

template<typename TreeT, bool Union>

CsgUnionOrIntersectionOp | ( | const std::deque< TreeToMerge< TreeT > > & | trees | ) |

inline explicit

Constructor to accept a deque of TreeToMerge objects, primarily used when mixing const/non-const trees.

Note
  Union/intersection order is preserved.

## Member Function Documentation

## empty()

template<typename TreeT, bool Union>

bool empty | ( |  | ) | const

inline

Return true if no trees being merged.

## operator()() [1/3]

template<typename TreeT, bool Union>

bool operator() | ( | LeafT & | leaf,
|  | size_t | idx ) const

## operator()() [2/3]

template<typename TreeT, bool Union>
template<typename NodeT>

bool operator() | ( | NodeT & | node,
|  | size_t | idx ) const

## operator()() [3/3]

template<typename TreeT, bool Union>

bool operator() | ( | RootT & | root,
|  | size_t | idx ) const

## setPruneCancelledTiles()

template<typename TreeT, bool Union>

void setPruneCancelledTiles | ( | bool | doprune | ) |

inline

Enables immediate pruning of tiles that cancel each other out.

## size()

template<typename TreeT, bool Union>

size_t size | ( |  | ) | const

inline

Return the number of trees being merged.