22 using DataPoint =
typename Traits::DataPoint;
23 using IndexType =
typename Traits::IndexType;
24 using Scalar =
typename DataPoint::Scalar;
25 using VectorType =
typename DataPoint::VectorType;
27 using Iterator = IteratorType<IndexType, DataPoint, KdTreeRangeQueryBase>;
37 inline Iterator begin(){
44 inline Iterator end(){
49 inline void advance(Iterator& it){
52 const auto& point = QueryType::getInputPosition(points);
54 if (points.empty() || indices.empty())
60 auto descentDistanceThreshold = [
this](){
return QueryType::descentDistanceThreshold();};
61 auto skipFunctor = [
this](IndexType idx){
return QueryType::skipIndexFunctor(idx);};
62 auto processNeighborFunctor = [&it](IndexType idx, IndexType i, Scalar)
69 for(IndexType i=it.m_start; i<it.m_end; ++i)
71 IndexType idx = indices[i];
72 if(skipFunctor(idx))
continue;
74 Scalar d = (point - points[idx].pos()).squaredNorm();
75 if(d < descentDistanceThreshold())
77 if( processNeighborFunctor(idx, i, d) )
return;
82 [&it](IndexType start, IndexType end)
87 descentDistanceThreshold,
89 processNeighborFunctor))
90 it.m_index =
static_cast<IndexType
>(points.size());