25 #ifndef OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED 26 #define OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED 36 #include <tbb/blocked_range.h> 37 #include <tbb/parallel_for.h> 38 #include <tbb/parallel_reduce.h> 82 template<
typename Po
intIndexGr
idType = Po
intIndexGr
id>
89 using IndexType =
typename PointIndexGridType::ValueType;
95 ParticleAtlas() : mIndexGridArray(), mMinRadiusArray(), mMaxRadiusArray() {}
102 template<
typename ParticleArrayType>
103 void construct(
const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels = 50);
110 template<
typename ParticleArrayType>
111 static Ptr create(
const ParticleArrayType& particles,
112 double minVoxelSize,
size_t maxLevels = 50);
115 size_t levels()
const {
return mIndexGridArray.size(); }
117 bool empty()
const {
return mIndexGridArray.empty(); }
120 double minRadius(
size_t n)
const {
return mMinRadiusArray[n]; }
122 double maxRadius(
size_t n)
const {
return mMaxRadiusArray[n]; }
127 const PointIndexGridType&
pointIndexGrid(
size_t n)
const {
return *mIndexGridArray[n]; }
134 std::vector<PointIndexGridPtr> mIndexGridArray;
135 std::vector<double> mMinRadiusArray, mMaxRadiusArray;
150 template<
typename Po
intIndexGr
idType>
153 using TreeType =
typename PointIndexGridType::TreeType;
167 template<
typename ParticleArrayType>
168 void worldSpaceSearchAndUpdate(
const Vec3d& center,
double radius,
169 const ParticleArrayType& particles);
175 template<
typename ParticleArrayType>
176 void worldSpaceSearchAndUpdate(
const BBoxd& bbox,
const ParticleArrayType& particles);
179 size_t levels()
const {
return mAtlas->levels(); }
183 void updateFromLevel(
size_t level);
193 bool test()
const {
return mRange.first < mRange.second || mIter != mRangeList.end(); }
194 operator bool()
const {
return this->test(); }
220 using Range = std::pair<const IndexType*, const IndexType*>;
221 using RangeDeque = std::deque<Range>;
222 using RangeDequeCIter =
typename RangeDeque::const_iterator;
223 using IndexArray = std::unique_ptr<IndexType[]>;
226 std::unique_ptr<ConstAccessorPtr[]> mAccessorList;
230 RangeDeque mRangeList;
231 RangeDequeCIter mIter;
234 size_t mIndexArraySize, mAccessorListSize;
243 namespace particle_atlas_internal {
246 template<
typename ParticleArrayT>
249 using PosType =
typename ParticleArrayT::PosType;
253 : particleArray(&particles)
260 : particleArray(rhs.particleArray)
268 ScalarType radius, tmpMin = minRadius, tmpMax = maxRadius;
270 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
271 particleArray->getRadius(n, radius);
276 minRadius =
std::min(minRadius, tmpMin);
277 maxRadius =
std::max(maxRadius, tmpMax);
290 template<
typename ParticleArrayT,
typename Po
intIndex>
297 using PosType =
typename ParticleArray::PosType;
301 : mIndexMap(), mParticleArray(&particles), mSize(particles.size())
307 : mIndexMap(), mParticleArray(&particles), mSize(particles.size())
315 size_t size()
const {
return mSize; }
318 {
return mParticleArray->getPos(getGlobalIndex(n), xyz); }
320 {
return mParticleArray->getRadius(getGlobalIndex(n), radius); }
325 size_t getGlobalIndex(
size_t n)
const {
return mIndexMap ? size_t(mIndexMap[n]) : n; }
331 if (mMaxRadius < maxRadiusLimit)
return Ptr();
333 std::unique_ptr<bool[]> mask{
new bool[mSize]};
335 tbb::parallel_for(tbb::blocked_range<size_t>(0, mSize),
336 MaskParticles(*
this, mask, maxRadiusLimit));
339 if (output->size() == 0)
return Ptr();
342 for (
size_t n = 0, N = mSize; n < N; ++n) {
343 newSize += size_t(!mask[n]);
346 std::unique_ptr<PointIndex[]> newIndexMap{
new PointIndex[newSize]};
348 setIndexMap(newIndexMap, mask,
false);
351 mIndexMap.swap(newIndexMap);
365 const std::unique_ptr<
bool[]>& mask)
366 : mIndexMap(), mParticleArray(&other.particleArray()), mSize(0)
368 for (
size_t n = 0, N = other.
size(); n < N; ++n) {
369 mSize += size_t(mask[n]);
374 other.setIndexMap(mIndexMap, mask,
true);
380 struct MaskParticles {
381 MaskParticles(
const SplittableParticleArray& particles,
382 const std::unique_ptr<
bool[]>& mask, ScalarType radius)
383 : particleArray(&particles)
384 , particleMask(mask.get())
385 , radiusLimit(radius)
389 void operator()(
const tbb::blocked_range<size_t>& range)
const {
390 const ScalarType maxRadius = radiusLimit;
392 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
393 particleArray->getRadius(n, radius);
394 particleMask[n] = !(radius < maxRadius);
398 SplittableParticleArray
const *
const particleArray;
399 bool *
const particleMask;
400 ScalarType
const radiusLimit;
403 inline void updateExtremas() {
404 ComputeExtremas<SplittableParticleArray> op(*
this);
405 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, mSize), op);
406 mMinRadius = op.minRadius;
407 mMaxRadius = op.maxRadius;
410 void setIndexMap(std::unique_ptr<PointIndex[]>& newIndexMap,
411 const std::unique_ptr<
bool[]>& mask,
bool maskValue)
const 413 if (mIndexMap.get() !=
nullptr) {
414 const PointIndex* indices = mIndexMap.get();
415 for (
size_t idx = 0, n = 0, N = mSize; n < N; ++n) {
416 if (mask[n] == maskValue) newIndexMap[idx++] = indices[n];
419 for (
size_t idx = 0, n = 0, N = mSize; n < N; ++n) {
420 if (mask[n] == maskValue) {
421 newIndexMap[idx++] = PointIndex(static_cast<typename PointIndex::IntType>(n));
430 std::unique_ptr<PointIndex[]> mIndexMap;
431 ParticleArrayT
const *
const mParticleArray;
433 ScalarType mMinRadius, mMaxRadius;
437 template<
typename ParticleArrayType,
typename Po
intIndexLeafNodeType>
440 RemapIndices(
const ParticleArrayType& particles, std::vector<PointIndexLeafNodeType*>& nodes)
441 : mParticles(&particles)
442 , mNodes(nodes.empty() ? nullptr : &nodes.front())
446 void operator()(
const tbb::blocked_range<size_t>& range)
const 448 using PointIndexType =
typename PointIndexLeafNodeType::ValueType;
449 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
451 PointIndexLeafNodeType& node = *mNodes[n];
452 const size_t numIndices = node.indices().size();
454 if (numIndices > 0) {
455 PointIndexType* begin = &node.indices().front();
456 const PointIndexType* end = begin + numIndices;
458 while (begin < end) {
459 *begin = PointIndexType(static_cast<typename PointIndexType::IntType>(
460 mParticles->getGlobalIndex(*begin)));
468 PointIndexLeafNodeType *
const *
const mNodes;
472 template<
typename ParticleArrayType,
typename IndexT>
475 using PosType =
typename ParticleArrayType::PosType;
478 using Range = std::pair<const IndexT*, const IndexT*>;
483 ScalarType radius,
const ParticleArrayType& particles,
bool hasUniformRadius =
false)
488 , mParticles(&particles)
489 , mHasUniformRadius(hasUniformRadius)
491 if (mHasUniformRadius) {
493 mParticles->getRadius(0, uniformRadius);
494 mRadius = mRadius + uniformRadius;
499 template <
typename LeafNodeType>
502 const size_t numIndices = leaf.indices().size();
503 if (numIndices > 0) {
504 const IndexT* begin = &leaf.indices().front();
505 filterVoxel(leaf.origin(), begin, begin + numIndices);
513 if (mHasUniformRadius) {
517 while (begin < end) {
518 mParticles->getPos(
size_t(*begin), pos);
519 const ScalarType distSqr = (mCenter - pos).lengthSqr();
520 if (distSqr < searchRadiusSqr) {
521 mIndices.push_back(*begin);
526 while (begin < end) {
527 const size_t idx = size_t(*begin);
528 mParticles->getPos(idx, pos);
531 mParticles->getRadius(idx, radius);
533 ScalarType searchRadiusSqr = mRadius + radius;
534 searchRadiusSqr *= searchRadiusSqr;
536 const ScalarType distSqr = (mCenter - pos).lengthSqr();
538 if (distSqr < searchRadiusSqr) {
539 mIndices.push_back(*begin);
552 IndexDeque& mIndices;
553 PosType
const mCenter;
555 ParticleArrayType
const *
const mParticles;
556 bool const mHasUniformRadius;
560 template<
typename ParticleArrayType,
typename IndexT>
563 using PosType =
typename ParticleArrayType::PosType;
566 using Range = std::pair<const IndexT*, const IndexT*>;
571 const BBoxd& bbox,
const ParticleArrayType& particles,
bool hasUniformRadius =
false)
575 , mCenter(mBBox.getCenter())
576 , mParticles(&particles)
577 , mHasUniformRadius(hasUniformRadius)
580 if (mHasUniformRadius) {
581 mParticles->getRadius(0, mUniformRadiusSqr);
582 mUniformRadiusSqr *= mUniformRadiusSqr;
586 template <
typename LeafNodeType>
589 const size_t numIndices = leaf.indices().size();
590 if (numIndices > 0) {
591 const IndexT* begin = &leaf.indices().front();
592 filterVoxel(leaf.origin(), begin, begin + numIndices);
600 if (mHasUniformRadius) {
601 const ScalarType radiusSqr = mUniformRadiusSqr;
603 while (begin < end) {
605 mParticles->getPos(
size_t(*begin), pos);
606 if (mBBox.isInside(pos)) {
607 mIndices.push_back(*begin++);
611 const ScalarType distSqr = pointToBBoxDistSqr(pos);
612 if (!(distSqr > radiusSqr)) {
613 mIndices.push_back(*begin);
620 while (begin < end) {
622 const size_t idx = size_t(*begin);
623 mParticles->getPos(idx, pos);
624 if (mBBox.isInside(pos)) {
625 mIndices.push_back(*begin++);
630 mParticles->getRadius(idx, radius);
631 const ScalarType distSqr = pointToBBoxDistSqr(pos);
632 if (!(distSqr > (radius * radius))) {
633 mIndices.push_back(*begin);
645 ScalarType pointToBBoxDistSqr(
const PosType& pos)
const 647 ScalarType distSqr = ScalarType(0.0);
649 for (
int i = 0; i < 3; ++i) {
651 const ScalarType a = pos[i];
653 ScalarType b = mBBox.min()[i];
655 ScalarType delta = b - a;
656 distSqr += delta * delta;
661 ScalarType delta = a - b;
662 distSqr += delta * delta;
670 IndexDeque& mIndices;
671 math::BBox<PosType>
const mBBox;
672 PosType
const mCenter;
673 ParticleArrayType
const *
const mParticles;
674 bool const mHasUniformRadius;
675 ScalarType mUniformRadiusSqr;
685 template<
typename Po
intIndexGr
idType>
686 template<
typename ParticleArrayType>
689 const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels)
691 using SplittableParticleArray =
693 using SplittableParticleArrayPtr =
typename SplittableParticleArray::Ptr;
694 using ScalarType =
typename ParticleArrayType::ScalarType;
699 tbb::parallel_reduce(tbb::blocked_range<size_t>(0, particles.size()), extremas);
700 const double firstMin = extremas.
minRadius;
701 const double firstMax = extremas.
maxRadius;
702 const double firstVoxelSize =
std::max(minVoxelSize, firstMin);
704 if (!(firstMax < (firstVoxelSize *
double(2.0))) && maxLevels > 1) {
706 std::vector<SplittableParticleArrayPtr> levels;
707 levels.push_back(SplittableParticleArrayPtr(
708 new SplittableParticleArray(particles, firstMin, firstMax)));
710 std::vector<double> voxelSizeArray;
711 voxelSizeArray.push_back(firstVoxelSize);
713 for (
size_t n = 0; n < maxLevels; ++n) {
715 const double maxParticleRadius = double(levels.back()->maxRadius());
716 const double particleRadiusLimit = voxelSizeArray.back() * double(2.0);
717 if (maxParticleRadius < particleRadiusLimit)
break;
719 SplittableParticleArrayPtr newLevel =
720 levels.back()->split(ScalarType(particleRadiusLimit));
721 if (!newLevel)
break;
723 levels.push_back(newLevel);
724 voxelSizeArray.push_back(
double(newLevel->minRadius()));
727 size_t numPoints = 0;
729 using PointIndexTreeType =
typename PointIndexGridType::TreeType;
730 using PointIndexLeafNodeType =
typename PointIndexTreeType::LeafNodeType;
732 std::vector<PointIndexLeafNodeType*> nodes;
734 for (
size_t n = 0, N = levels.size(); n < N; ++n) {
736 const SplittableParticleArray& particleArray = *levels[n];
738 numPoints += particleArray.size();
740 mMinRadiusArray.push_back(
double(particleArray.minRadius()));
741 mMaxRadiusArray.push_back(
double(particleArray.maxRadius()));
744 createPointIndexGrid<PointIndexGridType>(particleArray, voxelSizeArray[n]);
747 grid->tree().getNodes(nodes);
749 tbb::parallel_for(tbb::blocked_range<size_t>(0, nodes.size()),
751 PointIndexLeafNodeType>(particleArray, nodes));
753 mIndexGridArray.push_back(grid);
757 mMinRadiusArray.push_back(firstMin);
758 mMaxRadiusArray.push_back(firstMax);
759 mIndexGridArray.push_back(
760 createPointIndexGrid<PointIndexGridType>(particles, firstVoxelSize));
765 template<
typename Po
intIndexGr
idType>
766 template<
typename ParticleArrayType>
769 const ParticleArrayType& particles,
double minVoxelSize,
size_t maxLevels)
772 ret->construct(particles, minVoxelSize, maxLevels);
781 template<
typename Po
intIndexGr
idType>
788 , mIter(mRangeList.begin())
791 , mAccessorListSize(atlas.levels())
793 if (mAccessorListSize > 0) {
795 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
802 template<
typename Po
intIndexGr
idType>
806 mIter = mRangeList.begin();
807 if (!mRangeList.empty()) {
808 mRange = mRangeList.front();
809 }
else if (mIndexArray) {
810 mRange.first = mIndexArray.get();
811 mRange.second = mRange.first + mIndexArraySize;
813 mRange.first = static_cast<IndexType*>(
nullptr);
814 mRange.second = static_cast<IndexType*>(
nullptr);
819 template<
typename Po
intIndexGr
idType>
824 if (mRange.first >= mRange.second && mIter != mRangeList.end()) {
826 if (mIter != mRangeList.end()) {
828 }
else if (mIndexArray) {
829 mRange.first = mIndexArray.get();
830 mRange.second = mRange.first + mIndexArraySize;
836 template<
typename Po
intIndexGr
idType>
840 if (!this->test())
return false;
846 template<
typename Po
intIndexGr
idType>
851 typename RangeDeque::const_iterator it =
852 mRangeList.begin(), end = mRangeList.end();
854 for ( ; it != end; ++it) {
855 count += it->second - it->first;
858 return count + mIndexArraySize;
862 template<
typename Po
intIndexGr
idType>
866 mRange.first = static_cast<IndexType*>(
nullptr);
867 mRange.second = static_cast<IndexType*>(
nullptr);
869 mIter = mRangeList.end();
875 template<
typename Po
intIndexGr
idType>
879 using TreeT =
typename PointIndexGridType::TreeType;
880 using LeafNodeType =
typename TreeType::LeafNodeType;
884 if (mAccessorListSize > 0) {
885 const size_t levelIdx =
std::min(mAccessorListSize - 1, level);
887 const TreeT& tree = mAtlas->pointIndexGrid(levelIdx).tree();
889 std::vector<const LeafNodeType*> nodes;
890 tree.getNodes(nodes);
892 for (
size_t n = 0, N = nodes.size(); n < N; ++n) {
894 const LeafNodeType& node = *nodes[n];
895 const size_t numIndices = node.indices().size();
897 if (numIndices > 0) {
898 const IndexType* begin = &node.indices().front();
899 mRangeList.push_back(Range(begin, (begin + numIndices)));
908 template<
typename Po
intIndexGr
idType>
909 template<
typename ParticleArrayType>
912 const Vec3d& center,
double radius,
const ParticleArrayType& particles)
914 using PosType =
typename ParticleArrayType::PosType;
915 using ScalarType =
typename ParticleArrayType::ScalarType;
921 std::deque<IndexType> filteredIndices;
922 std::vector<CoordBBox> searchRegions;
924 const double iRadius = radius * double(1.0 / std::sqrt(3.0));
926 const Vec3d ibMin(center[0] - iRadius, center[1] - iRadius, center[2] - iRadius);
927 const Vec3d ibMax(center[0] + iRadius, center[1] + iRadius, center[2] + iRadius);
929 const Vec3d bMin(center[0] - radius, center[1] - radius, center[2] - radius);
930 const Vec3d bMax(center[0] + radius, center[1] + radius, center[2] + radius);
932 const PosType pos = PosType(center);
933 const ScalarType dist = ScalarType(radius);
935 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
937 const double maxRadius = mAtlas->maxRadius(n);
940 const openvdb::math::Transform& xform = mAtlas->pointIndexGrid(n).transform();
945 xform.worldToIndexCellCentered(ibMin),
946 xform.worldToIndexCellCentered(ibMax));
948 inscribedRegion.
expand(-1);
953 searchRegions.clear();
956 xform.worldToIndexCellCentered(bMin -
maxRadius),
957 xform.worldToIndexCellCentered(bMax +
maxRadius));
959 inscribedRegion.
expand(1);
961 searchRegions, region, inscribedRegion);
964 FilterType filter(mRangeList, filteredIndices, pos, dist, particles, uniformRadius);
966 for (
size_t i = 0, I = searchRegions.size(); i < I; ++i) {
977 template<
typename Po
intIndexGr
idType>
978 template<
typename ParticleArrayType>
981 const BBoxd& bbox,
const ParticleArrayType& particles)
985 std::deque<IndexType> filteredIndices;
986 std::vector<CoordBBox> searchRegions;
988 for (
size_t n = 0, N = mAccessorListSize; n < N; ++n) {
990 const double maxRadius = mAtlas->maxRadius(n);
992 const openvdb::math::Transform& xform = mAtlas->pointIndexGrid(n).transform();
997 xform.worldToIndexCellCentered(bbox.
min()),
998 xform.worldToIndexCellCentered(bbox.
max()));
1000 inscribedRegion.
expand(-1);
1005 searchRegions.clear();
1008 xform.worldToIndexCellCentered(bbox.
min() -
maxRadius),
1009 xform.worldToIndexCellCentered(bbox.
max() +
maxRadius));
1011 inscribedRegion.
expand(1);
1013 searchRegions, region, inscribedRegion);
1016 FilterType filter(mRangeList, filteredIndices, bbox, particles, uniformRadius);
1018 for (
size_t i = 0, I = searchRegions.size(); i < I; ++i) {
1033 #endif // OPENVDB_TOOLS_PARTICLE_ATLAS_HAS_BEEN_INCLUDED BBoxFilter(RangeDeque &ranges, IndexDeque &indices, const BBoxd &bbox, const ParticleArrayType &particles, bool hasUniformRadius=false)
Definition: ParticleAtlas.h:570
PointIndexLeafNodeType *const *const mNodes
Definition: ParticleAtlas.h:468
std::deque< Range > RangeDeque
Definition: ParticleAtlas.h:479
tree::ValueAccessor< const TreeType > ConstAccessor
Definition: ParticleAtlas.h:154
std::pair< const IndexT *, const IndexT * > Range
Definition: ParticleAtlas.h:566
void getPos(size_t n, PosType &xyz) const
Definition: ParticleAtlas.h:317
void filterLeafNode(const LeafNodeType &leaf)
Definition: ParticleAtlas.h:587
Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Gri...
Definition: Types.h:133
typename PointIndexGridType::Ptr PointIndexGridPtr
Definition: ParticleAtlas.h:88
void join(const ComputeExtremas &rhs)
Definition: ParticleAtlas.h:280
void operator++()
Advance iterator to next item.
Definition: ParticleAtlas.h:201
typename ParticleArrayType::PosType PosType
Definition: ParticleAtlas.h:475
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:351
bool next()
Advance iterator to next item.
Definition: ParticleAtlas.h:838
Vec3< double > Vec3d
Definition: Vec3.h:662
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
void expand(ValueType padding)
Pad this bounding box with the specified padding.
Definition: Coord.h:418
std::deque< Range > RangeDeque
Definition: ParticleAtlas.h:567
typename ParticleArray::PosType PosType
Definition: ParticleAtlas.h:297
double maxRadius(size_t n) const
Returns maximum particle radius for level n.
Definition: ParticleAtlas.h:122
std::shared_ptr< T > SharedPtr
Definition: Types.h:91
void getRadius(size_t n, ScalarType &radius) const
Definition: ParticleAtlas.h:319
bool test() const
Return true if this iterator is not yet exhausted.
Definition: ParticleAtlas.h:193
Provides accelerated range and nearest-neighbor searches for particles that are partitioned using the...
Definition: ParticleAtlas.h:151
void updateFromLevel(size_t level)
Clear the iterator and update it with all particles that reside at the given resolution level.
Definition: ParticleAtlas.h:877
Ptr split(ScalarType maxRadiusLimit)
Definition: ParticleAtlas.h:329
typename PointIndexGridType::TreeType TreeType
Definition: ParticleAtlas.h:153
void operator()(const tbb::blocked_range< size_t > &range) const
Definition: ParticleAtlas.h:446
Definition: ParticleAtlas.h:291
std::pair< const IndexT *, const IndexT * > Range
Definition: ParticleAtlas.h:478
const PointIndexGridType & pointIndexGrid(size_t n) const
Returns the PointIndexGrid that represents the given level n.
Definition: ParticleAtlas.h:127
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
SharedPtr< SplittableParticleArray > Ptr
Definition: ParticleAtlas.h:293
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:476
ScalarType maxRadius() const
Definition: ParticleAtlas.h:323
SharedPtr< const SplittableParticleArray > ConstPtr
Definition: ParticleAtlas.h:294
Definition: ParticleAtlas.h:247
void increment()
Advance iterator to next item.
Definition: ParticleAtlas.h:821
PointIndexGridType & pointIndexGrid(size_t n)
Returns the PointIndexGrid that represents the given level n.
Definition: ParticleAtlas.h:125
SharedPtr< ParticleAtlas > Ptr
Definition: ParticleAtlas.h:85
Selectively extract and filter point data using a custom filter operator.
std::unique_ptr< ConstAccessor > ConstAccessorPtr
Definition: ParticleAtlas.h:155
ComputeExtremas(const ParticleArrayT &particles)
Definition: ParticleAtlas.h:252
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:102
size_t getGlobalIndex(size_t n) const
Definition: ParticleAtlas.h:325
size_t levels() const
Returns the total number of resolution levels.
Definition: ParticleAtlas.h:179
ParticleArrayT const *const particleArray
Definition: ParticleAtlas.h:285
const Vec3T & min() const
Return a const reference to the minimum point of this bounding box.
Definition: BBox.h:62
ScalarType minRadius
Definition: ParticleAtlas.h:286
size_t levels() const
Returns the number of resolution levels.
Definition: ParticleAtlas.h:115
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:911
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:298
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:564
void filterVoxel(const Coord &, const IndexT *begin, const IndexT *end)
Definition: ParticleAtlas.h:596
Definition: Exceptions.h:13
std::deque< IndexT > IndexDeque
Definition: ParticleAtlas.h:480
ComputeExtremas(ComputeExtremas &rhs, tbb::split)
Definition: ParticleAtlas.h:259
typename ParticleArrayType::PosType PosType
Definition: ParticleAtlas.h:563
std::vector< Index > IndexArray
Definition: PointMove.h:161
typename PointIndexGridType::ValueType IndexType
Definition: ParticleAtlas.h:89
std::deque< IndexT > IndexDeque
Definition: ParticleAtlas.h:568
Definition: ParticleAtlas.h:473
void operator()(const tbb::blocked_range< size_t > &range)
Definition: ParticleAtlas.h:266
Partition particles and performs range and nearest-neighbor searches.
const Vec3T & max() const
Return a const reference to the maximum point of this bounding box.
Definition: BBox.h:64
typename PosType::value_type ScalarType
Definition: ParticleAtlas.h:250
void filterVoxel(const Coord &, const IndexT *begin, const IndexT *end)
Definition: ParticleAtlas.h:509
ScalarType minRadius() const
Definition: ParticleAtlas.h:322
SplittableParticleArray(const ParticleArrayT &particles, double minR, double maxR)
Definition: ParticleAtlas.h:306
RadialRangeFilter(RangeDeque &ranges, IndexDeque &indices, const PosType &xyz, ScalarType radius, const ParticleArrayType &particles, bool hasUniformRadius=false)
Definition: ParticleAtlas.h:482
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:471
ScalarType maxRadius
Definition: ParticleAtlas.h:286
SplittableParticleArray(const ParticleArrayT &particles)
Definition: ParticleAtlas.h:300
bool operator!=(const Iterator &p) const
Definition: ParticleAtlas.h:212
size_t size() const
Definition: ParticleAtlas.h:315
ParticleAtlas()
Definition: ParticleAtlas.h:95
SharedPtr< const ParticleAtlas > ConstPtr
Definition: ParticleAtlas.h:86
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
size_t size() const
Return the number of point indices in the iterator range.
Definition: ParticleAtlas.h:848
const ParticleArrayT & particleArray() const
Definition: ParticleAtlas.h:313
void reset()
Reset the iterator to point to the first item.
Definition: ParticleAtlas.h:804
bool empty() const
true if the container size is 0, false otherwise.
Definition: ParticleAtlas.h:117
Definition: ParticleAtlas.h:561
typename ParticleArrayT::PosType PosType
Definition: ParticleAtlas.h:249
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
Definition: ParticleAtlas.h:438
void filterLeafNode(const LeafNodeType &leaf)
Definition: ParticleAtlas.h:500
bool operator==(const Iterator &p) const
Return true if both iterators point to the same element.
Definition: ParticleAtlas.h:211
double minRadius(size_t n) const
Returns minimum particle radius for level n.
Definition: ParticleAtlas.h:120
ParticleArrayType const *const mParticles
Definition: ParticleAtlas.h:467
RemapIndices(const ParticleArrayType &particles, std::vector< PointIndexLeafNodeType * > &nodes)
Definition: ParticleAtlas.h:440
const IndexType & operator*() const
Return a const reference to the item to which this iterator is pointing.
Definition: ParticleAtlas.h:189
Definition: ParticleAtlas.h:83