Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
kdTreeKNearestIterator.h
1/*
2 This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9namespace Ponca {
10
11template <typename Index, typename DataPoint>
13{
14public:
15 using Scalar = typename DataPoint::Scalar;
16 using Iterator = typename limited_priority_queue<IndexSquaredDistance<Index, Scalar>>::iterator;
17
18 inline KdTreeKNearestIterator() = default;
19 inline KdTreeKNearestIterator(const Iterator& iterator) : m_iterator(iterator) {}
20 virtual inline ~KdTreeKNearestIterator() = default;
21
22public:
23 inline bool operator !=(const KdTreeKNearestIterator& other) const
24 {return m_iterator != other.m_iterator;}
25 inline void operator ++() {++m_iterator;}
26 inline Index operator * () const {return m_iterator->index;}
27 inline void operator +=(int i) {m_iterator += i;}
28
29protected:
30 Iterator m_iterator;
31};
32} // namespace ponca
The limited_priority_queue class is similar to std::priority_queue but has a limited capacity and han...
This Source Code Form is subject to the terms of the Mozilla Public License, v.