OpenVDB  12.0.0
Public Types | Public Member Functions | List of all members
PointIndexIterator< TreeType > Struct Template Reference

Accelerated range and nearest-neighbor searches for point index grids. More...

#include <openvdb/tools/PointIndexGrid.h>

Public Types

using ConstAccessor = tree::ValueAccessor< const TreeType >
 
using LeafNodeType = typename TreeType::LeafNodeType
 
using ValueType = typename TreeType::ValueType
 

Public Member Functions

 PointIndexIterator ()
 
 PointIndexIterator (const PointIndexIterator &rhs)
 
PointIndexIteratoroperator= (const PointIndexIterator &rhs)
 
 PointIndexIterator (const Coord &ijk, ConstAccessor &acc)
 Construct an iterator over the indices of the points contained in voxel (i, j, k). More...
 
 PointIndexIterator (const CoordBBox &bbox, ConstAccessor &acc)
 Construct an iterator over the indices of the points contained in the given bounding box. More...
 
void searchAndUpdate (const Coord &ijk, ConstAccessor &acc)
 Clear the iterator and update it with the result of the given voxel query. More...
 
void searchAndUpdate (const CoordBBox &bbox, ConstAccessor &acc)
 Clear the iterator and update it with the result of the given voxel region query. More...
 
template<typename PointArray >
void searchAndUpdate (const BBoxd &bbox, ConstAccessor &acc, const PointArray &points, const math::Transform &xform)
 Clear the iterator and update it with the result of the given index-space bounding box query. More...
 
template<typename PointArray >
void searchAndUpdate (const Vec3d &center, double radius, ConstAccessor &acc, const PointArray &points, const math::Transform &xform, bool subvoxelAccuracy=true)
 Clear the iterator and update it with the result of the given index-space radial query. More...
 
template<typename PointArray >
void worldSpaceSearchAndUpdate (const BBoxd &bbox, ConstAccessor &acc, const PointArray &points, const math::Transform &xform)
 Clear the iterator and update it with the result of the given world-space bounding box query. More...
 
template<typename PointArray >
void worldSpaceSearchAndUpdate (const Vec3d &center, double radius, ConstAccessor &acc, const PointArray &points, const math::Transform &xform, bool subvoxelAccuracy=true)
 Clear the iterator and update it with the result of the given world-space radial query. More...
 
void reset ()
 Reset the iterator to point to the first item. More...
 
const ValueTypeoperator* () const
 Return a const reference to the item to which this iterator is pointing. More...
 
void increment ()
 Advance iterator to next item. More...
 
void operator++ ()
 Advance iterator to next item. More...
 
bool next ()
 Advance iterator to next item. More...
 
size_t size () const
 Return the number of point indices in the iterator range. More...
 
bool operator== (const PointIndexIterator &p) const
 Return true if both iterators point to the same element. More...
 
bool operator!= (const PointIndexIterator &p) const
 
bool test () const
 Return true if this iterator is not yet exhausted. More...
 
 operator bool () const
 Return true if this iterator is not yet exhausted. More...
 

Detailed Description

template<typename TreeType = PointIndexTree>
struct openvdb::v12_0::tools::PointIndexIterator< TreeType >

Accelerated range and nearest-neighbor searches for point index grids.

Member Typedef Documentation

using ConstAccessor = tree::ValueAccessor<const TreeType>
using LeafNodeType = typename TreeType::LeafNodeType
using ValueType = typename TreeType::ValueType

Constructor & Destructor Documentation

PointIndexIterator ( )
inline
PointIndexIterator ( const PointIndexIterator< TreeType > &  rhs)
inline
PointIndexIterator ( const Coord &  ijk,
ConstAccessor acc 
)
inline

Construct an iterator over the indices of the points contained in voxel (i, j, k).

Parameters
ijkthe voxel containing the points over which to iterate
accan accessor for the grid or tree that holds the point indices
PointIndexIterator ( const CoordBBox &  bbox,
ConstAccessor acc 
)
inline

Construct an iterator over the indices of the points contained in the given bounding box.

Parameters
bboxthe bounding box of the voxels containing the points over which to iterate
accan accessor for the grid or tree that holds the point indices
Note
The range of the bbox is inclusive. Thus, a bounding box with min = max is not empty but rather encloses a single voxel.

Member Function Documentation

void increment ( )
inline

Advance iterator to next item.

bool next ( )
inline

Advance iterator to next item.

Returns
true if this iterator is not yet exhausted.
operator bool ( ) const
inline

Return true if this iterator is not yet exhausted.

bool operator!= ( const PointIndexIterator< TreeType > &  p) const
inline
const ValueType& operator* ( ) const
inline

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

void operator++ ( )
inline

Advance iterator to next item.

PointIndexIterator< TreeType > & operator= ( const PointIndexIterator< TreeType > &  rhs)
inline
bool operator== ( const PointIndexIterator< TreeType > &  p) const
inline

Return true if both iterators point to the same element.

void reset ( )
inline

Reset the iterator to point to the first item.

void searchAndUpdate ( const Coord &  ijk,
ConstAccessor acc 
)
inline

Clear the iterator and update it with the result of the given voxel query.

Parameters
ijkthe voxel containing the points over which to iterate
accan accessor for the grid or tree that holds the point indices
void searchAndUpdate ( const CoordBBox &  bbox,
ConstAccessor acc 
)
inline

Clear the iterator and update it with the result of the given voxel region query.

Parameters
bboxthe bounding box of the voxels containing the points over which to iterate
accan accessor for the grid or tree that holds the point indices
Note
The range of the bbox is inclusive. Thus, a bounding box with min = max is not empty but rather encloses a single voxel.
void searchAndUpdate ( const BBoxd bbox,
ConstAccessor acc,
const PointArray points,
const math::Transform xform 
)
inline

Clear the iterator and update it with the result of the given index-space bounding box query.

Parameters
bboxindex-space bounding box
accan accessor for the grid or tree that holds the point indices
pointsworld-space point array conforming to the PointArray interface
xformlinear, uniform-scale transform (i.e., cubical voxels)
void searchAndUpdate ( const Vec3d &  center,
double  radius,
ConstAccessor acc,
const PointArray points,
const math::Transform xform,
bool  subvoxelAccuracy = true 
)
inline

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

Parameters
centerindex-space center
radiusindex-space radius
accan accessor for the grid or tree that holds the point indices
pointsworld-space point array conforming to the PointArray interface
xformlinear, uniform-scale transform (i.e., cubical voxels)
subvoxelAccuracyif true, check individual points against the search region, otherwise return all points that reside in voxels that are inside or intersect the search region
size_t size ( ) const
inline

Return the number of point indices in the iterator range.

bool test ( ) const
inline

Return true if this iterator is not yet exhausted.

void worldSpaceSearchAndUpdate ( const BBoxd bbox,
ConstAccessor acc,
const PointArray points,
const math::Transform xform 
)
inline

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

Parameters
bboxworld-space bounding box
accan accessor for the grid or tree that holds the point indices
pointsworld-space point array conforming to the PointArray interface
xformlinear, uniform-scale transform (i.e., cubical voxels)
void worldSpaceSearchAndUpdate ( const Vec3d &  center,
double  radius,
ConstAccessor acc,
const PointArray points,
const math::Transform xform,
bool  subvoxelAccuracy = true 
)
inline

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

Parameters
centerworld-space center
radiusworld-space radius
accan accessor for the grid or tree that holds the point indices
pointsworld-space point array conforming to the PointArray interface
xformlinear, uniform-scale transform (i.e., cubical voxels)
subvoxelAccuracyif true, check individual points against the search region, otherwise return all points that reside in voxels that are inside or intersect the search region