9#include "../../indexSquaredDistance.h"
10#include "../../../Common/Containers/stack.h"
14 template <
typename Traits>
15 class StaticKdTreeBase;
22 template <
typename Traits>
26 using DataPoint =
typename Traits::DataPoint;
27 using IndexType =
typename Traits::IndexType;
28 using Scalar =
typename DataPoint::Scalar;
29 using VectorType =
typename DataPoint::VectorType;
38 PONCA_MULTIARCH
inline void reset()
57 const auto& nodes =
m_kdtree->nodes();
58 const auto& points =
m_kdtree->points();
68 if (
qnode.squared_distance < descentDistanceThreshold())
73 IndexType start =
node.leaf_start();
74 IndexType end =
node.leaf_start() +
node.leaf_size();
76 for (IndexType
i = start;
i < end; ++
i)
84 if (
d < descentDistanceThreshold())
99 qnode.index =
node.inner_first_child_id() + 1;
103 m_stack.top().index =
node.inner_first_child_id() + 1;
104 qnode.index =
node.inner_first_child_id();
106 m_stack.top().squared_distance =
qnode.squared_distance;
Aggregator class used to declare specialized structures using CRTP.
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.
Stack< IndexSquaredDistance< IndexType, Scalar >, 2 *Traits::MAX_DEPTH > m_stack
[KdTreeQuery kdtree type]
bool searchInternal(const VectorType &point, LeafPreparationFunctor prepareLeafTraversal, DescentDistanceThresholdFunctor descentDistanceThreshold, SkipIndexFunctor skipFunctor, ProcessNeighborFunctor processNeighborFunctor)
Search internally the neighbors of a point using the kdtree.
This Source Code Form is subject to the terms of the Mozilla Public License, v.