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. More... | |
Public Member Functions | |
NearestNeighbors (void) | |
virtual | ~NearestNeighbors (void) |
virtual void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. More... | |
const DistanceFunction & | getDistanceFunction (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... | |
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.
|
inline |
|
inlinevirtual |
|
pure virtual |
Add an element to the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
Referenced by fcl::NearestNeighbors< fcl::Transform3f >::add(), and fcl::NearestNeighborsGNAT< _T >::add().
|
inlinevirtual |
Add a vector of points.
Reimplemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
|
pure virtual |
Clear the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
|
inline |
Get the distance function used.
|
pure virtual |
Get all the elements in the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.
|
pure virtual |
Get the nearest neighbor of a point.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
|
pure virtual |
Get the k-nearest neighbors of a point.
Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.
|
pure virtual |
Get the nearest neighbors of a point, within a specified radius.
Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.
|
pure virtual |
Remove an element from the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, fcl::NearestNeighborsSqrtApprox< _T >, and fcl::NearestNeighborsLinear< _T >.
|
inlinevirtual |
Set the distance function to use.
Referenced by fcl::NearestNeighborsGNAT< _T >::setDistanceFunction().
|
pure virtual |
Get the number of elements in the datastructure.
Implemented in fcl::NearestNeighborsGNAT< _T >, and fcl::NearestNeighborsLinear< _T >.
|
protected |
The used distance function.
Referenced by fcl::NearestNeighborsGNAT< _T >::Node::add(), fcl::NearestNeighbors< fcl::Transform3f >::getDistanceFunction(), fcl::NearestNeighborsLinear< _T >::nearest(), fcl::NearestNeighborsSqrtApprox< _T >::nearest(), fcl::NearestNeighborsGNAT< _T >::Node::nearestK(), fcl::NearestNeighborsGNAT< _T >::Node::nearestR(), and fcl::NearestNeighbors< fcl::Transform3f >::setDistanceFunction().