Ponca  03745f3c84c0c8d40cec269af63efe7d3cf77f30
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 Buffersbuffers () 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]; }
    Aggregator class used to declare specialized structures using CRTP.
    Definition basket.h:283
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

◆ DataPoint

◆ IndexContainer

Container for indices used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ IndexContainerRef

Ref type to index container.

Definition at line 81 of file abstractNeighborGraph.h.

◆ IndexType

Type used to index points into the PointContainer.

Definition at line 81 of file abstractNeighborGraph.h.

◆ OneConnectedIndexQuery

◆ PointContainer

Container for DataPoint used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ PointContainerConstRef

Container for DataPoint used inside the KdTree

Definition at line 81 of file abstractNeighborGraph.h.

◆ RangeIndexQuery

◆ Scalar

Scalar given by user via DataPoint

Definition at line 81 of file abstractNeighborGraph.h.

◆ Traits

◆ VectorType

VectorType given by user via DataPoint

Definition at line 81 of file abstractNeighborGraph.h.

Constructor & Destructor Documentation

◆ AbstractNeighborGraph()

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()

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

Definition at line 118 of file abstractNeighborGraph.h.

◆ edgeCount()

Get the number of connection edges in the graph.

Definition at line 110 of file abstractNeighborGraph.h.

◆ edges()

◆ getIndexPtr() [1/2]

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]

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()

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()

◆ points()

◆ rangeNeighbors()

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()

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