1 #ifndef POINT_LOCATION_H 2 #define POINT_LOCATION_H 6 #include <KrisLibrary/geometry/KDTree.h> 7 #include <KrisLibrary/geometry/BallTree.h> 25 virtual bool OnDelete(
int id) {
return false; }
29 virtual bool Exact() {
return true; }
33 virtual bool NN(
const Vector& p,
int& nn,Real& distance) {
return false; }
37 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances) {
return false; }
41 virtual bool Close(
const Vector& p,Real r,std::vector<int>& neighbors,std::vector<Real>& distances) {
return false; }
43 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance) {
return false; }
45 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances) {
return false; }
47 virtual bool FilteredClose(
const Vector& p,Real r,
bool (*filter)(
int),std::vector<int>& neighbors,std::vector<Real>& distances) {
return false; }
51 std::vector<Vector>& points;
63 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
64 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
65 virtual bool Close(
const Vector& p,Real r,std::vector<int>& nn,std::vector<Real>& distances);
66 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
67 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
68 virtual bool FilteredClose(
const Vector& p,Real r,
bool (*filter)(
int),std::vector<int>& neighbors,std::vector<Real>& distances);
85 virtual bool Exact() {
return false; }
86 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
87 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
88 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
89 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
103 virtual bool Exact() {
return false; }
104 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
105 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
106 virtual bool FilteredNN(
const Vector& p,
bool (*filter)(
int),
int& nn,Real& distance);
107 virtual bool FilteredKNN(
const Vector& p,
int k,
bool (*filter)(
int),std::vector<int>& nn,std::vector<Real>& distances);
128 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
129 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
130 virtual bool Close(
const Vector& p,Real r,std::vector<int>& nn,std::vector<Real>& distances);
135 std::unique_ptr<Geometry::KDTree> tree;
151 virtual bool NN(
const Vector& p,
int& nn,Real& distance);
152 virtual bool KNN(
const Vector& p,
int k,std::vector<int>& nn,std::vector<Real>& distances);
153 virtual bool Close(
const Vector& p,Real r,std::vector<int>& nn,std::vector<Real>& distances);
157 std::unique_ptr<Geometry::BallTree> tree;
virtual bool FilteredNN(const Vector &p, bool(*filter)(int), int &nn, Real &distance)
Same as NN, but with a filter.
Definition: PointLocation.h:43
An accelerated point location algorithm that uses a K-D tree.
Definition: PointLocation.h:120
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:60
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:29
Motion planning configuration space base class. The configuration space implements an interpolation s...
Definition: CSpace.h:39
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:100
virtual bool OnDelete(int id)
Definition: PointLocation.h:61
A uniform abstract interface to point location data structures. The point locator operators in-place ...
Definition: PointLocation.h:14
virtual void OnBuild()
Call this when the point list is completely changed.
Definition: PointLocation.h:99
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:45
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:62
virtual void OnBuild()
Call this when the point list is completely changed.
Definition: PointLocation.h:59
The approximate O(k) point location algorithm that returns the closest of k randomly chosen points...
Definition: PointLocation.h:95
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:84
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:81
virtual bool OnDelete(int id)
Definition: PointLocation.h:101
virtual void GetStats(PropertyMap &stats)
Returns any potentially interesting statistics.
Definition: PointLocation.h:49
virtual bool NN(const Vector &p, int &nn, Real &distance)
Definition: PointLocation.h:33
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:47
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:85
virtual bool OnDelete(int id)
Definition: PointLocation.h:25
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:102
virtual bool Exact()
Subclass returns true if this is exact nearest neighbors.
Definition: PointLocation.h:103
A simple map from keys to values.
Definition: PropertyMap.h:27
virtual bool OnDelete(int id)
Definition: PointLocation.h:83
virtual bool KNN(const Vector &p, int k, std::vector< int > &nn, std::vector< Real > &distances)
Definition: PointLocation.h:37
virtual void OnAppend()
Call this when something is appended to the point list.
Definition: PointLocation.h:82
virtual bool OnClear()
Call this when the point list is cleared.
Definition: PointLocation.h:27
virtual bool Close(const Vector &p, Real r, std::vector< int > &neighbors, std::vector< Real > &distances)
Definition: PointLocation.h:41
The approximate O(1) point location algorithm that simply returns a random point. ...
Definition: PointLocation.h:77
An accelerated point location algorithm that uses a ball tree.
Definition: PointLocation.h:144
The Naive O(n) point location algorithm.
Definition: PointLocation.h:55
virtual void OnAppend()=0
Call this when something is appended to the point list.