9#include "kdTreeQuery.h"
10#include "../../query.h"
11#include "../Iterator/kdTreeNearestIterator.h"
15template <
typename Traits,
16 template <
typename>
typename IteratorType,
21 using DataPoint =
typename Traits::DataPoint;
22 using IndexType =
typename Traits::IndexType;
23 using Scalar =
typename DataPoint::Scalar;
24 using VectorType =
typename DataPoint::VectorType;
26 using Iterator = IteratorType<typename Traits::IndexType>;
32 inline Iterator begin(){
36 return Iterator(QueryType::m_nearest);
38 inline Iterator end(){
39 return Iterator(QueryType::m_nearest + 1);
45 [](IndexType, IndexType){},
46 [
this](){
return QueryType::descentDistanceThreshold();},
47 [
this](IndexType idx){
return QueryType::skipIndexFunctor(idx);},
48 [
this](IndexType idx, IndexType, Scalar d)
50 QueryType::m_nearest = idx;
51 QueryType::m_squared_distance = d;
58template <
typename Traits>
61template <
typename Traits>
[KdTreeSparse type definition]
void reset()
Init stack for a new search.
bool search_internal(const VectorType &point, LeafPreparationFunctor prepareLeafTraversal, DescentDistanceThresholdFunctor descentDistanceThreshold, SkipIndexFunctor skipFunctor, ProcessNeighborFunctor processNeighborFunctor)
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.