Template Class SearchTree

Inheritance Relationships

Derived Types

Class Documentation

template<typename BaseVecT>
class SearchTree

Abstract interface for storing and searching through a set of points. Query functions for nearest neighbour searches are defined.

Subclassed by lvr2::SearchKDTree< BaseVecT >, lvr2::SearchTreeFlann< BaseVecT >, lvr2::SearchTreeLBVH< BaseVecT >

Public Functions

virtual ~SearchTree() = default
virtual int kSearch(const BaseVecT &qp, int k, std::vector<size_t> &indices, std::vector<CoordT> &distances) const = 0

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 radiusSearch(const BaseVecT &qp, int k, float r, std::vector<size_t> &indices, std::vector<CoordT> &distances) const = 0

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.

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

Like the other overload, but ignoring the distances vector.

inline virtual void kSearchParallel(const BaseVecT *query, int n, int k, std::vector<size_t> &indices, std::vector<CoordT> &distances) const

Protected Attributes

int m_ki

The number of neighbors used for normal interpolation.

int m_kd

The number of tangent planes used for distance determination.