1 #ifndef POINT_LOCATION_H 2 #define POINT_LOCATION_H 5 #include <KrisLibrary/geometry/KDTree.h> 6 #include <KrisLibrary/geometry/Grid.h> 23 virtual bool OnDelete(
int id) {
return false; }
27 virtual bool Exact() {
return true; }
31 virtual bool NN(
const Vector& p,
int& nn,Real& distance) {
return false; }
35 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances) {
return false; }
39 virtual bool Close(
const Vector& p,Real r,std::vector<int>& neighbors,std::vector<Real>& distances) {
return false; }
41 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance) {
return false; }
43 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances) {
return false; }
45 virtual bool FilteredClose(
const Vector& p,Real r,
bool (*filter)(
int),std::vector<int>& neighbors,std::vector<Real>& distances) {
return false; }
47 std::vector<Vector>& points;
59 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
60 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
61 virtual bool Close(
const Vector& p,Real r,std::vector<int>& nn,std::vector<Real>& distances);
62 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
63 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
64 virtual bool FilteredClose(
const Vector& p,Real r,
bool (*filter)(
int),std::vector<int>& neighbors,std::vector<Real>& distances);
81 virtual bool Exact() {
return false; }
82 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
83 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
84 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
85 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
99 virtual bool Exact() {
return false; }
100 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
101 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
102 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
103 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
125 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
126 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
127 virtual bool Close(
const Vector& p,Real r,std::vector<int>& nn,std::vector<Real>& distances);
virtual bool FilteredNN(const Vector &p, bool(*filter)(int), int &nn, Real &distance)
Same as NN, but with a filter.
Definition: PointLocation.h:41
An accelerated point location algorithm that uses a K-D tree.
Definition: PointLocation.h:116
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:56
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:27
Motion planning configuration space base class. The configuration space implements an interpolation s...
Definition: CSpace.h:34
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:96
virtual bool OnDelete(int id)
Definition: PointLocation.h:57
A uniform abstract interface to point location data structures. The point locator operators in-place ...
Definition: PointLocation.h:12
virtual void OnBuild()
Call this when the point list is completely changed.
Definition: PointLocation.h:95
virtual bool FilteredKNN(const Vector &p, int k, bool(*filter)(int), std::vector< int > &nn, std::vector< Real > &distances)
Same as KNN, but with a filter.
Definition: PointLocation.h:43
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:58
virtual void OnBuild()
Call this when the point list is completely changed.
Definition: PointLocation.h:55
The approximate O(k) point location algorithm that returns the closest of k randomly chosen points...
Definition: PointLocation.h:91
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:80
virtual void OnBuild()=0
Call this when the point list is completely changed.
virtual void OnBuild()
Call this when the point list is completely changed.
Definition: PointLocation.h:77
virtual bool OnDelete(int id)
Definition: PointLocation.h:97
A kd-tree or a node of one.
Definition: KDTree.h:27
virtual bool NN(const Vector &p, int &nn, Real &distance)
Definition: PointLocation.h:31
virtual bool FilteredClose(const Vector &p, Real r, bool(*filter)(int), std::vector< int > &neighbors, std::vector< Real > &distances)
Same as close, but with a filter.
Definition: PointLocation.h:45
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:81
virtual bool OnDelete(int id)
Definition: PointLocation.h:23
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:98
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:99
virtual bool OnDelete(int id)
Definition: PointLocation.h:79
virtual bool KNN(const Vector &p, int k, std::vector< int > &nn, std::vector< Real > &distances)
Definition: PointLocation.h:35
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:78
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:25
virtual bool Close(const Vector &p, Real r, std::vector< int > &neighbors, std::vector< Real > &distances)
Definition: PointLocation.h:39
The approximate O(1) point location algorithm that simply returns a random point. ...
Definition: PointLocation.h:73
The Naive O(n) point location algorithm.
Definition: PointLocation.h:51
virtual void OnAppend()=0
Call this when something is appended to the point list.