9#include "neighborGraphTraits.h"
13#define WRITE_NEIGHBOR_GRAPH_ALIASES \
14 using Traits = _Traits; \
15 using DataPoint = typename Traits::DataPoint; \
16 using Scalar = typename DataPoint::Scalar; \
17 using VectorType = typename DataPoint::VectorType; \
18 using IndexType = typename Traits::IndexType; \
19 using PointContainer = typename Traits::PointContainer; \
20 using PointContainerConstRef = \
21 typename Traits::PointContainerConstRef; \
22 using IndexContainer = typename Traits::IndexContainer; \
23 using IndexContainerRef = typename Traits::IndexContainerRef;
31 template <
typename _Traits>
34 WRITE_NEIGHBOR_GRAPH_ALIASES
76 template <
typename _Traits,
template <
typename>
typename BufferType,
typename _OneConnectedIndexQuery,
77 typename _RangeIndexQuery>
81 WRITE_NEIGHBOR_GRAPH_ALIASES
86 static_assert(std::is_base_of_v<NeighborGraphBufferBase<Traits>,
Buffers>,
87 "BufferType must inherit NeighborGraphBufferBase");
Base class for neighbor graphs.
PointContainer points() const
Get the internal point container.
IndexType pointCount() const
Get the number of points.
Buffers m_bufs
Buffers used to store the KnnGraph.
typename DataPoint::Scalar Scalar
Scalar given by user via DataPoint
typename Traits::PointContainer PointContainer
Container for DataPoint used inside the KdTree
typename Traits::IndexContainer IndexContainer
Container for indices used inside the KdTree
AbstractNeighborGraph(const Buffers &_bufs)
Constructor that allows the use of prebuilt graph containers.
IndexType * getIndexPtr()
Accessor used by friend classes (queries) to get access to the indices whatever the buffer type.
OneConnectedIndexQuery oneConnectedNeighbors(int index=0) const
Provides a Query object to iterate over the vertices that are directly connected to the query point.
const IndexType * getIndexPtr() const
Accessor used by friend classes (queries) to get const access to the indices whatever the buffer type...
RangeIndexQuery rangeNeighborsIndexQuery() const
Convenience function to return an empty mutable range query.
IndexType edgeCount() const
Get the number of connection edges in the graph.
typename Traits::IndexType IndexType
Type used to index points into the PointContainer.
IndexContainer edges() const
Get the internal index container.
RangeIndexQuery rangeNeighbors(int index, Scalar r) const
Provides a Query object to iterate over the neighbors that are inside a given radius.
const Buffers & buffers() const
Get access to the internal buffer, for instance to prepare GPU binding.
Aggregator class used to declare specialized structures using CRTP.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Internal structure storing the buffers used by a neighbor graph.
typename Traits::PointContainer PointContainer
Container for DataPoint used inside the KdTree
typename Traits::IndexContainer IndexContainer
Container for indices used inside the KdTree
size_t points_size
Number of points in the graph.
typename Traits::PointContainerConstRef PointContainerConstRef
Container for DataPoint used inside the KdTree
NeighborGraphBufferBase(PointContainerConstRef _points, IndexContainerRef _indices, const size_t _points_size, const size_t _indices_size)
Constructor allowing to set all the attributes.
NeighborGraphBufferBase(PointContainerConstRef _points)
Default constructor setting the point container.
size_t indices_size
Number of connections in the graph.
PointContainer points
Buffer storing the input points (read only)
typename Traits::IndexContainerRef IndexContainerRef
Ref type to index container.
IndexContainer indices
Buffer storing the indices associating the input points to the nodes.
NeighborGraphBufferBase()=default
Default constructor, might be deleted depending on the PointContainer type (e.g. const reference)