OpenVDB: PointIndexIterator< TreeType > Struct Template Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
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)
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).
| PointIndexIterator (const CoordBBox &bbox, ConstAccessor &acc)
| Construct an iterator over the indices of the points contained in the given bounding box.
void | searchAndUpdate (const Coord &ijk, ConstAccessor &acc)
| Clear the iterator and update it with the result of the given voxel query.
void | searchAndUpdate (const CoordBBox &bbox, ConstAccessor &acc)
| Clear the iterator and update it with the result of the given voxel region query.
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.
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.
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.
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.
void | reset ()
| Reset the iterator to point to the first item.
const ValueType & | operator* () 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 PointIndexIterator &p) const
| Return `true` if both iterators point to the same element.
bool | operator!= (const PointIndexIterator &p) const
bool | test () const
| Return `true` if this iterator is not yet exhausted.
| operator bool () const
| Return `true` if this iterator is not yet exhausted.

## Detailed Description

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

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

## Member Typedef Documentation

## ◆ ConstAccessor

template<typename TreeType = PointIndexTree>

using ConstAccessor = tree::ValueAccessor<const TreeType>

## ◆ LeafNodeType

template<typename TreeType = PointIndexTree>

using LeafNodeType = typename TreeType::LeafNodeType

## ◆ ValueType

template<typename TreeType = PointIndexTree>

using ValueType = typename TreeType::ValueType

## Constructor & Destructor Documentation

## ◆ PointIndexIterator() [1/4]

template<typename TreeType>

PointIndexIterator | ( |  | ) |
| inline

## ◆ PointIndexIterator() [2/4]

template<typename TreeType>

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

## ◆ PointIndexIterator() [3/4]

template<typename TreeType>

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]

template<typename TreeType>

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()

template<typename TreeType>

void increment | ( |  | ) |
| inline

Advance iterator to next item.

## ◆ next()

template<typename TreeType>

bool next | ( |  | ) |
| inline

Advance iterator to next item.

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

## ◆ operator bool()

template<typename TreeType = PointIndexTree>

operator bool | ( |  | ) | const
| inline

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

## ◆ operator!=()

template<typename TreeType = PointIndexTree>

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

## ◆ operator*()

template<typename TreeType = PointIndexTree>

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

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

## ◆ operator++()

template<typename TreeType = PointIndexTree>

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

Advance iterator to next item.

## ◆ operator=()

template<typename TreeType>

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

## ◆ operator==()

template<typename TreeType = PointIndexTree>

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

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

## ◆ reset()

template<typename TreeType>

void reset | ( |  | ) |
| inline

Reset the iterator to point to the first item.

## ◆ searchAndUpdate() [1/4]

template<typename TreeType>
template<typename PointArray>

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() [2/4]

template<typename TreeType>

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() [3/4]

template<typename TreeType>

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() [4/4]

template<typename TreeType>
template<typename PointArray>

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()

template<typename TreeType>

size_t size | ( |  | ) | const
| inline

Return the number of point indices in the iterator range.

## ◆ test()

template<typename TreeType = PointIndexTree>

bool test | ( |  | ) | const
| inline

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

## ◆ worldSpaceSearchAndUpdate() [1/2]

template<typename TreeType>
template<typename PointArray>

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]

template<typename TreeType>
template<typename PointArray>

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