Ponca  82fc77e8c6294111c6f00670e92ec58a24e2ecf2
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery > Class Template Reference

Base class for neighbor graphs. More...

#include <abstractNeighborGraph.h>

+ Inheritance diagram for Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >:
+ Collaboration diagram for Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >:

Public Types

using Traits = _Traits
 Alias to the Traits type

 
using DataPoint = typename Traits::DataPoint
 DataPoint given by user via Traits

 
using Scalar = typename DataPoint::Scalar
 Scalar given by user via DataPoint

 
using VectorType = typename DataPoint::VectorType
 VectorType given by user via DataPoint

 
using IndexType = typename Traits::IndexType
 Type used to index points into the PointContainer.
 
using PointContainer = typename Traits::PointContainer
 Container for DataPoint used inside the KdTree

 
using PointContainerConstRef = typename Traits::PointContainerConstRef
 Container for DataPoint used inside the KdTree

 
using IndexContainer = typename Traits::IndexContainer
 Container for indices used inside the KdTree

 
using IndexContainerRef = typename Traits::IndexContainerRef
 Ref type to index container.
 
using OneConnectedIndexQuery = _OneConnectedIndexQuery
 
using RangeIndexQuery = _RangeIndexQuery
 
using Buffers = BufferType< Traits >
 

Public Member Functions

 AbstractNeighborGraph (const Buffers &_bufs)
 Constructor that allows the use of prebuilt graph containers.
 
IndexType edgeCount () const
 Get the number of connection edges in the graph.
 
IndexType pointCount () const
 Get the number of points.
 
PointContainer points () const
 Get the internal point container.
 
IndexContainer edges () const
 Get the internal index container.
 
const Buffers & buffers () const
 Get access to the internal buffer, for instance to prepare GPU binding.
 
OneConnectedIndexQuery oneConnectedNeighbors (int index=0) const
 Provides a Query object to iterate over the vertices that are directly connected to the query point.
 
RangeIndexQuery rangeNeighbors (int index, Scalar r) const
 Provides a Query object to iterate over the neighbors that are inside a given radius.
 
RangeIndexQuery rangeNeighborsIndexQuery () const
 Convenience function to return an empty mutable range query.
 

Protected Member Functions

const IndexTypegetIndexPtr () const
 Accessor used by friend classes (queries) to get const access to the indices whatever the buffer type.
 
IndexTypegetIndexPtr ()
 Accessor used by friend classes (queries) to get access to the indices whatever the buffer type.
 

Protected Attributes

Buffers m_bufs
 Buffers used to store the KnnGraph.
 

Detailed Description

template<typename _Traits, template< typename > typename BufferType, typename _OneConnectedIndexQuery, typename _RangeIndexQuery>
class Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >

Base class for neighbor graphs.

This class cannot be used directly: it provides base functionalities (accessors, query generations, buffer storage) and should be inherited to provide:

  • procedures to compute the graph,
  • methods to access the neighbors of each point, see for instance the class StaticNeighborGraphBase with:
    PONCA_MULTIARCH [[nodiscard]] inline int k(int vId = 0) const { return endId(vId) * beginId(vId); }
    PONCA_MULTIARCH [[nodiscard]] inline int beginId(int vId) const { return Base::buffers().ranges[vId]; }
    PONCA_MULTIARCH [[nodiscard]] inline int endId(int vId) const { return Base::buffers().ranges[vId + 1]; }
Template Parameters
_TraitsTraits type providing the types and constants used by the neighbor graph. Must have the same interface as the default traits types (NeighborGraphDefaultTraits or NeighborGraphPointerTraits).
BufferTypeType of buffer used in the Graph. Must inherit NeighborGraphBufferBase and be templated by _Traits
_OneConnectedIndexQueryType of query used to access direct neighbors
_RangeIndexQueryType of query used to compute Euclidean range queries restricted on the graph

Definition at line 78 of file abstractNeighborGraph.h.

Member Typedef Documentation

◆ Buffers

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::Buffers = BufferType<Traits>

Definition at line 85 of file abstractNeighborGraph.h.

◆ DataPoint

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::DataPoint = typename Traits::DataPoint

DataPoint given by user via Traits

Definition at line 81 of file abstractNeighborGraph.h.

◆ IndexContainer

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::IndexContainer = typename Traits::IndexContainer

Container for indices used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ IndexContainerRef

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::IndexContainerRef = typename Traits::IndexContainerRef

Ref type to index container.

Definition at line 81 of file abstractNeighborGraph.h.

◆ IndexType

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::IndexType = typename Traits::IndexType

Type used to index points into the PointContainer.

Definition at line 81 of file abstractNeighborGraph.h.

◆ OneConnectedIndexQuery

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::OneConnectedIndexQuery = _OneConnectedIndexQuery

Definition at line 82 of file abstractNeighborGraph.h.

◆ PointContainer

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::PointContainer = typename Traits::PointContainer

Container for DataPoint used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ PointContainerConstRef

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::PointContainerConstRef = typename Traits::PointContainerConstRef

Container for DataPoint used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ RangeIndexQuery

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::RangeIndexQuery = _RangeIndexQuery

Definition at line 83 of file abstractNeighborGraph.h.

◆ Scalar

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::Scalar = typename DataPoint::Scalar

Scalar given by user via DataPoint

Definition at line 81 of file abstractNeighborGraph.h.

◆ Traits

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::Traits = _Traits

Alias to the Traits type

Definition at line 81 of file abstractNeighborGraph.h.

◆ VectorType

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
using Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::VectorType = typename DataPoint::VectorType

VectorType given by user via DataPoint

Definition at line 81 of file abstractNeighborGraph.h.

Constructor & Destructor Documentation

◆ AbstractNeighborGraph()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::AbstractNeighborGraph ( const Buffers &  _bufs)
inline

Constructor that allows the use of prebuilt graph containers.

Each internal values of a neighbor graph can be extracted using buffers()

Note
This constructor can be used to avoid the convertion and building process, which is useful to transfer directly the neighbor graph to the device in CUDA/Sycl.
Parameters
_bufsInternal buffers of the AbstractNeighborGraph

Definition at line 107 of file abstractNeighborGraph.h.

Member Function Documentation

◆ buffers()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
const Buffers & Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::buffers ( ) const
inline

Get access to the internal buffer, for instance to prepare GPU binding.

Definition at line 118 of file abstractNeighborGraph.h.

◆ edgeCount()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
IndexType Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::edgeCount ( ) const
inline

Get the number of connection edges in the graph.

Definition at line 110 of file abstractNeighborGraph.h.

◆ edges()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
IndexContainer Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::edges ( ) const
inline

Get the internal index container.

Definition at line 116 of file abstractNeighborGraph.h.

◆ getIndexPtr() [1/2]

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
IndexType * Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::getIndexPtr ( )
inlineprotected

Accessor used by friend classes (queries) to get access to the indices whatever the buffer type.

Definition at line 93 of file abstractNeighborGraph.h.

◆ getIndexPtr() [2/2]

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
const IndexType * Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::getIndexPtr ( ) const
inlineprotected

Accessor used by friend classes (queries) to get const access to the indices whatever the buffer type.

Definition at line 91 of file abstractNeighborGraph.h.

◆ oneConnectedNeighbors()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
OneConnectedIndexQuery Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::oneConnectedNeighbors ( int  index = 0) const
inline

Provides a Query object to iterate over the vertices that are directly connected to the query point.

The returned object can be reset and reused with the () operator, to compute a new result (also takes an index as parameter).

Parameters
indexIndex of the point that the query evaluates
Returns
The OneConnectedIndexQuery mutable object to iterate over the search results.

Definition at line 129 of file abstractNeighborGraph.h.

◆ pointCount()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
IndexType Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::pointCount ( ) const
inline

Get the number of points.

Definition at line 112 of file abstractNeighborGraph.h.

◆ points()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
PointContainer Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::points ( ) const
inline

Get the internal point container.

Definition at line 114 of file abstractNeighborGraph.h.

◆ rangeNeighbors()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
RangeIndexQuery Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::rangeNeighbors ( int  index,
Scalar  r 
) const
inline

Provides a Query object to iterate over the neighbors that are inside a given radius.

The returned object can be reset and reused with the () operator, to compute a new result (also takes an index and a radius as parameters).

Parameters
indexIndex of the point that the query evaluates
rRadius around where to search the neighbors
Returns
The RangeIndexQuery mutable object to iterate over the search results.

Definition at line 143 of file abstractNeighborGraph.h.

◆ rangeNeighborsIndexQuery()

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
RangeIndexQuery Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::rangeNeighborsIndexQuery ( ) const
inline

Convenience function to return an empty mutable range query.

The returned object can be reset and reused with the () operator, to compute a new result (also takes an index and a radius as parameters).

Definition at line 152 of file abstractNeighborGraph.h.

Member Data Documentation

◆ m_bufs

template<typename _Traits , template< typename > typename BufferType, typename _OneConnectedIndexQuery , typename _RangeIndexQuery >
Buffers Ponca::AbstractNeighborGraph< _Traits, BufferType, _OneConnectedIndexQuery, _RangeIndexQuery >::m_bufs
protected

Buffers used to store the KnnGraph.

Definition at line 158 of file abstractNeighborGraph.h.