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>;
39 PONCA_MULTIARCH
inline Iterator
begin(){
43 return Iterator(QueryType::m_nearest);
47 PONCA_MULTIARCH
inline Iterator
end(){
48 return Iterator(QueryType::m_nearest + 1);
52 PONCA_MULTIARCH
inline void search(){
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>
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...
const StaticKdTreeBase< Traits > * m_kdtree
[KdTreeQuery kdtree type]
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.
Customizable static base class for KdTree datastructure implementations.
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.