OpenVDB: PointIndexIterator< TreeType > Struct Template Reference

OpenVDB 6.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 <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)
PointIndexIterator & | operator= (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 ValueType & | operator * () 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::v6_0::tools::PointIndexIterator< TreeType >

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

## Member Typedef Documentation

## ◆ ConstAccessor

using ConstAccessor = tree::ValueAccessor<const TreeType>

## ◆ LeafNodeType

using LeafNodeType = typename TreeType::LeafNodeType

## ◆ ValueType

using ValueType = typename TreeType::ValueType

## Constructor & Destructor Documentation

## ◆ PointIndexIterator() [1/4]

PointIndexIterator | ( |  | ) |
| inline

## ◆ PointIndexIterator() [2/4]

PointIndexIterator | ( | const PointIndexIterator< TreeType > & | rhs | ) |
| inline

## ◆ PointIndexIterator() [3/4]

PointIndexIterator | ( | const Coord & | ijk,
|  | ConstAccessor & | acc
| ) |  |
| inline

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

Parameters

  ijk | the voxel containing the points over which to iterate
  acc | an accessor for the grid or tree that holds the point indices

## ◆ PointIndexIterator() [4/4]

PointIndexIterator | ( | const CoordBBox & | bbox,
|  | ConstAccessor & | acc
| ) |  |
| inline

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

Parameters

  bbox | the bounding box of the voxels containing the points over which to iterate
  acc | an 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

## ◆ increment()

void increment | ( |  | ) |
| inline

Advance iterator to next item.

## ◆ next()

bool next | ( |  | ) |
| inline

Advance iterator to next item.

Returns
  `true` if this iterator is not yet exhausted.

## ◆ operator *()

const ValueType& operator * | ( |  | ) | const
| inline

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

## ◆ operator bool()

operator bool | ( |  | ) | const
| inline

Return `true` if this iterator is not yet exhausted.

## ◆ operator!=()

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

## ◆ operator++()

void operator++ | ( |  | ) |
| inline

Advance iterator to next item.

## ◆ operator=()

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

## ◆ operator==()

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

Return `true` if both iterators point to the same element.

## ◆ reset()

void reset | ( |  | ) |
| inline

Reset the iterator to point to the first item.

## ◆ searchAndUpdate() [1/4]

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

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

Parameters

  ijk | the voxel containing the points over which to iterate
  acc | an accessor for the grid or tree that holds the point indices

## ◆ searchAndUpdate() [2/4]

void searchAndUpdate | ( | const CoordBBox & | bbox,
|  | ConstAccessor & | acc
| ) |  |
| inline

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

Parameters

  bbox | the bounding box of the voxels containing the points over which to iterate
  acc | an 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.

## ◆ searchAndUpdate() [3/4]

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

  bbox | index-space bounding box
  acc | an accessor for the grid or tree that holds the point indices
  points | world-space point array conforming to the PointArray interface
  xform | linear, uniform-scale transform (i.e., cubical voxels)

## ◆ searchAndUpdate() [4/4]

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

  center | index-space center
  radius | index-space radius
  acc | an accessor for the grid or tree that holds the point indices
  points | world-space point array conforming to the PointArray interface
  xform | linear, uniform-scale transform (i.e., cubical voxels)
  subvoxelAccuracy | if 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()

size_t size | ( |  | ) | const
| inline

Return the number of point indices in the iterator range.

## ◆ test()

bool test | ( |  | ) | const
| inline

Return `true` if this iterator is not yet exhausted.

## ◆ worldSpaceSearchAndUpdate() [1/2]

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

  bbox | world-space bounding box
  acc | an accessor for the grid or tree that holds the point indices
  points | world-space point array conforming to the PointArray interface
  xform | linear, uniform-scale transform (i.e., cubical voxels)

## ◆ worldSpaceSearchAndUpdate() [2/2]

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

  center | world-space center
  radius | world-space radius
  acc | an accessor for the grid or tree that holds the point indices
  points | world-space point array conforming to the PointArray interface
  xform | linear, uniform-scale transform (i.e., cubical voxels)
  subvoxelAccuracy | if true, check individual points against the search region, otherwise return all points that reside in voxels that are inside or intersect the search region

The documentation for this struct was generated from the following file:

- PointIndexGrid.h