Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::KnnGraphBase< Traits > Class Template Reference

Customizable base class for KnnGraph datastructure. More...

#include <knnGraph.h>

+ Collaboration diagram for Ponca::KnnGraphBase< Traits >:

Public Types

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
 
using PointContainer = typename Traits::PointContainer
 Container for DataPoint used inside the KdTree.
 
using IndexContainer = typename Traits::IndexContainer
 Container for indices used inside the KdTree.
 
using KNearestIndexQuery = KnnGraphKNearestQuery< Traits >
 
using RangeIndexQuery = KnnGraphRangeQuery< Traits >
 

Public Member Functions

template<typename KdTreeTraits >
 KnnGraphBase (const KdTreeBase< KdTreeTraits > &kdtree, int k=6)
 Build a KnnGraph from a KdTreeDense.
 
KNearestIndexQuery k_nearest_neighbors (int index) const
 
RangeIndexQuery range_neighbors (int index, Scalar r) const
 
int k () const
 Number of neighbor per vertex.
 
int size () const
 Number of vertices in the neighborhood graph.
 

Protected Member Functions

const IndexContainerindex_data () const
 

Protected Attributes

const PointContainerm_kdTreePoints
 

Friends

class KnnGraphKNearestQuery< Traits >
 
class KnnGraphRangeQuery< Traits >
 

Detailed Description

template<typename Traits>
class Ponca::KnnGraphBase< Traits >

Customizable base class for KnnGraph datastructure.

See also
Ponca::KnGraph
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
KnnGraphDefaultTraits for the trait interface documentation.

Definition at line 44 of file knnGraph.h.

Member Typedef Documentation

◆ DataPoint

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::DataPoint = typename Traits::DataPoint

DataPoint given by user via Traits.

Definition at line 47 of file knnGraph.h.

◆ IndexContainer

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::IndexContainer = typename Traits::IndexContainer

Container for indices used inside the KdTree.

Definition at line 53 of file knnGraph.h.

◆ IndexType

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::IndexType = typename Traits::IndexType

Definition at line 51 of file knnGraph.h.

◆ KNearestIndexQuery

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::KNearestIndexQuery = KnnGraphKNearestQuery<Traits>

Definition at line 55 of file knnGraph.h.

◆ PointContainer

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::PointContainer = typename Traits::PointContainer

Container for DataPoint used inside the KdTree.

Definition at line 52 of file knnGraph.h.

◆ RangeIndexQuery

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::RangeIndexQuery = KnnGraphRangeQuery<Traits>

Definition at line 56 of file knnGraph.h.

◆ Scalar

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::Scalar = typename DataPoint::Scalar

Scalar given by user via DataPoint.

Definition at line 48 of file knnGraph.h.

◆ VectorType

template<typename Traits >
using Ponca::KnnGraphBase< Traits >::VectorType = typename DataPoint::VectorType

VectorType given by user via DataPoint.

Definition at line 49 of file knnGraph.h.

Constructor & Destructor Documentation

◆ KnnGraphBase()

template<typename Traits >
template<typename KdTreeTraits >
Ponca::KnnGraphBase< Traits >::KnnGraphBase ( const KdTreeBase< KdTreeTraits > &  kdtree,
int  k = 6 
)
inline

Build a KnnGraph from a KdTreeDense.

Parameters
kNumber of requested neighbors. Might be reduced if k is larger than the kdtree size - 1 (query point is not included in query output, thus -1)
Warning
Stores a const reference to kdtree.point_data()
KdTreeTraits compatibility is checked with static assertion

Definition at line 71 of file knnGraph.h.

Member Function Documentation

◆ index_data()

template<typename Traits >
const IndexContainer & Ponca::KnnGraphBase< Traits >::index_data ( ) const
inlineprotected

Definition at line 130 of file knnGraph.h.

◆ k()

template<typename Traits >
int Ponca::KnnGraphBase< Traits >::k ( ) const
inline

Number of neighbor per vertex.

Definition at line 119 of file knnGraph.h.

◆ k_nearest_neighbors()

template<typename Traits >
KNearestIndexQuery Ponca::KnnGraphBase< Traits >::k_nearest_neighbors ( int  index) const
inline

Definition at line 108 of file knnGraph.h.

◆ range_neighbors()

template<typename Traits >
RangeIndexQuery Ponca::KnnGraphBase< Traits >::range_neighbors ( int  index,
Scalar  r 
) const
inline

Definition at line 112 of file knnGraph.h.

◆ size()

template<typename Traits >
int Ponca::KnnGraphBase< Traits >::size ( ) const
inline

Number of vertices in the neighborhood graph.

Definition at line 121 of file knnGraph.h.

Friends And Related Function Documentation

◆ KnnGraphKNearestQuery< Traits >

template<typename Traits >
friend class KnnGraphKNearestQuery< Traits >
friend

Definition at line 1 of file knnGraph.h.

◆ KnnGraphRangeQuery< Traits >

template<typename Traits >
friend class KnnGraphRangeQuery< Traits >
friend

Definition at line 1 of file knnGraph.h.

Member Data Documentation

◆ m_kdTreePoints

template<typename Traits >
const PointContainer& Ponca::KnnGraphBase< Traits >::m_kdTreePoints
protected

Definition at line 129 of file knnGraph.h.