28 using DataPoint =
typename Traits::DataPoint;
29 using IndexType =
typename Traits::IndexType;
30 using Scalar =
typename DataPoint::Scalar;
31 using VectorType =
typename DataPoint::VectorType;
41 typename QueryType::InputType input)
47 PONCA_MULTIARCH
inline Self&
operator()(
typename QueryType::InputType input, Scalar radius)
49 return QueryType::template
operator()<
Self>(input, radius);
61 QueryAccelType::reset();
69 PONCA_MULTIARCH
inline Iterator end() {
return Iterator(
this, QueryAccelType::m_kdtree->pointCount()); }
72 PONCA_MULTIARCH
inline void advance(Iterator&
it)
74 const auto& points = QueryAccelType::m_kdtree->points();
75 const auto& indices = QueryAccelType::m_kdtree->samples();
78 if (QueryAccelType::m_kdtree->pointCount() == 0 || QueryAccelType::m_kdtree->sampleCount() == 0)
84 auto descentDistanceThreshold = [
this]() {
return QueryType::descentDistanceThreshold(); };
85 auto skipFunctor = [
this](IndexType idx) {
return QueryType::skipIndexFunctor(idx); };
86 auto processNeighborFunctor = [&it](IndexType idx, IndexType i, Scalar) {
92 for (IndexType i = it.m_start; i < it.m_end; ++i)
94 IndexType idx = indices[i];
98 Scalar d = (point - points[idx].pos()).squaredNorm();
99 if (d < descentDistanceThreshold())
101 if (processNeighborFunctor(idx, i, d))
108 [&it](IndexType start, IndexType
end) {
112 descentDistanceThreshold, skipFunctor, processNeighborFunctor))
113 it.m_index =
static_cast<IndexType
>(QueryAccelType::m_kdtree->pointCount());
bool searchInternal(const VectorType &point, LeafPreparationFunctor prepareLeafTraversal, DescentDistanceThresholdFunctor descentDistanceThreshold, SkipIndexFunctor skipFunctor, ProcessNeighborFunctor processNeighborFunctor)
Search internally the neighbors of a point using the kdtree.