OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
ParticleAtlas< PointIndexGridType >::Iterator Struct Reference

Provides accelerated range and nearest-neighbor searches for particles that are partitioned using the ParticleAtlas. More...

#include <openvdb/tools/ParticleAtlas.h>

Public Types

using TreeType = typename PointIndexGridType::TreeType
 
using ConstAccessor = tree::ValueAccessor<const TreeType>
 
using ConstAccessorPtr = std::unique_ptr<ConstAccessor>
 
using Ptr
 
using ConstPtr
 
using PointIndexGridPtr
 
using IndexType
 

Public Member Functions

 Iterator (const ParticleAtlas &atlas)
 Construct an iterator from the given atlas.
 
template<typename ParticleArrayType>
void worldSpaceSearchAndUpdate (const Vec3d &center, double radius, const ParticleArrayType &particles)
 Clear the iterator and update it with the result of the given world-space radial query.
 
template<typename ParticleArrayType>
void worldSpaceSearchAndUpdate (const BBoxd &bbox, const ParticleArrayType &particles)
 Clear the iterator and update it with the result of the given world-space radial query.
 
size_t levels () const
 Returns the total number of resolution levels.
 
void updateFromLevel (size_t level)
 Clear the iterator and update it with all particles that reside at the given resolution level.
 
void reset ()
 Reset the iterator to point to the first item.
 
const IndexTypeoperator* () const
 Return a const reference to the item to which this iterator is pointing.
 
void increment ()
 Advance iterator to next item.
 
void operator++ ()
 Advance iterator to next item.
 
bool next ()
 Advance iterator to next item.
 
size_t size () const
 Return the number of point indices in the iterator range.
 
bool operator== (const Iterator &p) const
 Return true if both iterators point to the same element.
 
bool operator!= (const Iterator &p) const
 
 ParticleAtlas ()
 
void construct (const ParticleArrayType &particles, double minVoxelSize, size_t maxLevels=50)
 Partitions particle indices.
 
size_t levels () const
 Returns the number of resolution levels.
 
bool empty () const
 true if the container size is 0, false otherwise.
 
double minRadius (size_t n) const
 Returns minimum particle radius for level n.
 
double maxRadius (size_t n) const
 Returns maximum particle radius for level n.
 
PointIndexGridType & pointIndexGrid (size_t n)
 Returns the PointIndexGrid that represents the given level n.
 
const PointIndexGridType & pointIndexGrid (size_t n) const
 Returns the PointIndexGrid that represents the given level n.
 
bool test () const
 Return true if this iterator is not yet exhausted.
 
 operator bool () const
 Return true if this iterator is not yet exhausted.
 

Static Public Member Functions

static Ptr create (const ParticleArrayType &particles, double minVoxelSize, size_t maxLevels=50)
 Create a new ParticleAtlas from the given particles.
 

Detailed Description

template<typename PointIndexGridType = PointIndexGrid>
struct openvdb::v12_0::tools::ParticleAtlas< PointIndexGridType >::Iterator

Provides accelerated range and nearest-neighbor searches for particles that are partitioned using the ParticleAtlas.

Note
Prefer to construct the iterator object once and reuse it for subsequent queries.

Member Typedef Documentation

◆ ConstAccessor

template<typename PointIndexGridType = PointIndexGrid>
using ConstAccessor = tree::ValueAccessor<const TreeType>

◆ ConstAccessorPtr

template<typename PointIndexGridType = PointIndexGrid>
using ConstAccessorPtr = std::unique_ptr<ConstAccessor>

◆ ConstPtr

using ConstPtr

◆ IndexType

using IndexType

◆ PointIndexGridPtr

◆ Ptr

using Ptr

◆ TreeType

template<typename PointIndexGridType = PointIndexGrid>
using TreeType = typename PointIndexGridType::TreeType

Constructor & Destructor Documentation

◆ Iterator()

template<typename PointIndexGridType>
Iterator ( const ParticleAtlas & atlas)
inlineexplicit

Construct an iterator from the given atlas.

Member Function Documentation

◆ construct()

void construct ( const ParticleArrayType & particles,
double minVoxelSize,
size_t maxLevels = 50 )
inline

Partitions particle indices.

Parameters
particlescontainer conforming to the ParticleArray interface
minVoxelSizeminimum voxel size limit
maxLevelsmaximum number of resolution levels

◆ create()

ParticleAtlas< PointIndexGridType >::Ptr create ( const ParticleArrayType & particles,
double minVoxelSize,
size_t maxLevels = 50 )
inlinestatic

Create a new ParticleAtlas from the given particles.

Parameters
particlescontainer conforming to the ParticleArray interface
minVoxelSizeminimum voxel size limit
maxLevelsmaximum number of resolution levels

◆ empty()

bool empty ( ) const
inline

true if the container size is 0, false otherwise.

◆ increment()

template<typename PointIndexGridType>
void increment ( )
inline

Advance iterator to next item.

◆ levels() [1/2]

size_t levels ( ) const
inline

Returns the number of resolution levels.

◆ levels() [2/2]

template<typename PointIndexGridType = PointIndexGrid>
size_t levels ( ) const
inline

Returns the total number of resolution levels.

◆ maxRadius()

double maxRadius ( size_t n) const
inline

Returns maximum particle radius for level n.

◆ minRadius()

double minRadius ( size_t n) const
inline

Returns minimum particle radius for level n.

◆ next()

template<typename PointIndexGridType>
bool next ( )
inline

Advance iterator to next item.

Returns
true if this iterator is not yet exhausted.

◆ operator bool()

template<typename PointIndexGridType = PointIndexGrid>
operator bool ( ) const
inline

Return true if this iterator is not yet exhausted.

◆ operator!=()

template<typename PointIndexGridType = PointIndexGrid>
bool operator!= ( const Iterator & p) const
inline

◆ operator*()

template<typename PointIndexGridType = PointIndexGrid>
const IndexType & operator* ( ) const
inline

Return a const reference to the item to which this iterator is pointing.

◆ operator++()

template<typename PointIndexGridType = PointIndexGrid>
void operator++ ( )
inline

Advance iterator to next item.

◆ operator==()

template<typename PointIndexGridType = PointIndexGrid>
bool operator== ( const Iterator & p) const
inline

Return true if both iterators point to the same element.

◆ ParticleAtlas()

ParticleAtlas ( )
inline

◆ pointIndexGrid() [1/2]

PointIndexGridType & pointIndexGrid ( size_t n)
inline

Returns the PointIndexGrid that represents the given level n.

◆ pointIndexGrid() [2/2]

const PointIndexGridType & pointIndexGrid ( size_t n) const
inline

Returns the PointIndexGrid that represents the given level n.

◆ reset()

template<typename PointIndexGridType>
void reset ( )
inline

Reset the iterator to point to the first item.

◆ size()

template<typename PointIndexGridType>
size_t size ( ) const
inline

Return the number of point indices in the iterator range.

◆ test()

template<typename PointIndexGridType = PointIndexGrid>
bool test ( ) const
inline

Return true if this iterator is not yet exhausted.

◆ updateFromLevel()

template<typename PointIndexGridType>
void updateFromLevel ( size_t level)
inline

Clear the iterator and update it with all particles that reside at the given resolution level.

◆ worldSpaceSearchAndUpdate() [1/2]

template<typename PointIndexGridType>
template<typename ParticleArrayType>
void worldSpaceSearchAndUpdate ( const BBoxd & bbox,
const ParticleArrayType & particles )
inline

Clear the iterator and update it with the result of the given world-space radial query.

Parameters
bboxworld-space bounding box
particlescontainer conforming to the ParticleArray interface

◆ worldSpaceSearchAndUpdate() [2/2]

template<typename PointIndexGridType>
template<typename ParticleArrayType>
void worldSpaceSearchAndUpdate ( const Vec3d & center,
double radius,
const ParticleArrayType & particles )
inline

Clear the iterator and update it with the result of the given world-space radial query.

Parameters
centerworld-space center
radiusworld-space search radius
particlescontainer conforming to the ParticleArray interface