53 PONCA_MULTIARCH
bool searchInternal(
const VectorType& point, LeafPreparationFunctor prepareLeafTraversal,
54 DescentDistanceThresholdFunctor descentDistanceThreshold,
55 SkipIndexFunctor skipFunctor, ProcessNeighborFunctor processNeighborFunctor)
57 const auto& nodes =
m_kdtree->nodes();
58 const auto& points =
m_kdtree->points();
66 const auto& node = nodes[qnode.index];
68 if (qnode.squared_distance < descentDistanceThreshold())
73 IndexType start = node.leaf_start();
74 IndexType end = node.leaf_start() + node.leaf_size();
75 prepareLeafTraversal(start, end);
76 for (IndexType i = start; i < end; ++i)
78 IndexType idx =
m_kdtree->pointFromSample(i);
82 Scalar d = (point - points[idx].pos()).squaredNorm();
84 if (d < descentDistanceThreshold())
86 if (processNeighborFunctor(idx, i, d))
94 Scalar newOff = point[node.inner_split_dim()] - node.inner_split_value();
98 m_stack.top().index = node.inner_first_child_id();
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;
107 qnode.squared_distance = newOff * newOff;