9#include "kdTreeQuery.h"
10#include "../../query.h"
11#include "../Iterator/kdTreeNearestIterator.h"
22template <
typename Traits,
23 template <
typename>
typename IteratorType,
28 using DataPoint =
typename Traits::DataPoint;
29 using IndexType =
typename Traits::IndexType;
30 using Scalar =
typename DataPoint::Scalar;
31 using VectorType =
typename DataPoint::VectorType;
33 using Iterator = IteratorType<typename Traits::IndexType>;
43 return Iterator(QueryType::m_nearest);
47 inline Iterator
end(){
48 return Iterator(QueryType::m_nearest + 1);
54 [](IndexType, IndexType){},
55 [
this](){
return QueryType::descentDistanceThreshold();},
56 [
this](IndexType idx){
return QueryType::skipIndexFunctor(idx);},
57 [
this](IndexType idx, IndexType, Scalar d)
59 QueryType::m_nearest = idx;
60 QueryType::m_squared_distance = d;
72template <
typename Traits>
82template <
typename Traits>
[KdTreeSparse type definition]
Input iterator to read the KdTreeKNearestQueryBase object.
Extension of the Query class that allows to read the result of a nearest neighbor search on the KdTre...
Iterator end()
Returns an iterator to the end of the nearest neighbor query.
Iterator begin()
Returns an iterator to the beginning of the nearest neighbor query.
Query object that provides a method to search neighbors on the KdTree depending on a distance thresho...
void reset()
Init stack for a new search.
bool searchInternal(const VectorType &point, LeafPreparationFunctor prepareLeafTraversal, DescentDistanceThresholdFunctor descentDistanceThreshold, SkipIndexFunctor skipFunctor, ProcessNeighborFunctor processNeighborFunctor)
Search internally the neighbors of a point using the kdtree.
const KdTreeBase< Traits > * m_kdtree
[KdTreeQuery kdtree type]
Base Query class combining QueryInputIsIndex and QueryOutputIsNearest.
Base Query class combining QueryInputIsPosition and QueryOutputIsNearest.
This Source Code Form is subject to the terms of the Mozilla Public License, v.