9#include "kdTreeQuery.h"
10#include "../../query.h"
11#include "../Iterator/kdTreeNearestIterator.h"
23 template <
typename Traits,
template <
typename>
typename IteratorType,
typename QueryType>
24 class KdTreeNearestQueryBase :
public KdTreeQuery<Traits>,
public QueryType
27 using DataPoint =
typename Traits::DataPoint;
28 using IndexType =
typename Traits::IndexType;
29 using Scalar =
typename DataPoint::Scalar;
30 using VectorType =
typename DataPoint::VectorType;
31 using QueryAccelType = KdTreeQuery<Traits>;
32 using Iterator = IteratorType<typename Traits::IndexType>;
35 typename QueryType::InputType input)
36 : KdTreeQuery<Traits>(kdtree), QueryType(input)
41 PONCA_MULTIARCH
inline Iterator
begin()
46 return Iterator(QueryType::m_nearest);
50 PONCA_MULTIARCH
inline Iterator
end() {
return Iterator(QueryType::m_nearest + 1); }
53 PONCA_MULTIARCH
inline void search()
57 [](IndexType, IndexType) {}, [
this]() {
return QueryType::descentDistanceThreshold(); },
58 [
this](IndexType idx) {
return QueryType::skipIndexFunctor(idx); },
59 [
this](IndexType idx, IndexType, Scalar d) {
60 QueryType::m_nearest = idx;
61 QueryType::m_squared_distance = d;
72 template <
typename Traits>
75 NearestIndexQuery<typename Traits::IndexType, typename Traits::DataPoint::Scalar>>;
83 template <
typename Traits>
86 NearestPointQuery<typename Traits::IndexType, typename Traits::DataPoint>>;
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.
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.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
KdTreeNearestQueryBase< Traits, KdTreeNearestIterator, NearestPointQuery< typename Traits::IndexType, typename Traits::DataPoint > > KdTreeNearestPointQuery
Extension of the Query class that allows to read the result of a nearest neighbor search on the KdTre...
KdTreeNearestQueryBase< Traits, KdTreeNearestIterator, NearestIndexQuery< typename Traits::IndexType, typename Traits::DataPoint::Scalar > > KdTreeNearestIndexQuery
Extension of the Query class that allows to read the result of a nearest neighbor search on the KdTre...