Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
kdTreeRangeIterator.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, typename QueryT_>
13{
14protected:
15 friend QueryT_;
16
17public:
18 using Scalar = typename DataPoint::Scalar;
19 using QueryType = QueryT_;
20
21 inline KdTreeRangeIterator() = default;
22 inline KdTreeRangeIterator(QueryType* query, Index index = -1) :
23 m_query(query), m_index(index), m_start(0), m_end(0) {}
24
25 inline bool operator !=(const KdTreeRangeIterator& other) const
26 {return m_index != other.m_index;}
27 inline void operator ++(int) {m_query->advance(*this);}
28 inline KdTreeRangeIterator& operator++() {m_query->advance(*this); return *this;}
29 inline Index operator *() const {return m_index;}
30
31protected:
32 QueryType* m_query {nullptr};
33 Index m_index {-1};
34 Index m_start {0};
35 Index m_end {0};
36};
37} // namespace ponca
This Source Code Form is subject to the terms of the Mozilla Public License, v.