4 #ifndef OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED 5 #define OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED 32 ijk[0] = int(std::floor(voxelCoord[0]));
33 ijk[1] = int(std::floor(voxelCoord[1]));
34 ijk[2] = int(std::floor(voxelCoord[2]));
44 template<
class TreeType1,
class TreeType2>
50 inline void operator()(
const typename TreeType1::LeafIter& lIter)
const 52 const Coord xyz = lIter->origin();
53 const typename TreeType2::LeafNodeType* leaf = mOtherTree->probeConstLeaf(xyz);
55 lIter->topologyIntersection(*leaf, zeroVal<typename TreeType1::ValueType>());
56 }
else if (!mOtherTree->isValueOn(xyz)) {
57 lIter->setValuesOff();
62 const TreeType2* mOtherTree;
68 template<
class TreeType1,
class TreeType2>
74 inline void operator()(
const typename TreeType1::LeafIter& lIter)
const 76 const Coord xyz = lIter->origin();
77 const typename TreeType2::LeafNodeType* leaf = mOtherTree->probeConstLeaf(xyz);
79 lIter->topologyDifference(*leaf, zeroVal<typename TreeType1::ValueType>());
80 }
else if (mOtherTree->isValueOn(xyz)) {
81 lIter->setValuesOff();
86 const TreeType2* mOtherTree;
95 template<
class TreeType1,
class TreeType2>
96 inline typename TreeType1::template ValueConverter<bool>::Type::Ptr
99 typedef typename TreeType1::template ValueConverter<bool>::Type BoolTreeType;
101 typename BoolTreeType::Ptr topologyTree(
new BoolTreeType(
115 template<
class TreeType1,
class TreeType2>
116 inline typename TreeType1::template ValueConverter<bool>::Type::Ptr
119 typedef typename TreeType1::template ValueConverter<bool>::Type BoolTreeType;
121 typename BoolTreeType::Ptr topologyTree(
new BoolTreeType(
135 #endif // OPENVDB_UTIL_UTIL_HAS_BEEN_INCLUDED
OPENVDB_API const Index32 INVALID_IDX
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:117
Tag dispatch class that distinguishes topology copy constructors from deep copy constructors.
Definition: Types.h:644
Defined various multi-threaded utility functions for trees.
OPENVDB_API const Coord COORD_OFFSETS[26]
coordinate offset table for neighboring voxels
void operator()(const typename TreeType1::LeafIter &lIter) const
Definition: Util.h:50
Definition: Exceptions.h:13
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:97
LeafTopologyDiffOp(const TreeType2 &tree)
Definition: Util.h:72
LeafTopologyIntOp(const TreeType2 &tree)
Definition: Util.h:48
Coord nearestCoord(const Vec3d &voxelCoord)
Return voxelCoord rounded to the closest integer coordinates.
Definition: Util.h:29
uint32_t Index32
Definition: Types.h:52
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
Functor for use with tools::foreach() to compute the boolean difference between the value masks of co...
Definition: Util.h:69
Functor for use with tools::foreach() to compute the boolean intersection between the value masks of ...
Definition: Util.h:45
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:202
void operator()(const typename TreeType1::LeafIter &lIter) const
Definition: Util.h:74