39 #ifndef MOVEIT_ROS_PLANNING_CACHED_IK_KINEMATICS_NEAREST_NEIGHBORS_ 40 #define MOVEIT_ROS_PLANNING_CACHED_IK_KINEMATICS_NEAREST_NEIGHBORS_ 48 template <
typename _T>
76 virtual void clear() = 0;
79 virtual void add(
const _T& data) = 0;
82 virtual void add(
const std::vector<_T>& data)
84 for (
auto elt = data.begin(); elt != data.end(); ++elt)
89 virtual bool remove(
const _T& data) = 0;
92 virtual _T
nearest(
const _T& data)
const = 0;
99 virtual void nearestK(
const _T& data, std::size_t k, std::vector<_T>& nbh)
const = 0;
106 virtual void nearestR(
const _T& data,
double radius, std::vector<_T>& nbh)
const = 0;
109 virtual std::size_t
size()
const = 0;
112 virtual void list(std::vector<_T>& data)
const = 0;
virtual void list(std::vector< _T > &data) const =0
Get all the elements in the datastructure.
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 std::size_t size() const =0
Get the number of elements in the datastructure.
virtual _T nearest(const _T &data) const =0
Get the nearest neighbor of a point.
NearestNeighbors()=default
virtual void add(const _T &data)=0
Add an element to the datastructure.
virtual bool reportsSortedResults() const =0
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
virtual void setDistanceFunction(const DistanceFunction &distFun)
Set the distance function to use.
virtual void clear()=0
Clear the datastructure.
Abstract representation of a container that can perform nearest neighbors queries.
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 void add(const std::vector< _T > &data)
Add a vector of points.
DistanceFunction distFun_
The used distance function.
virtual ~NearestNeighbors()=default
const DistanceFunction & getDistanceFunction() const
Get the distance function used.
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.