All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fcl::NearestNeighbors< _T > Class Template Referenceabstract

Abstract representation of a container that can perform nearest neighbors queries. More...

#include <hpp/fcl/knn/nearest_neighbors.h>

Inheritance diagram for fcl::NearestNeighbors< _T >:

Public Types

typedef boost::function
< double(const _T &, const _T &)> 
DistanceFunction
 The definition of a distance function. More...
 

Public Member Functions

 NearestNeighbors (void)
 
virtual ~NearestNeighbors (void)
 
virtual void setDistanceFunction (const DistanceFunction &distFun)
 Set the distance function to use. More...
 
const DistanceFunctiongetDistanceFunction (void) const
 Get the distance function used. More...
 
virtual void clear (void)=0
 Clear the datastructure. More...
 
virtual void add (const _T &data)=0
 Add an element to the datastructure. More...
 
virtual void add (const std::vector< _T > &data)
 Add a vector of points. More...
 
virtual bool remove (const _T &data)=0
 Remove an element from the datastructure. More...
 
virtual _T nearest (const _T &data) const =0
 Get the nearest neighbor of a point. More...
 
virtual void nearestK (const _T &data, std::size_t k, std::vector< _T > &nbh) const =0
 Get the k-nearest neighbors of a point. More...
 
virtual void nearestR (const _T &data, double radius, std::vector< _T > &nbh) const =0
 Get the nearest neighbors of a point, within a specified radius. More...
 
virtual std::size_t size (void) const =0
 Get the number of elements in the datastructure. More...
 
virtual void list (std::vector< _T > &data) const =0
 Get all the elements in the datastructure. More...
 

Protected Attributes

DistanceFunction distFun_
 The used distance function. More...
 

Detailed Description

template<typename _T>
class fcl::NearestNeighbors< _T >

Abstract representation of a container that can perform nearest neighbors queries.

Member Typedef Documentation

template<typename _T>
typedef boost::function<double(const _T&, const _T&)> fcl::NearestNeighbors< _T >::DistanceFunction

The definition of a distance function.

Constructor & Destructor Documentation

template<typename _T>
fcl::NearestNeighbors< _T >::NearestNeighbors ( void  )
inline
template<typename _T>
virtual fcl::NearestNeighbors< _T >::~NearestNeighbors ( void  )
inlinevirtual

Member Function Documentation

template<typename _T>
virtual void fcl::NearestNeighbors< _T >::add ( const _T &  data)
pure virtual
template<typename _T>
virtual void fcl::NearestNeighbors< _T >::add ( const std::vector< _T > &  data)
inlinevirtual
template<typename _T>
virtual void fcl::NearestNeighbors< _T >::clear ( void  )
pure virtual
template<typename _T>
const DistanceFunction& fcl::NearestNeighbors< _T >::getDistanceFunction ( void  ) const
inline

Get the distance function used.

template<typename _T>
virtual void fcl::NearestNeighbors< _T >::list ( std::vector< _T > &  data) const
pure virtual

Get all the elements in the datastructure.

Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.

template<typename _T>
virtual _T fcl::NearestNeighbors< _T >::nearest ( const _T &  data) const
pure virtual
template<typename _T>
virtual void fcl::NearestNeighbors< _T >::nearestK ( const _T &  data,
std::size_t  k,
std::vector< _T > &  nbh 
) const
pure virtual

Get the k-nearest neighbors of a point.

Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.

template<typename _T>
virtual void fcl::NearestNeighbors< _T >::nearestR ( const _T &  data,
double  radius,
std::vector< _T > &  nbh 
) const
pure virtual

Get the nearest neighbors of a point, within a specified radius.

Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.

template<typename _T>
virtual bool fcl::NearestNeighbors< _T >::remove ( const _T &  data)
pure virtual

Remove an element from the datastructure.

Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.

template<typename _T>
virtual void fcl::NearestNeighbors< _T >::setDistanceFunction ( const DistanceFunction distFun)
inlinevirtual

Set the distance function to use.

Referenced by fcl::NearestNeighborsGNAT< _T >::setDistanceFunction().

template<typename _T>
virtual std::size_t fcl::NearestNeighbors< _T >::size ( void  ) const
pure virtual

Get the number of elements in the datastructure.

Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.

Member Data Documentation