4 #ifndef OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED 5 #define OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED 60 ijk[0] = int(std::floor(voxelCoord[0]));
61 ijk[1] = int(std::floor(voxelCoord[1]));
62 ijk[2] = int(std::floor(voxelCoord[2]));
72 template<
class TreeType1,
class TreeType2>
78 inline void operator()(
const typename TreeType1::LeafIter& lIter)
const 80 const Coord xyz = lIter->origin();
81 const typename TreeType2::LeafNodeType* leaf = mOtherTree->probeConstLeaf(xyz);
83 lIter->topologyIntersection(*leaf, zeroVal<typename TreeType1::ValueType>());
84 }
else if (!mOtherTree->isValueOn(xyz)) {
85 lIter->setValuesOff();
90 const TreeType2* mOtherTree;
96 template<
class TreeType1,
class TreeType2>
102 inline void operator()(
const typename TreeType1::LeafIter& lIter)
const 104 const Coord xyz = lIter->origin();
105 const typename TreeType2::LeafNodeType* leaf = mOtherTree->probeConstLeaf(xyz);
107 lIter->topologyDifference(*leaf, zeroVal<typename TreeType1::ValueType>());
108 }
else if (mOtherTree->isValueOn(xyz)) {
109 lIter->setValuesOff();
114 const TreeType2* mOtherTree;
123 template<
class TreeType1,
class TreeType2>
124 inline typename TreeType1::template ValueConverter<bool>::Type::Ptr
127 typedef typename TreeType1::template ValueConverter<bool>::Type BoolTreeType;
129 typename BoolTreeType::Ptr topologyTree(
new BoolTreeType(
143 template<
class TreeType1,
class TreeType2>
144 inline typename TreeType1::template ValueConverter<bool>::Type::Ptr
147 typedef typename TreeType1::template ValueConverter<bool>::Type BoolTreeType;
149 typename BoolTreeType::Ptr topologyTree(
new BoolTreeType(
163 #endif // OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED
LeafTopologyIntOp(const TreeType2 &tree)
Definition: Util.h:76
TreeType1::template ValueConverter< bool >::Type::Ptr leafTopologyDifference(const TreeType1 &lhs, const TreeType2 &rhs, bool threaded=true)
Perform a boolean difference between two leaf nodes' topology masks.
Definition: Util.h:145
constexpr Index32 INVALID_IDX
Definition: Util.h:19
Defined various multi-threaded utility functions for trees.
constexpr Coord COORD_OFFSETS[26]
coordinate offset table for neighboring voxels
Definition: Util.h:22
void foreach(T &&t, const F &func, std::integer_sequence< size_t, Is... >)
Definition: PointTransfer.h:335
Definition: Exceptions.h:13
void operator()(const typename TreeType1::LeafIter &lIter) const
Definition: Util.h:78
void operator()(const typename TreeType1::LeafIter &lIter) const
Definition: Util.h:102
LeafTopologyDiffOp(const TreeType2 &tree)
Definition: Util.h:100
uint32_t Index32
Definition: Types.h:52
TreeType1::template ValueConverter< bool >::Type::Ptr leafTopologyIntersection(const TreeType1 &lhs, const TreeType2 &rhs, bool threaded=true)
Perform a boolean intersection between two leaf nodes' topology masks.
Definition: Util.h:125
Functor for use with tools::foreach() to compute the boolean intersection between the value masks of ...
Definition: Util.h:73
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:683
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
Functor for use with tools::foreach() to compute the boolean difference between the value masks of co...
Definition: Util.h:97
Coord nearestCoord(const Vec3d &voxelCoord)
Return voxelCoord rounded to the closest integer coordinates.
Definition: Util.h:57
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218