52 #ifndef OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED 53 #define OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED 63 #include <boost/scoped_array.hpp> 64 #include <tbb/blocked_range.h> 65 #include <tbb/parallel_for.h> 66 #include <tbb/parallel_reduce.h> 110 template<
typename Po
intIndexGr
idType = Po
intIndexGr
id>
117 using IndexType =
typename PointIndexGridType::ValueType;
123 ParticleAtlas() : mIndexGridArray(), mMinRadiusArray(), mMaxRadiusArray() {}
130 template<
typename ParticleArrayType>
131 void construct(
const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels = 50);
138 template<
typename ParticleArrayType>
139 static Ptr create(
const ParticleArrayType& particles,
140 double minVoxelSize,
size_t maxLevels = 50);
143 size_t levels()
const {
return mIndexGridArray.size(); }
145 bool empty()
const {
return mIndexGridArray.empty(); }
148 double minRadius(
size_t n)
const {
return mMinRadiusArray[n]; }
150 double maxRadius(
size_t n)
const {
return mMaxRadiusArray[n]; }
155 const PointIndexGridType&
pointIndexGrid(
size_t n)
const {
return *mIndexGridArray[n]; }
162 std::vector<PointIndexGridPtr> mIndexGridArray;
163 std::vector<double> mMinRadiusArray, mMaxRadiusArray;
178 template<
typename Po
intIndexGr
idType>
181 using TreeType =
typename PointIndexGridType::TreeType;
195 template<
typename ParticleArrayType>
196 void worldSpaceSearchAndUpdate(
const Vec3d& center,
double radius,
197 const ParticleArrayType& particles);
203 template<
typename ParticleArrayType>
204 void worldSpaceSearchAndUpdate(
const BBoxd& bbox,
const ParticleArrayType& particles);
207 size_t levels()
const {
return mAtlas->levels(); }
211 void updateFromLevel(
size_t level);
221 bool test()
const {
return mRange.first < mRange.second || mIter != mRangeList.end(); }
222 operator bool()
const {
return this->test(); }
248 using Range = std::pair<const IndexType*, const IndexType*>;
249 using RangeDeque = std::deque<Range>;
250 using RangeDequeCIter =
typename RangeDeque::const_iterator;
251 using IndexArray = boost::scoped_array<IndexType>;
254 boost::scoped_array<ConstAccessorPtr> mAccessorList;
258 RangeDeque mRangeList;
259 RangeDequeCIter mIter;
261 IndexArray mIndexArray;
262 size_t mIndexArraySize, mAccessorListSize;
271 namespace particle_atlas_internal {
274 template<
typename ParticleArrayT>
277 using PosType =
typename ParticleArrayT::PosType;
281 : particleArray(&particles)
288 : particleArray(rhs.particleArray)
296 ScalarType radius, tmpMin = minRadius, tmpMax = maxRadius;
298 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
299 particleArray->getRadius(n, radius);
304 minRadius =
std::min(minRadius, tmpMin);
305 maxRadius =
std::max(maxRadius, tmpMax);
318 template<
typename ParticleArrayT,
typename Po
intIndex>
325 using PosType =
typename ParticleArray::PosType;
329 : mIndexMap(), mParticleArray(&particles), mSize(particles.size())
335 : mIndexMap(), mParticleArray(&particles), mSize(particles.size())
343 size_t size()
const {
return mSize; }
346 {
return mParticleArray->getPos(getGlobalIndex(n), xyz); }
348 {
return mParticleArray->getRadius(getGlobalIndex(n), radius); }
353 size_t getGlobalIndex(
size_t n)
const {
return mIndexMap ? size_t(mIndexMap[n]) : n; }
359 if (mMaxRadius < maxRadiusLimit)
return Ptr();
361 boost::scoped_array<bool> mask(
new bool[mSize]);
363 tbb::parallel_for(tbb::blocked_range<size_t>(0, mSize),
364 MaskParticles(*
this, mask, maxRadiusLimit));
367 if (output->size() == 0)
return Ptr();
370 for (
size_t n = 0, N = mSize; n < N; ++n) {
371 newSize += size_t(!mask[n]);
374 boost::scoped_array<PointIndex> newIndexMap(
new PointIndex[newSize]);
376 setIndexMap(newIndexMap, mask,
false);
379 mIndexMap.swap(newIndexMap);
393 const boost::scoped_array<bool>& mask)
394 : mIndexMap(), mParticleArray(&other.
particleArray()), mSize(0)
396 for (
size_t n = 0, N = other.
size(); n < N; ++n) {
397 mSize += size_t(mask[n]);
402 other.setIndexMap(mIndexMap, mask,
true);
408 struct MaskParticles {
410 const boost::scoped_array<bool>& mask,
ScalarType radius)
411 : particleArray(&particles)
412 , particleMask(mask.get())
413 , radiusLimit(radius)
417 void operator()(
const tbb::blocked_range<size_t>& range)
const {
420 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
421 particleArray->getRadius(n, radius);
422 particleMask[n] = !(radius < maxRadius);
427 bool *
const particleMask;
431 inline void updateExtremas() {
433 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, mSize), op);
438 void setIndexMap(boost::scoped_array<PointIndex>& newIndexMap,
439 const boost::scoped_array<bool>& mask,
bool maskValue)
const 441 if (mIndexMap.get() !=
nullptr) {
443 for (
size_t idx = 0, n = 0, N = mSize; n < N; ++n) {
444 if (mask[n] == maskValue) newIndexMap[idx++] = indices[n];
447 for (
size_t idx = 0, n = 0, N = mSize; n < N; ++n) {
448 if (mask[n] == maskValue) {
449 newIndexMap[idx++] =
PointIndex(static_cast<typename PointIndex::IntType>(n));
458 boost::scoped_array<PointIndex> mIndexMap;
459 ParticleArrayT
const *
const mParticleArray;
465 template<
typename ParticleArrayType,
typename Po
intIndexLeafNodeType>
468 RemapIndices(
const ParticleArrayType& particles, std::vector<PointIndexLeafNodeType*>& nodes)
469 : mParticles(&particles)
470 , mNodes(nodes.empty() ? nullptr : &nodes.front())
474 void operator()(
const tbb::blocked_range<size_t>& range)
const 476 using PointIndexType =
typename PointIndexLeafNodeType::ValueType;
477 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
479 PointIndexLeafNodeType& node = *mNodes[n];
480 const size_t numIndices = node.indices().size();
482 if (numIndices > 0) {
483 PointIndexType* begin = &node.indices().front();
484 const PointIndexType* end = begin + numIndices;
486 while (begin < end) {
487 *begin = PointIndexType(static_cast<typename PointIndexType::IntType>(
488 mParticles->getGlobalIndex(*begin)));
496 PointIndexLeafNodeType *
const *
const mNodes;
500 template<
typename ParticleArrayType,
typename IndexT>
503 using PosType =
typename ParticleArrayType::PosType;
506 using Range = std::pair<const IndexT*, const IndexT*>;
511 ScalarType radius,
const ParticleArrayType& particles,
bool hasUniformRadius =
false)
516 , mParticles(&particles)
517 , mHasUniformRadius(hasUniformRadius)
519 if (mHasUniformRadius) {
521 mParticles->getRadius(0, uniformRadius);
522 mRadius = mRadius + uniformRadius;
527 template <
typename LeafNodeType>
530 const size_t numIndices = leaf.indices().size();
531 if (numIndices > 0) {
532 const IndexT* begin = &leaf.indices().front();
533 filterVoxel(leaf.origin(), begin, begin + numIndices);
541 if (mHasUniformRadius) {
545 while (begin < end) {
546 mParticles->getPos(
size_t(*begin), pos);
547 const ScalarType distSqr = (mCenter - pos).lengthSqr();
548 if (distSqr < searchRadiusSqr) {
549 mIndices.push_back(*begin);
554 while (begin < end) {
555 const size_t idx = size_t(*begin);
556 mParticles->getPos(idx, pos);
559 mParticles->getRadius(idx, radius);
561 ScalarType searchRadiusSqr = mRadius + radius;
562 searchRadiusSqr *= searchRadiusSqr;
564 const ScalarType distSqr = (mCenter - pos).lengthSqr();
566 if (distSqr < searchRadiusSqr) {
567 mIndices.push_back(*begin);
583 ParticleArrayType
const *
const mParticles;
584 bool const mHasUniformRadius;
588 template<
typename ParticleArrayType,
typename IndexT>
591 using PosType =
typename ParticleArrayType::PosType;
594 using Range = std::pair<const IndexT*, const IndexT*>;
599 const BBoxd& bbox,
const ParticleArrayType& particles,
bool hasUniformRadius =
false)
603 , mCenter(mBBox.getCenter())
604 , mParticles(&particles)
605 , mHasUniformRadius(hasUniformRadius)
608 if (mHasUniformRadius) {
609 mParticles->getRadius(0, mUniformRadiusSqr);
610 mUniformRadiusSqr *= mUniformRadiusSqr;
614 template <
typename LeafNodeType>
617 const size_t numIndices = leaf.indices().size();
618 if (numIndices > 0) {
619 const IndexT* begin = &leaf.indices().front();
620 filterVoxel(leaf.origin(), begin, begin + numIndices);
628 if (mHasUniformRadius) {
629 const ScalarType radiusSqr = mUniformRadiusSqr;
631 while (begin < end) {
633 mParticles->getPos(
size_t(*begin), pos);
634 if (mBBox.isInside(pos)) {
635 mIndices.push_back(*begin++);
639 const ScalarType distSqr = pointToBBoxDistSqr(pos);
640 if (!(distSqr > radiusSqr)) {
641 mIndices.push_back(*begin);
648 while (begin < end) {
650 const size_t idx = size_t(*begin);
651 mParticles->getPos(idx, pos);
652 if (mBBox.isInside(pos)) {
653 mIndices.push_back(*begin++);
658 mParticles->getRadius(idx, radius);
659 const ScalarType distSqr = pointToBBoxDistSqr(pos);
660 if (!(distSqr > (radius * radius))) {
661 mIndices.push_back(*begin);
677 for (
int i = 0; i < 3; ++i) {
684 distSqr += delta * delta;
690 distSqr += delta * delta;
701 ParticleArrayType
const *
const mParticles;
702 bool const mHasUniformRadius;
713 template<
typename Po
intIndexGr
idType>
714 template<
typename ParticleArrayType>
717 const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels)
719 using SplittableParticleArray =
721 using SplittableParticleArrayPtr =
typename SplittableParticleArray::Ptr;
722 using ScalarType =
typename ParticleArrayType::ScalarType;
727 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, particles.size()), extremas);
728 const double firstMin = extremas.
minRadius;
729 const double firstMax = extremas.
maxRadius;
730 const double firstVoxelSize =
std::max(minVoxelSize, firstMin);
732 if (!(firstMax < (firstVoxelSize *
double(2.0))) && maxLevels > 1) {
734 std::vector<SplittableParticleArrayPtr> levels;
735 levels.push_back(SplittableParticleArrayPtr(
736 new SplittableParticleArray(particles, firstMin, firstMax)));
738 std::vector<double> voxelSizeArray;
739 voxelSizeArray.push_back(firstVoxelSize);
741 for (
size_t n = 0; n < maxLevels; ++n) {
743 const double maxParticleRadius = double(levels.back()->maxRadius());
744 const double particleRadiusLimit = voxelSizeArray.back() * double(2.0);
745 if (maxParticleRadius < particleRadiusLimit)
break;
747 SplittableParticleArrayPtr newLevel =
748 levels.back()->split(ScalarType(particleRadiusLimit));
749 if (!newLevel)
break;
751 levels.push_back(newLevel);
752 voxelSizeArray.push_back(
double(newLevel->minRadius()));
755 size_t numPoints = 0;
757 using PointIndexTreeType =
typename PointIndexGridType::TreeType;
758 using PointIndexLeafNodeType =
typename PointIndexTreeType::LeafNodeType;
760 std::vector<PointIndexLeafNodeType*> nodes;
762 for (
size_t n = 0, N = levels.size(); n < N; ++n) {
764 const SplittableParticleArray& particleArray = *levels[n];
766 numPoints += particleArray.size();
768 mMinRadiusArray.push_back(
double(particleArray.minRadius()));
769 mMaxRadiusArray.push_back(
double(particleArray.maxRadius()));
772 createPointIndexGrid<PointIndexGridType>(particleArray, voxelSizeArray[n]);
775 grid->tree().getNodes(nodes);
777 tbb::parallel_for(tbb::blocked_range<size_t>(0, nodes.size()),
779 PointIndexLeafNodeType>(particleArray, nodes));
781 mIndexGridArray.push_back(grid);
785 mMinRadiusArray.push_back(firstMin);
786 mMaxRadiusArray.push_back(firstMax);
787 mIndexGridArray.push_back(
788 createPointIndexGrid<PointIndexGridType>(particles, firstVoxelSize));
793 template<
typename Po
intIndexGr
idType>
794 template<
typename ParticleArrayType>
797 const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels)
800 ret->construct(particles, minVoxelSize, maxLevels);
809 template<
typename Po
intIndexGr
idType>
816 , mIter(mRangeList.begin())
819 , mAccessorListSize(atlas.levels())
821 if (mAccessorListSize > 0) {
823 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
830 template<
typename Po
intIndexGr
idType>
834 mIter = mRangeList.begin();
835 if (!mRangeList.empty()) {
836 mRange = mRangeList.front();
837 }
else if (mIndexArray) {
838 mRange.first = mIndexArray.get();
839 mRange.second = mRange.first + mIndexArraySize;
841 mRange.first =
static_cast<IndexType*
>(
nullptr);
842 mRange.second =
static_cast<IndexType*
>(
nullptr);
847 template<
typename Po
intIndexGr
idType>
852 if (mRange.first >= mRange.second && mIter != mRangeList.end()) {
854 if (mIter != mRangeList.end()) {
856 }
else if (mIndexArray) {
857 mRange.first = mIndexArray.get();
858 mRange.second = mRange.first + mIndexArraySize;
864 template<
typename Po
intIndexGr
idType>
868 if (!this->
test())
return false;
874 template<
typename Po
intIndexGr
idType>
879 typename RangeDeque::const_iterator it =
880 mRangeList.begin(), end = mRangeList.end();
882 for ( ; it != end; ++it) {
883 count += it->second - it->first;
886 return count + mIndexArraySize;
890 template<
typename Po
intIndexGr
idType>
894 mRange.first =
static_cast<IndexType*
>(
nullptr);
895 mRange.second =
static_cast<IndexType*
>(
nullptr);
897 mIter = mRangeList.end();
903 template<
typename Po
intIndexGr
idType>
907 using TreeType =
typename PointIndexGridType::TreeType;
908 using LeafNodeType =
typename TreeType::LeafNodeType;
912 if (mAccessorListSize > 0) {
913 const size_t levelIdx =
std::min(mAccessorListSize - 1, level);
918 std::vector<const LeafNodeType*> nodes;
919 tree.getNodes(nodes);
921 for (
size_t n = 0, N = nodes.size(); n < N; ++n) {
923 const LeafNodeType& node = *nodes[n];
924 const size_t numIndices = node.indices().size();
926 if (numIndices > 0) {
927 const IndexType* begin = &node.indices().front();
928 mRangeList.push_back(Range(begin, (begin + numIndices)));
937 template<
typename Po
intIndexGr
idType>
938 template<
typename ParticleArrayType>
941 const Vec3d& center,
double radius,
const ParticleArrayType& particles)
943 using PosType =
typename ParticleArrayType::PosType;
944 using ScalarType =
typename ParticleArrayType::ScalarType;
950 std::deque<IndexType> filteredIndices;
951 std::vector<CoordBBox> searchRegions;
953 const double iRadius = radius * double(1.0 / std::sqrt(3.0));
955 const Vec3d ibMin(center[0] - iRadius, center[1] - iRadius, center[2] - iRadius);
956 const Vec3d ibMax(center[0] + iRadius, center[1] + iRadius, center[2] + iRadius);
958 const Vec3d bMin(center[0] - radius, center[1] - radius, center[2] - radius);
959 const Vec3d bMax(center[0] + radius, center[1] + radius, center[2] + radius);
961 const PosType pos = PosType(center);
962 const ScalarType dist = ScalarType(radius);
964 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
969 const openvdb::math::Transform& xform = mAtlas->
pointIndexGrid(n).transform();
974 xform.worldToIndexCellCentered(ibMin),
975 xform.worldToIndexCellCentered(ibMax));
977 inscribedRegion.
expand(-1);
982 searchRegions.clear();
985 xform.worldToIndexCellCentered(bMin - maxRadius),
986 xform.worldToIndexCellCentered(bMax + maxRadius));
988 inscribedRegion.
expand(1);
990 searchRegions, region, inscribedRegion);
993 FilterType filter(mRangeList, filteredIndices, pos, dist, particles, uniformRadius);
995 for (
size_t i = 0, I = searchRegions.size(); i < I; ++i) {
1006 template<
typename Po
intIndexGr
idType>
1007 template<
typename ParticleArrayType>
1010 const BBoxd& bbox,
const ParticleArrayType& particles)
1014 std::deque<IndexType> filteredIndices;
1015 std::vector<CoordBBox> searchRegions;
1017 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
1021 const openvdb::math::Transform& xform = mAtlas->
pointIndexGrid(n).transform();
1026 xform.worldToIndexCellCentered(bbox.
min()),
1027 xform.worldToIndexCellCentered(bbox.
max()));
1029 inscribedRegion.
expand(-1);
1034 searchRegions.clear();
1037 xform.worldToIndexCellCentered(bbox.
min() -
maxRadius),
1038 xform.worldToIndexCellCentered(bbox.
max() +
maxRadius));
1040 inscribedRegion.
expand(1);
1042 searchRegions, region, inscribedRegion);
1045 FilterType filter(mRangeList, filteredIndices, bbox, particles, uniformRadius);
1047 for (
size_t i = 0, I = searchRegions.size(); i < I; ++i) {
1062 #endif // OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED SharedPtr< const ParticleAtlas > ConstPtr
Definition: ParticleAtlas.h:114
void filterLeafNode(const LeafNodeType &leaf)
Definition: ParticleAtlas.h:528
bool isApproxEqual(const Type &a, const Type &b)
Return true if a is equal to b to within the default floating-point comparison tolerance.
Definition: Math.h:370
void operator++()
Advance iterator to next item.
Definition: ParticleAtlas.h:229
PointIndexGridType & pointIndexGrid(size_t n)
Returns the PointIndexGrid that represents the given level n.
Definition: ParticleAtlas.h:153
void increment()
Advance iterator to next item.
Definition: ParticleAtlas.h:849
SharedPtr< SplittableParticleArray > Ptr
Definition: ParticleAtlas.h:321
SharedPtr< ParticleAtlas > Ptr
Definition: ParticleAtlas.h:113
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
PointIndexLeafNodeType *const *const mNodes
Definition: ParticleAtlas.h:496
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:592
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:266
void updateFromLevel(size_t level)
Clear the iterator and update it with all particles that reside at the given resolution level...
Definition: ParticleAtlas.h:905
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:502
bool test() const
Return true if this iterator is not yet exhausted.
Definition: ParticleAtlas.h:221
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:48
typename ParticleArray::PosType PosType
Definition: ParticleAtlas.h:325
void reset()
Reset the iterator to point to the first item.
Definition: ParticleAtlas.h:832
SplittableParticleArray(const ParticleArrayT &particles)
Definition: ParticleAtlas.h:328
void getPos(size_t n, PosType &xyz) const
Definition: ParticleAtlas.h:345
bool operator==(const Iterator &p) const
Return true if both iterators point to the same element.
Definition: ParticleAtlas.h:239
ScalarType maxRadius() const
Definition: ParticleAtlas.h:351
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition: Coord.h:408
std::pair< const IndexT *, const IndexT * > Range
Definition: ParticleAtlas.h:506
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:504
Definition: ParticleAtlas.h:501
size_t getGlobalIndex(size_t n) const
Definition: ParticleAtlas.h:353
typename PointIndexGridType::ValueType IndexType
Definition: ParticleAtlas.h:117
const PointIndexGridType & pointIndexGrid(size_t n) const
Returns the PointIndexGrid that represents the given level n.
Definition: ParticleAtlas.h:155
typename ParticleArrayType::PosType PosType
Definition: ParticleAtlas.h:503
ScalarType minRadius
Definition: ParticleAtlas.h:314
Selectively extract and filter point data using a custom filter operator.
Ptr split(ScalarType maxRadiusLimit)
Definition: ParticleAtlas.h:357
ParticleArrayT const *const particleArray
Definition: ParticleAtlas.h:313
typename ParticleArrayT::PosType PosType
Definition: ParticleAtlas.h:277
std::deque< IndexT > IndexDeque
Definition: ParticleAtlas.h:508
ScalarType minRadius() const
Definition: ParticleAtlas.h:350
typename ParticleArrayType::PosType PosType
Definition: ParticleAtlas.h:591
Provides accelerated range and nearest-neighbor searches for particles that are partitioned using the...
Definition: ParticleAtlas.h:179
ScalarType maxRadius
Definition: ParticleAtlas.h:314
#define OPENVDB_VERSION_NAME
Definition: version.h:43
Definition: ParticleAtlas.h:466
bool next()
Advance iterator to next item.
Definition: ParticleAtlas.h:866
Vec3< double > Vec3d
Definition: Vec3.h:708
bool operator!=(const Iterator &p) const
Definition: ParticleAtlas.h:240
size_t size() const
Definition: ParticleAtlas.h:343
const IndexType & operator*() const
Return a const reference to the item to which this iterator is pointing.
Definition: ParticleAtlas.h:217
ParticleArrayType const *const mParticles
Definition: ParticleAtlas.h:495
const ParticleArrayT & particleArray() const
Definition: ParticleAtlas.h:341
const Vec3T & min() const
Return a const reference to the minimum point of the BBox.
Definition: BBox.h:84
void getRadius(size_t n, ScalarType &radius) const
Definition: ParticleAtlas.h:347
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:278
std::deque< Range > RangeDeque
Definition: ParticleAtlas.h:595
const Vec3T & max() const
Return a const reference to the maximum point of the BBox.
Definition: BBox.h:87
Definition: Exceptions.h:39
size_t size() const
Return the number of point indices in the iterator range.
Definition: ParticleAtlas.h:876
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:326
SplittableParticleArray(const ParticleArrayT &particles, double minR, double maxR)
Definition: ParticleAtlas.h:334
ComputeExtremas(ComputeExtremas &rhs, tbb::split)
Definition: ParticleAtlas.h:287
Partition particles and performs range and nearest-neighbor searches.
size_t levels() const
Returns the total number of resolution levels.
Definition: ParticleAtlas.h:207
void filterLeafNode(const LeafNodeType &leaf)
Definition: ParticleAtlas.h:615
ParticleAtlas()
Definition: ParticleAtlas.h:123
void filterVoxel(const Coord &, const IndexT *begin, const IndexT *end)
Definition: ParticleAtlas.h:624
Definition: ParticleAtlas.h:589
tree::ValueAccessor< const TreeType > ConstAccessor
Definition: ParticleAtlas.h:182
void filterVoxel(const Coord &, const IndexT *begin, const IndexT *end)
Definition: ParticleAtlas.h:537
std::unique_ptr< ConstAccessor > ConstAccessorPtr
Definition: ParticleAtlas.h:183
RemapIndices(const ParticleArrayType &particles, std::vector< PointIndexLeafNodeType *> &nodes)
Definition: ParticleAtlas.h:468
typename PointIndexGridType::Ptr PointIndexGridPtr
Definition: ParticleAtlas.h:116
void operator()(const tbb::blocked_range< size_t > &range)
Definition: ParticleAtlas.h:294
void worldSpaceSearchAndUpdate(const Vec3d ¢er, double radius, const ParticleArrayType &particles)
Clear the iterator and update it with the result of the given world-space radial query.
Definition: ParticleAtlas.h:940
std::shared_ptr< T > SharedPtr
Definition: Types.h:130
Definition: ParticleAtlas.h:275
std::deque< Range > RangeDeque
Definition: ParticleAtlas.h:507
std::pair< const IndexT *, const IndexT * > Range
Definition: ParticleAtlas.h:594
double minRadius(size_t n) const
Returns minimum particle radius for level n.
Definition: ParticleAtlas.h:148
void operator()(const tbb::blocked_range< size_t > &range) const
Definition: ParticleAtlas.h:474
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
SharedPtr< const SplittableParticleArray > ConstPtr
Definition: ParticleAtlas.h:322
size_t levels() const
Returns the number of resolution levels.
Definition: ParticleAtlas.h:143
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:173
ComputeExtremas(const ParticleArrayT &particles)
Definition: ParticleAtlas.h:280
Definition: ParticleAtlas.h:111
double maxRadius(size_t n) const
Returns maximum particle radius for level n.
Definition: ParticleAtlas.h:150
void join(const ComputeExtremas &rhs)
Definition: ParticleAtlas.h:308
RadialRangeFilter(RangeDeque &ranges, IndexDeque &indices, const PosType &xyz, ScalarType radius, const ParticleArrayType &particles, bool hasUniformRadius=false)
Definition: ParticleAtlas.h:510
typename PointIndexGridType::TreeType TreeType
Definition: ParticleAtlas.h:181
BBoxFilter(RangeDeque &ranges, IndexDeque &indices, const BBoxd &bbox, const ParticleArrayType &particles, bool hasUniformRadius=false)
Definition: ParticleAtlas.h:598
bool empty() const
true if the container size is 0, false otherwise.
Definition: ParticleAtlas.h:145
Definition: ParticleAtlas.h:319
std::deque< IndexT > IndexDeque
Definition: ParticleAtlas.h:596