Template Class SearchKDTree

Inheritance Relationships

Base Types

Class Documentation

template<typename BaseVecT>
class SearchKDTree : public lvr2::KDTree<IndexedPoint<BaseVecT>>, public lvr2::SearchTree<BaseVecT>

Public Functions

SearchKDTree(PointBufferPtr buffer)
virtual int kSearch(const BaseVecT &qp, int k, std::vector<size_t> &indices, std::vector<CoordT> &distances) const override

This function performs a k-next-neighbor search on the data that was given in the constructor.

Parameters:
  • qp – The query point.

  • k – The number of neighbours that should be searched.

  • indices – A vector that stores the indices for the neighbours within the dataset.

  • distances – A vector that stores the distances for the neighbours that are found.

Returns:

The number of neighbours found

virtual int kSearch(const BaseVecT &qp, int k, std::vector<size_t> &indices) const override

Like the other overload, but ignoring the distances vector.

virtual int radiusSearch(const BaseVecT &qp, int k, float r, std::vector<size_t> &indices, std::vector<CoordT> &distances) const override

Returns all points within the radius r of qp.

Parameters:
  • qp – The query point.

  • r – Radius.

  • indices – A vector that will be filled with the indices of the points that were found.