Public Types | Public Member Functions | Protected Attributes
fcl::NearestNeighbors< _T > Class Template Reference

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 >:
[legend]

List of all members.

Public Types

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

Public Member Functions

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

Protected Attributes

DistanceFunction distFun_
 The used distance function.

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  ) [inline, virtual]

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) [inline, virtual]
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) [inline, virtual]

Set the distance function to use.

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

template<typename _T>
DistanceFunction fcl::NearestNeighbors< _T >::distFun_ [protected]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines