9#include "kdTreeQuery.h"
10#include "../../query.h"
11#include "../Iterator/kdTreeKNearestIterator.h"
22template <
typename Traits,
23 template <
typename,
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, typename Traits::DataPoint>;
42 return QueryType::template operator()<
Self>(input, k);
47 return QueryType::template operator()<
Self>(input);
55 return Iterator(QueryType::m_queue.
begin());
59 inline Iterator
end(){
60 return Iterator(QueryType::m_queue.
end());
66 [](IndexType, IndexType){},
67 [
this](){
return QueryType::descentDistanceThreshold();},
68 [
this](IndexType idx){
return QueryType::skipIndexFunctor(idx);},
69 [
this](IndexType idx, IndexType, Scalar d){QueryType::m_queue.push({idx, d});
return false;}
79template <
typename Traits>
88template <
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 k-nearest neighbors search on the Kd...
Self & operator()(typename QueryType::InputType input, IndexType k)
Call the k-nearest neighbors query with new input and neighbor number parameters.
Self & operator()(typename QueryType::InputType input)
Call the k-nearest neighbors query with new input parameter.
Iterator end()
Returns an iterator to the end of the k-nearest neighbors query.
Iterator begin()
Returns an iterator to the beginning of the k-nearest neighbors 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 QueryOutputIsKNearest.
Base Query class combining QueryInputIsPosition and QueryOutputIsKNearest.
This Source Code Form is subject to the terms of the Mozilla Public License, v.