Ponca  4a9354998d048bf882a3ee9bac8105216fa08d13
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::StaticKnnGraphBase< _Traits > Class Template Reference

Customizable base class for KnnGraph datastructure. More...

#include <knnGraph.h>

+ Inheritance diagram for Ponca::StaticKnnGraphBase< _Traits >:
+ Collaboration diagram for Ponca::StaticKnnGraphBase< _Traits >:

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 Base = AbstractNeighborGraph< Traits, KnnGraphBuffers, NeighborGraphOneConnectedQuery< StaticKnnGraphBase< Traits > >, NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > > >
 
using Buffers = typename Base::Buffers
 
- Public Types inherited from Ponca::AbstractNeighborGraph< _Traits, KnnGraphBuffers, NeighborGraphOneConnectedQuery< StaticKnnGraphBase< _Traits > >, NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > > >
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 = NeighborGraphOneConnectedQuery< StaticKnnGraphBase< _Traits > >
 
using RangeIndexQuery = NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > >
 
using Buffers = KnnGraphBuffers< Traits >
 

Public Member Functions

 StaticKnnGraphBase (Buffers &_bufs)
 
int k (int=0) const
 Number of neighbor per vertex for a given element (in the KnnGraph, all points have the same number of neighbors.
 
int beginId (int vId) const
 Index of the beginning of the neighborhood range.
 
int endId (int vId) const
 Index of the end of the neighborhood range.
 
Base::OneConnectedIndexQuery kNearestNeighbors (int index) const
 Convenience function that provides an empty k-nearest neighbors Query object.
 
Base::OneConnectedIndexQuery kNearestNeighborsIndexQuery () const
 Convenience function that provides an empty k-nearest neighbors Query object.
 
- Public Member Functions inherited from Ponca::AbstractNeighborGraph< _Traits, KnnGraphBuffers, NeighborGraphOneConnectedQuery< StaticKnnGraphBase< _Traits > >, NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > > >
 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

 StaticKnnGraphBase (PointContainerConstRef _points, const int _k)
 
- Protected Member Functions inherited from Ponca::AbstractNeighborGraph< _Traits, KnnGraphBuffers, NeighborGraphOneConnectedQuery< StaticKnnGraphBase< _Traits > >, NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > > >
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.
 

Friends

class NeighborGraphOneConnectedQuery< StaticKnnGraphBase< Traits > >
 This type must be equal to KnnGraphBase::KNearestIndexQuery.
 
class NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > >
 This type must be equal to KnnGraphBase::RangeIndexQuery.
 

Additional Inherited Members

- Protected Attributes inherited from Ponca::AbstractNeighborGraph< _Traits, KnnGraphBuffers, NeighborGraphOneConnectedQuery< StaticKnnGraphBase< _Traits > >, NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > > >
Buffers m_bufs
 Buffers used to store the KnnGraph.
 

Detailed Description

template<typename _Traits>
class Ponca::StaticKnnGraphBase< _Traits >

Customizable base class for KnnGraph datastructure.

See also
Ponca::KnnGraph, Ponca::NeighborGraphBase
Template Parameters
_TraitsTraits type providing the types and constants used by the KnnGraph. Must have the same interface as the default traits type.
See also
NeighborGraphDefaultTraits for the trait interface documentation.

Definition at line 58 of file knnGraph.h.

Member Typedef Documentation

◆ Base

◆ Buffers

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::Buffers = typename Base::Buffers

Definition at line 73 of file knnGraph.h.

◆ DataPoint

DataPoint given by user via Traits

Definition at line 63 of file knnGraph.h.

◆ IndexContainer

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::IndexContainer = typename Traits::IndexContainer

Container for indices used inside the KdTree

Definition at line 63 of file knnGraph.h.

◆ IndexContainerRef

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::IndexContainerRef = typename Traits::IndexContainerRef

Ref type to index container.

Definition at line 63 of file knnGraph.h.

◆ IndexType

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::IndexType = typename Traits::IndexType

Type used to index points into the PointContainer.

Definition at line 63 of file knnGraph.h.

◆ PointContainer

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::PointContainer = typename Traits::PointContainer

Container for DataPoint used inside the KdTree

Definition at line 63 of file knnGraph.h.

◆ PointContainerConstRef

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::PointContainerConstRef = typename Traits::PointContainerConstRef

Container for DataPoint used inside the KdTree

Definition at line 63 of file knnGraph.h.

◆ Scalar

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::Scalar = typename DataPoint::Scalar

Scalar given by user via DataPoint

Definition at line 63 of file knnGraph.h.

◆ Traits

Alias to the Traits type

Definition at line 63 of file knnGraph.h.

◆ VectorType

template<typename _Traits >
using Ponca::StaticKnnGraphBase< _Traits >::VectorType = typename DataPoint::VectorType

VectorType given by user via DataPoint

Definition at line 63 of file knnGraph.h.

Constructor & Destructor Documentation

◆ StaticKnnGraphBase() [1/2]

template<typename _Traits >
Ponca::StaticKnnGraphBase< _Traits >::StaticKnnGraphBase ( Buffers &  _bufs)
inline

Definition at line 39 of file knnGraph.h.

◆ StaticKnnGraphBase() [2/2]

template<typename _Traits >
Ponca::StaticKnnGraphBase< _Traits >::StaticKnnGraphBase ( PointContainerConstRef  _points,
const int  _k 
)
inlineprotected

Definition at line 78 of file knnGraph.h.

Member Function Documentation

◆ beginId()

template<typename _Traits >
int Ponca::StaticKnnGraphBase< _Traits >::beginId ( int  vId) const
inline

Index of the beginning of the neighborhood range.

Definition at line 89 of file knnGraph.h.

◆ endId()

template<typename _Traits >
int Ponca::StaticKnnGraphBase< _Traits >::endId ( int  vId) const
inline

Index of the end of the neighborhood range.

Definition at line 91 of file knnGraph.h.

◆ k()

template<typename _Traits >
int Ponca::StaticKnnGraphBase< _Traits >::k ( int  = 0) const
inline

Number of neighbor per vertex for a given element (in the KnnGraph, all points have the same number of neighbors.

Definition at line 87 of file knnGraph.h.

◆ kNearestNeighbors()

template<typename _Traits >
Base::OneConnectedIndexQuery Ponca::StaticKnnGraphBase< _Traits >::kNearestNeighbors ( int  index) const
inline

Convenience function that provides an empty k-nearest neighbors Query object.

The returned object can call for a k-nearest neighbors search using the operator (), which takes a k and an index as parameters.

Same as KdTreeBase::kNearestNeighbors (0, 0)

Returns
The empty KdTreeKNearestIndexQuery mutable object to iterate over the search results.
See also
KdTreeKNearestQueryBase

Definition at line 95 of file knnGraph.h.

◆ kNearestNeighborsIndexQuery()

template<typename _Traits >
Base::OneConnectedIndexQuery Ponca::StaticKnnGraphBase< _Traits >::kNearestNeighborsIndexQuery ( ) const
inline

Convenience function that provides an empty k-nearest neighbors Query object.

The returned object can call for a k-nearest neighbors search using the operator (), which takes a k and an index as parameters.

Same as KdTreeBase::kNearestNeighbors (0, 0)

Returns
The empty KdTreeKNearestIndexQuery mutable object to iterate over the search results.
See also
KdTreeKNearestQueryBase

Definition at line 102 of file knnGraph.h.

Friends And Related Symbol Documentation

◆ NeighborGraphOneConnectedQuery< StaticKnnGraphBase< Traits > >

This type must be equal to KnnGraphBase::KNearestIndexQuery.

See also
NeighborGraphKNearestQuery

Definition at line 39 of file knnGraph.h.

◆ NeighborGraphRangeQuery< StaticKnnGraphBase< _Traits > >

This type must be equal to KnnGraphBase::RangeIndexQuery.

See also
NeighborGraphRangeQuery

Definition at line 39 of file knnGraph.h.