35 #ifndef OPENVDB_TOOLS_VOLUME_TO_SPHERES_HAS_BEEN_INCLUDED 36 #define OPENVDB_TOOLS_VOLUME_TO_SPHERES_HAS_BEEN_INCLUDED 38 #include <openvdb/tree/LeafManager.h> 39 #include <openvdb/math/Math.h> 46 #include <boost/mpl/at.hpp> 47 #include <boost/mpl/int.hpp> 48 #include <boost/scoped_array.hpp> 49 #include <tbb/blocked_range.h> 50 #include <tbb/parallel_for.h> 51 #include <tbb/parallel_reduce.h> 89 template<
typename Gr
idT,
typename InterrupterT = util::NullInterrupter>
93 std::vector<openvdb::Vec4s>& spheres,
95 bool overlapping =
false,
96 float minRadius = 1.0,
99 int instanceCount = 10000,
100 InterrupterT* interrupter =
nullptr);
104 template<
typename Gr
idT,
typename InterrupterT = util::NullInterrupter>
109 std::vector<openvdb::Vec4s>& spheres,
111 bool overlapping =
false,
112 float minRadius = 1.0,
114 float isovalue = 0.0,
115 int instanceCount = 10000,
116 InterrupterT* interrupter =
nullptr);
125 template<
typename Gr
idT>
129 using Ptr = std::unique_ptr<ClosestSurfacePoint>;
130 using TreeT =
typename GridT::TreeType;
131 using BoolTreeT =
typename TreeT::template ValueConverter<bool>::Type;
132 using Index32TreeT =
typename TreeT::template ValueConverter<Index32>::Type;
133 using Int16TreeT =
typename TreeT::template ValueConverter<Int16>::Type;
146 template<
typename InterrupterT = util::NullInterrupter>
147 static inline Ptr create(
const GridT& grid,
float isovalue = 0.0,
148 InterrupterT* interrupter =
nullptr);
153 inline bool search(
const std::vector<Vec3R>& points, std::vector<float>& distances);
158 inline bool searchAndReplace(std::vector<Vec3R>& points, std::vector<float>& distances);
166 using Index32LeafT =
typename Index32TreeT::LeafNodeType;
167 using IndexRange = std::pair<size_t, size_t>;
169 std::vector<Vec4R> mLeafBoundingSpheres, mNodeBoundingSpheres;
170 std::vector<IndexRange> mLeafRanges;
171 std::vector<const Index32LeafT*> mLeafNodes;
173 size_t mPointListSize = 0, mMaxNodeLeafs = 0;
174 typename Index32TreeT::Ptr mIdxTreePt;
175 typename Int16TreeT::Ptr mSignTreePt;
178 template<
typename InterrupterT = util::NullInterrupter>
179 inline bool initialize(
const GridT&,
float isovalue, InterrupterT*);
180 inline bool search(std::vector<Vec3R>&, std::vector<float>&,
bool transformPoints);
189 namespace v2s_internal {
200 mPoints.push_back(pos);
203 std::vector<Vec3R>& mPoints;
207 template<
typename Index32LeafT>
212 LeafOp(std::vector<Vec4R>& leafBoundingSpheres,
213 const std::vector<const Index32LeafT*>& leafNodes,
217 void run(
bool threaded =
true);
220 void operator()(
const tbb::blocked_range<size_t>&)
const;
223 std::vector<Vec4R>& mLeafBoundingSpheres;
224 const std::vector<const Index32LeafT*>& mLeafNodes;
229 template<
typename Index32LeafT>
231 std::vector<Vec4R>& leafBoundingSpheres,
232 const std::vector<const Index32LeafT*>& leafNodes,
235 : mLeafBoundingSpheres(leafBoundingSpheres)
236 , mLeafNodes(leafNodes)
237 , mTransform(transform)
238 , mSurfacePointList(surfacePointList)
242 template<
typename Index32LeafT>
247 tbb::parallel_for(tbb::blocked_range<size_t>(0, mLeafNodes.size()), *
this);
249 (*this)(tbb::blocked_range<size_t>(0, mLeafNodes.size()));
253 template<
typename Index32LeafT>
257 typename Index32LeafT::ValueOnCIter iter;
260 for (
size_t n = range.begin(); n != range.end(); ++n) {
266 for (iter = mLeafNodes[n]->cbeginValueOn(); iter; ++iter) {
267 avg += mSurfacePointList[iter.getValue()];
270 if (count > 1) avg *= float(1.0 /
double(count));
273 for (iter = mLeafNodes[n]->cbeginValueOn(); iter; ++iter) {
274 float tmpDist = (mSurfacePointList[iter.getValue()] - avg).lengthSqr();
275 if (tmpDist > maxDist) maxDist = tmpDist;
278 Vec4R& sphere = mLeafBoundingSpheres[n];
282 sphere[3] = std::sqrt(maxDist);
292 NodeOp(std::vector<Vec4R>& nodeBoundingSpheres,
293 const std::vector<IndexRange>& leafRanges,
294 const std::vector<Vec4R>& leafBoundingSpheres);
296 inline void run(
bool threaded =
true);
298 inline void operator()(
const tbb::blocked_range<size_t>&)
const;
301 std::vector<Vec4R>& mNodeBoundingSpheres;
302 const std::vector<IndexRange>& mLeafRanges;
303 const std::vector<Vec4R>& mLeafBoundingSpheres;
308 const std::vector<IndexRange>& leafRanges,
309 const std::vector<Vec4R>& leafBoundingSpheres)
310 : mNodeBoundingSpheres(nodeBoundingSpheres)
311 , mLeafRanges(leafRanges)
312 , mLeafBoundingSpheres(leafBoundingSpheres)
320 tbb::parallel_for(tbb::blocked_range<size_t>(0, mLeafRanges.size()), *
this);
322 (*this)(tbb::blocked_range<size_t>(0, mLeafRanges.size()));
331 for (
size_t n = range.begin(); n != range.end(); ++n) {
337 int count = int(mLeafRanges[n].second) - int(mLeafRanges[n].first);
339 for (
size_t i = mLeafRanges[n].first; i < mLeafRanges[n].second; ++i) {
340 avg[0] += mLeafBoundingSpheres[i][0];
341 avg[1] += mLeafBoundingSpheres[i][1];
342 avg[2] += mLeafBoundingSpheres[i][2];
345 if (count > 1) avg *= float(1.0 /
double(count));
348 double maxDist = 0.0;
350 for (
size_t i = mLeafRanges[n].first; i < mLeafRanges[n].second; ++i) {
351 pos[0] = mLeafBoundingSpheres[i][0];
352 pos[1] = mLeafBoundingSpheres[i][1];
353 pos[2] = mLeafBoundingSpheres[i][2];
355 double tmpDist = (pos - avg).length() + mLeafBoundingSpheres[i][3];
356 if (tmpDist > maxDist) maxDist = tmpDist;
359 Vec4R& sphere = mNodeBoundingSpheres[n];
372 template<
typename Index32LeafT>
379 std::vector<Vec3R>& instancePoints,
380 std::vector<float>& instanceDistances,
382 const std::vector<const Index32LeafT*>& leafNodes,
383 const std::vector<IndexRange>& leafRanges,
384 const std::vector<Vec4R>& leafBoundingSpheres,
385 const std::vector<Vec4R>& nodeBoundingSpheres,
387 bool transformPoints =
false);
390 void run(
bool threaded =
true);
393 void operator()(
const tbb::blocked_range<size_t>&)
const;
397 void evalLeaf(
size_t index,
const Index32LeafT& leaf)
const;
398 void evalNode(
size_t pointIndex,
size_t nodeIndex)
const;
401 std::vector<Vec3R>& mInstancePoints;
402 std::vector<float>& mInstanceDistances;
406 const std::vector<const Index32LeafT*>& mLeafNodes;
407 const std::vector<IndexRange>& mLeafRanges;
408 const std::vector<Vec4R>& mLeafBoundingSpheres;
409 const std::vector<Vec4R>& mNodeBoundingSpheres;
411 std::vector<float> mLeafDistances, mNodeDistances;
413 const bool mTransformPoints;
414 size_t mClosestPointIndex;
418 template<
typename Index32LeafT>
420 std::vector<Vec3R>& instancePoints,
421 std::vector<float>& instanceDistances,
423 const std::vector<const Index32LeafT*>& leafNodes,
424 const std::vector<IndexRange>& leafRanges,
425 const std::vector<Vec4R>& leafBoundingSpheres,
426 const std::vector<Vec4R>& nodeBoundingSpheres,
428 bool transformPoints)
429 : mInstancePoints(instancePoints)
430 , mInstanceDistances(instanceDistances)
431 , mSurfacePointList(surfacePointList)
432 , mLeafNodes(leafNodes)
433 , mLeafRanges(leafRanges)
434 , mLeafBoundingSpheres(leafBoundingSpheres)
435 , mNodeBoundingSpheres(nodeBoundingSpheres)
436 , mLeafDistances(maxNodeLeafs, 0.0)
437 , mNodeDistances(leafRanges.size(), 0.0)
438 , mTransformPoints(transformPoints)
439 , mClosestPointIndex(0)
444 template<
typename Index32LeafT>
449 tbb::parallel_for(tbb::blocked_range<size_t>(0, mInstancePoints.size()), *
this);
451 (*this)(tbb::blocked_range<size_t>(0, mInstancePoints.size()));
455 template<
typename Index32LeafT>
459 typename Index32LeafT::ValueOnCIter iter;
460 const Vec3s center = mInstancePoints[index];
461 size_t& closestPointIndex =
const_cast<size_t&
>(mClosestPointIndex);
463 for (iter = leaf.cbeginValueOn(); iter; ++iter) {
465 const Vec3s& point = mSurfacePointList[iter.getValue()];
466 float tmpDist = (point - center).lengthSqr();
468 if (tmpDist < mInstanceDistances[index]) {
469 mInstanceDistances[index] = tmpDist;
470 closestPointIndex = iter.getValue();
476 template<
typename Index32LeafT>
480 if (nodeIndex >= mLeafRanges.size())
return;
482 const Vec3R& pos = mInstancePoints[pointIndex];
483 float minDist = mInstanceDistances[pointIndex];
484 size_t minDistIdx = 0;
486 bool updatedDist =
false;
488 for (
size_t i = mLeafRanges[nodeIndex].first, n = 0;
489 i < mLeafRanges[nodeIndex].second; ++i, ++n)
491 float& distToLeaf =
const_cast<float&
>(mLeafDistances[n]);
493 center[0] = mLeafBoundingSpheres[i][0];
494 center[1] = mLeafBoundingSpheres[i][1];
495 center[2] = mLeafBoundingSpheres[i][2];
496 const auto radius = mLeafBoundingSpheres[i][3];
498 distToLeaf = float(
std::max(0.0, (pos - center).length() - radius));
500 if (distToLeaf < minDist) {
501 minDist = distToLeaf;
507 if (!updatedDist)
return;
509 evalLeaf(pointIndex, *mLeafNodes[minDistIdx]);
511 for (
size_t i = mLeafRanges[nodeIndex].first, n = 0;
512 i < mLeafRanges[nodeIndex].second; ++i, ++n)
514 if (mLeafDistances[n] < mInstanceDistances[pointIndex] && i != minDistIdx) {
515 evalLeaf(pointIndex, *mLeafNodes[i]);
521 template<
typename Index32LeafT>
526 for (
size_t n = range.begin(); n != range.end(); ++n) {
528 const Vec3R& pos = mInstancePoints[n];
529 float minDist = mInstanceDistances[n];
530 size_t minDistIdx = 0;
532 for (
size_t i = 0, I = mNodeDistances.size(); i < I; ++i) {
533 float& distToNode =
const_cast<float&
>(mNodeDistances[i]);
535 center[0] = mNodeBoundingSpheres[i][0];
536 center[1] = mNodeBoundingSpheres[i][1];
537 center[2] = mNodeBoundingSpheres[i][2];
538 const auto radius = mNodeBoundingSpheres[i][3];
540 distToNode = float(
std::max(0.0, (pos - center).length() - radius));
542 if (distToNode < minDist) {
543 minDist = distToNode;
548 evalNode(n, minDistIdx);
550 for (
size_t i = 0, I = mNodeDistances.size(); i < I; ++i) {
551 if (mNodeDistances[i] < mInstanceDistances[n] && i != minDistIdx) {
556 mInstanceDistances[n] = std::sqrt(mInstanceDistances[n]);
558 if (mTransformPoints) mInstancePoints[n] = mSurfacePointList[mClosestPointIndex];
568 const std::vector<Vec3R>& points,
569 std::vector<float>& distances,
570 std::vector<unsigned char>& mask,
574 int index()
const {
return mIndex; }
576 inline void run(
bool threaded =
true);
580 inline void operator()(
const tbb::blocked_range<size_t>& range);
583 if (rhs.mRadius > mRadius) {
584 mRadius = rhs.mRadius;
590 const Vec4s& mSphere;
591 const std::vector<Vec3R>& mPoints;
592 std::vector<float>& mDistances;
593 std::vector<unsigned char>& mMask;
602 const std::vector<Vec3R>& points,
603 std::vector<float>& distances,
604 std::vector<unsigned char>& mask,
608 , mDistances(distances)
610 , mOverlapping(overlapping)
618 : mSphere(rhs.mSphere)
619 , mPoints(rhs.mPoints)
620 , mDistances(rhs.mDistances)
622 , mOverlapping(rhs.mOverlapping)
623 , mRadius(rhs.mRadius)
632 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, mPoints.size()), *
this);
634 (*this)(tbb::blocked_range<size_t>(0, mPoints.size()));
642 for (
size_t n = range.begin(); n != range.end(); ++n) {
643 if (mMask[n])
continue;
645 pos.x() = float(mPoints[n].x()) - mSphere[0];
646 pos.y() = float(mPoints[n].y()) - mSphere[1];
647 pos.z() = float(mPoints[n].z()) - mSphere[2];
649 float dist = pos.length();
651 if (dist < mSphere[3]) {
657 mDistances[n] =
std::min(mDistances[n], (dist - mSphere[3]));
660 if (mDistances[n] > mRadius) {
661 mRadius = mDistances[n];
674 template<
typename Gr
idT,
typename InterrupterT>
678 std::vector<openvdb::Vec4s>& spheres,
685 InterrupterT* interrupter)
688 minRadius, maxRadius, isovalue, instanceCount, interrupter);
692 template<
typename Gr
idT,
typename InterrupterT>
696 std::vector<openvdb::Vec4s>& spheres,
697 const Vec2i& sphereCount,
703 InterrupterT* interrupter)
707 if (grid.empty())
return;
710 minSphereCount = sphereCount[0],
711 maxSphereCount = sphereCount[1];
712 if ((minSphereCount > maxSphereCount) || (maxSphereCount < 1)) {
714 << minSphereCount <<
") exceeds maximum count (" << maxSphereCount <<
")");
717 spheres.reserve(maxSphereCount);
719 auto gridPtr = grid.copy();
738 auto numVoxels = gridPtr->activeVoxelCount();
739 if (numVoxels < 10000) {
740 const auto scale = 1.0 /
math::Cbrt(2.0 * 10000.0 /
double(numVoxels));
741 auto scaledXform = gridPtr->transform().copy();
742 scaledXform->preScale(
scale);
747 const auto newNumVoxels = newGridPtr->activeVoxelCount();
748 if (newNumVoxels > numVoxels) {
750 << numVoxels <<
" voxel" << (numVoxels == 1 ?
"" :
"s")
751 <<
" to " << newNumVoxels <<
" voxel" << (newNumVoxels == 1 ?
"" :
"s"));
752 gridPtr = newGridPtr;
753 numVoxels = newNumVoxels;
757 const bool addNarrowBandPoints = (numVoxels < 10000);
758 int instances =
std::max(instanceCount, maxSphereCount);
760 using TreeT =
typename GridT::TreeType;
761 using BoolTreeT =
typename TreeT::template ValueConverter<bool>::Type;
762 using Int16TreeT =
typename TreeT::template ValueConverter<Int16>::Type;
764 using RandGen = std::mersenne_twister_engine<uint32_t, 32, 351, 175, 19,
765 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 1812433253>;
768 const TreeT& tree = gridPtr->tree();
771 std::vector<Vec3R> instancePoints;
781 interiorMaskPtr->
tree().topologyUnion(tree);
784 if (interrupter && interrupter->wasInterrupted())
return;
789 if (!addNarrowBandPoints || (minSphereCount <= 0)) {
792 auto& maskTree = interiorMaskPtr->
tree();
793 auto copyOfTree = StaticPtrCast<BoolTreeT>(maskTree.copy());
795 if (maskTree.empty()) { interiorMaskPtr->
setTree(copyOfTree); }
799 instancePoints.reserve(instances);
802 const auto scatterCount =
Index64(addNarrowBandPoints ? (instances / 2) : instances);
805 ptnAcc, scatterCount, mtRand, 1.0, interrupter);
806 scatter(*interiorMaskPtr);
809 if (interrupter && interrupter->wasInterrupted())
return;
815 if (instancePoints.size() < size_t(instances)) {
816 const Int16TreeT& signTree = csp->signTree();
817 for (
auto leafIt = signTree.cbeginLeaf(); leafIt; ++leafIt) {
818 for (
auto it = leafIt->cbeginValueOn(); it; ++it) {
819 const int flags = int(it.getValue());
823 instancePoints.push_back(transform.
indexToWorld(it.getCoord()));
825 if (instancePoints.size() == size_t(instances))
break;
827 if (instancePoints.size() == size_t(instances))
break;
831 if (interrupter && interrupter->wasInterrupted())
return;
835 std::vector<float> instanceRadius;
836 if (!csp->search(instancePoints, instanceRadius))
return;
838 float largestRadius = 0.0;
839 int largestRadiusIdx = 0;
840 for (
size_t n = 0, N = instancePoints.size(); n < N; ++n) {
841 if (instanceRadius[n] > largestRadius) {
842 largestRadius = instanceRadius[n];
843 largestRadiusIdx = int(n);
847 std::vector<unsigned char> instanceMask(instancePoints.size(), 0);
849 minRadius = float(minRadius * transform.
voxelSize()[0]);
850 maxRadius = float(maxRadius * transform.
voxelSize()[0]);
852 for (
size_t s = 0, S =
std::min(
size_t(maxSphereCount), instancePoints.size()); s < S; ++s) {
854 if (interrupter && interrupter->wasInterrupted())
return;
856 largestRadius =
std::min(maxRadius, largestRadius);
858 if ((
int(s) >= minSphereCount) && (largestRadius < minRadius))
break;
861 float(instancePoints[largestRadiusIdx].x()),
862 float(instancePoints[largestRadiusIdx].y()),
863 float(instancePoints[largestRadiusIdx].z()),
866 spheres.push_back(sphere);
867 instanceMask[largestRadiusIdx] = 1;
870 sphere, instancePoints, instanceRadius, instanceMask, overlapping);
873 largestRadius = op.
radius();
874 largestRadiusIdx = op.
index();
882 template<
typename Gr
idT>
883 template<
typename InterrupterT>
888 if (!csp->initialize(grid, isovalue, interrupter)) csp.reset();
893 template<
typename Gr
idT>
894 template<
typename InterrupterT>
897 const GridT& grid,
float isovalue, InterrupterT* interrupter)
900 using ValueT =
typename GridT::ValueType;
915 *mSignTreePt, *mIdxTreePt, mask, tree, ValueT(isovalue));
917 if (interrupter && interrupter->wasInterrupted())
return false;
921 using Int16LeafNodeType =
typename Int16TreeT::LeafNodeType;
922 using Index32LeafNodeType =
typename Index32TreeT::LeafNodeType;
924 std::vector<Int16LeafNodeType*> signFlagsLeafNodes;
925 mSignTreePt->getNodes(signFlagsLeafNodes);
927 const tbb::blocked_range<size_t> auxiliaryLeafNodeRange(0, signFlagsLeafNodes.size());
929 boost::scoped_array<Index32> leafNodeOffsets(
new Index32[signFlagsLeafNodes.size()]);
931 tbb::parallel_for(auxiliaryLeafNodeRange,
933 (signFlagsLeafNodes, leafNodeOffsets));
937 for (
size_t n = 0, N = signFlagsLeafNodes.size(); n < N; ++n) {
938 const Index32 tmp = leafNodeOffsets[n];
943 mPointListSize = size_t(pointCount);
944 mSurfacePointList.reset(
new Vec3s[mPointListSize]);
948 std::vector<Index32LeafNodeType*> pointIndexLeafNodes;
949 mIdxTreePt->getNodes(pointIndexLeafNodes);
952 mSurfacePointList.get(), tree, pointIndexLeafNodes,
953 signFlagsLeafNodes, leafNodeOffsets, transform, ValueT(isovalue)));
956 if (interrupter && interrupter->wasInterrupted())
return false;
958 Index32LeafManagerT idxLeafs(*mIdxTreePt);
960 using Index32RootNodeT =
typename Index32TreeT::RootNodeType;
961 using Index32NodeChainT =
typename Index32RootNodeT::NodeChainType;
962 static_assert(boost::mpl::size<Index32NodeChainT>::value > 1,
963 "expected tree depth greater than one");
964 using Index32InternalNodeT =
965 typename boost::mpl::at<Index32NodeChainT, boost::mpl::int_<1> >::type;
967 typename Index32TreeT::NodeCIter nIt = mIdxTreePt->cbeginNode();
968 nIt.setMinDepth(Index32TreeT::NodeCIter::LEAF_DEPTH - 1);
969 nIt.setMaxDepth(Index32TreeT::NodeCIter::LEAF_DEPTH - 1);
971 std::vector<const Index32InternalNodeT*> internalNodes;
973 const Index32InternalNodeT* node =
nullptr;
976 if (node) internalNodes.push_back(node);
979 std::vector<IndexRange>().swap(mLeafRanges);
980 mLeafRanges.resize(internalNodes.size());
982 std::vector<const Index32LeafT*>().swap(mLeafNodes);
983 mLeafNodes.reserve(idxLeafs.leafCount());
985 typename Index32InternalNodeT::ChildOnCIter leafIt;
987 for (
size_t n = 0, N = internalNodes.size(); n < N; ++n) {
989 mLeafRanges[n].first = mLeafNodes.size();
991 size_t leafCount = 0;
992 for (leafIt = internalNodes[n]->cbeginChildOn(); leafIt; ++leafIt) {
993 mLeafNodes.push_back(&(*leafIt));
997 mMaxNodeLeafs =
std::max(leafCount, mMaxNodeLeafs);
999 mLeafRanges[n].second = mLeafNodes.size();
1002 std::vector<Vec4R>().swap(mLeafBoundingSpheres);
1003 mLeafBoundingSpheres.resize(mLeafNodes.size());
1006 mLeafBoundingSpheres, mLeafNodes, transform, mSurfacePointList);
1010 std::vector<Vec4R>().swap(mNodeBoundingSpheres);
1011 mNodeBoundingSpheres.resize(internalNodes.size());
1019 template<
typename Gr
idT>
1022 std::vector<float>& distances,
bool transformPoints)
1025 distances.resize(points.size(), std::numeric_limits<float>::infinity());
1028 mLeafNodes, mLeafRanges, mLeafBoundingSpheres, mNodeBoundingSpheres,
1029 mMaxNodeLeafs, transformPoints);
1037 template<
typename Gr
idT>
1041 return search(
const_cast<std::vector<Vec3R>&
>(points), distances,
false);
1045 template<
typename Gr
idT>
1048 std::vector<float>& distances)
1050 return search(points, distances,
true);
1057 #endif // OPENVDB_TOOLS_VOLUME_TO_MESH_HAS_BEEN_INCLUDED Type Clamp(Type x, Type min, Type max)
Return x clamped to [min, max].
Definition: Math.h:230
void setTree(TreeBase::Ptr) override
Associate the given tree with this grid, in place of its existing tree.
Definition: Grid.h:1310
float Cbrt(float x)
Return the cube root of a floating-point value.
Definition: Math.h:723
#define OPENVDB_LOG_DEBUG_RUNTIME(message)
Log a debugging message in both debug and optimized builds.
Definition: logging.h:294
Vec4< float > Vec4s
Definition: Vec4.h:586
void setTransform(math::Transform::Ptr)
Associate the given transform with this grid, in place of its existing transform. ...
Definition: Grid.h:1113
Index64 pointCount(const PointDataTreeT &tree, const FilterT &filter=NullFilter(), const bool inCoreOnly=false, const bool threaded=true)
Count the total number of points in a PointDataTree.
Definition: PointCount.h:115
static T value()
Definition: Math.h:117
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:283
Tolerance for floating-point comparison.
Definition: Math.h:117
Extract polygonal surfaces from scalar volumes.
Vec3< double > Vec3d
Definition: Vec3.h:679
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
#define OPENVDB_LOG_WARN(message)
Log a warning message of the form 'someVar << "some text" << ...'.
Definition: logging.h:280
Vec2< int32_t > Vec2i
Definition: Vec2.h:556
OPENVDB_IMPORT void initialize()
Global registration of basic types.
SharedPtr< Grid > Ptr
Definition: Grid.h:502
Implementation of morphological dilation and erosion.
MatType scale(const Vec3< typename MatType::value_type > &s)
Return a matrix that scales by s.
Definition: Mat.h:647
Definition: Exceptions.h:40
Vec3< float > Vec3s
Definition: Vec3.h:678
uint64_t Index64
Definition: Types.h:60
This class manages a linear array of pointers to a given tree's leaf nodes, as well as optional auxil...
Definition: LeafManager.h:110
const TreeType & tree() const
Return a const reference to tree associated with this manager.
Definition: LeafManager.h:343
Miscellaneous utility methods that operate primarily or exclusively on level set grids.
Container class that associates a tree with a transform and metadata.
Definition: Grid.h:55
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
TreeType & tree()
Return a reference to this grid's tree, which might be shared with other grids.
Definition: Grid.h:798
uint32_t Index32
Definition: Types.h:59