Abstract representation of a container that can perform nearest neighbors queries. More...
#include <hpp/fcl/knn/nearest_neighbors.h>
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 DistanceFunction & | getDistanceFunction (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. |
Abstract representation of a container that can perform nearest neighbors queries.
typedef boost::function<double(const _T&, const _T&)> fcl::NearestNeighbors< _T >::DistanceFunction |
The definition of a distance function.
fcl::NearestNeighbors< _T >::NearestNeighbors | ( | void | ) | [inline] |
virtual fcl::NearestNeighbors< _T >::~NearestNeighbors | ( | void | ) | [inline, virtual] |
virtual void fcl::NearestNeighbors< _T >::add | ( | const _T & | data | ) | [pure virtual] |
Add an element to the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
Referenced by fcl::NearestNeighbors< Transform3f >::add().
virtual void fcl::NearestNeighbors< _T >::add | ( | const std::vector< _T > & | data | ) | [inline, virtual] |
Add a vector of points.
Reimplemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
virtual void fcl::NearestNeighbors< _T >::clear | ( | void | ) | [pure virtual] |
Clear the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
const DistanceFunction& fcl::NearestNeighbors< _T >::getDistanceFunction | ( | void | ) | const [inline] |
Get the distance function used.
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 >.
virtual _T fcl::NearestNeighbors< _T >::nearest | ( | const _T & | data | ) | const [pure virtual] |
Get the nearest neighbor of a point.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _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 >.
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 >.
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 >.
virtual void fcl::NearestNeighbors< _T >::setDistanceFunction | ( | const DistanceFunction & | distFun | ) | [inline, virtual] |
Set the distance function to use.
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 >.
DistanceFunction fcl::NearestNeighbors< _T >::distFun_ [protected] |
The used distance function.
Referenced by fcl::NearestNeighborsGNAT< _T >::Node::add(), fcl::NearestNeighbors< Transform3f >::getDistanceFunction(), fcl::NearestNeighborsLinear< _T >::nearest(), fcl::NearestNeighborsSqrtApprox< _T >::nearest(), fcl::NearestNeighborsGNAT< _T >::Node::nearestK(), fcl::NearestNeighborsGNAT< _T >::Node::nearestR(), and fcl::NearestNeighbors< Transform3f >::setDistanceFunction().