Ponca  82fc77e8c6294111c6f00670e92ec58a24e2ecf2
Point Cloud Analysis library
Loading...
Searching...
No Matches
neighborGraphOneConnectedQuery.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
9#include "../../query.h"
10#include "../Iterator/neighborGraphOneConnectedIterator.h"
11
12namespace Ponca
13{
16 {
17 using OutputParameter = typename QueryOutputBase::DummyOutputParameter;
18 };
19
28 template <typename _NeighborGraph>
30 : public Query<QueryInputIsIndex<typename _NeighborGraph::Traits::IndexType>, NeighborGraphQueryOutputType>
31 {
32 public:
33 using NeighborGraph = _NeighborGraph;
34 using Traits = typename NeighborGraph::Traits;
35 using Iterator =
38
40
41 public:
42 PONCA_MULTIARCH inline NeighborGraphOneConnectedQuery(const NeighborGraph* graph, int index)
43 : QueryType(index), m_graph(graph)
44 {
45 }
47 PONCA_MULTIARCH inline Self& operator()(int index) { return QueryType::template operator()<Self>(index); }
48
50 PONCA_MULTIARCH [[nodiscard]] inline Iterator begin() const
51 {
52 return Iterator(m_graph->getIndexPtr()) + m_graph->beginId(QueryType::input());
53 }
54
56 PONCA_MULTIARCH [[nodiscard]] inline Iterator end() const
57 {
58 return Iterator(m_graph->getIndexPtr()) + m_graph->endId(QueryType::input());
59 }
60
61 protected:
62 const NeighborGraph* m_graph{nullptr};
63 };
64
65} // namespace Ponca
_Traits Traits
Alias to the Traits type
Base iterator class for NeighborGraphOneConnectedQuery.
Extension of the Query class that allows to read the neighbors that are directly connected to the que...
Iterator end() const
Returns an iterator to the end of the k-nearest neighbors query.
Self & operator()(int index)
Call the k-nearest neighbors query with new input parameter.
Iterator begin() const
Returns an iterator to the beginning of the k-nearest neighbors query.
Composes the Query object depending on an input type and output type.
Definition query.h:294
Base class for queries output types.
Definition query.h:40
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11
Output type of the NeighborGraphOneConnectedQuery.