KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
PointLocationBase Class Referenceabstract

A uniform abstract interface to point location data structures. The point locator operators in-place on a vector of Vectors and does not allocate any extra memory unless this is desired. More...

#include <PointLocation.h>

Inheritance diagram for PointLocationBase:
BallTreePointLocation KDTreePointLocation NaivePointLocation RandomBestPointLocation RandomPointLocation

Public Member Functions

 PointLocationBase (std::vector< Vector > &_points)
 
virtual void OnBuild ()=0
 Call this when the point list is completely changed.
 
virtual void OnAppend ()=0
 Call this when something is appended to the point list.
 
virtual bool OnDelete (int id)
 
virtual bool OnClear ()
 Call this when the point list is cleared.
 
virtual bool Exact ()
 Subclass returns true if this is exact nearest neighbors.
 
virtual bool NN (const Vector &p, int &nn, Real &distance)
 
virtual bool KNN (const Vector &p, int k, std::vector< int > &nn, std::vector< Real > &distances)
 
virtual bool Close (const Vector &p, Real r, std::vector< int > &neighbors, std::vector< Real > &distances)
 
virtual bool FilteredNN (const Vector &p, bool(*filter)(int), int &nn, Real &distance)
 Same as NN, but with a filter.
 
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.
 
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.
 
virtual void GetStats (PropertyMap &stats)
 Returns any potentially interesting statistics.
 

Public Attributes

std::vector< Vector > & points
 

Detailed Description

A uniform abstract interface to point location data structures. The point locator operators in-place on a vector of Vectors and does not allocate any extra memory unless this is desired.

Member Function Documentation

virtual bool PointLocationBase::Close ( const Vector p,
Real  r,
std::vector< int > &  neighbors,
std::vector< Real > &  distances 
)
inlinevirtual

Call this to retrieve the index of the points within distance r, and their distances. Subclasses should return false if close-neighbor queries are not supported.

Reimplemented in BallTreePointLocation, KDTreePointLocation, and NaivePointLocation.

Referenced by NaivePointLocation::OnClear().

virtual bool PointLocationBase::KNN ( const Vector p,
int  k,
std::vector< int > &  nn,
std::vector< Real > &  distances 
)
inlinevirtual

Call this to retrieve the indices of the k-nearest neighbors and their distances. Subclasses should return false if KNN queries are not supported.

Reimplemented in BallTreePointLocation, KDTreePointLocation, RandomBestPointLocation, RandomPointLocation, and NaivePointLocation.

Referenced by RandomPointLocation::Exact(), RandomBestPointLocation::Exact(), and NaivePointLocation::OnClear().

virtual bool PointLocationBase::NN ( const Vector p,
int &  nn,
Real &  distance 
)
inlinevirtual

Call this to retrieve the index of the nearest neighbor and its distance. Subclasses should return false if NN queries are not supported.

Reimplemented in BallTreePointLocation, KDTreePointLocation, RandomBestPointLocation, RandomPointLocation, and NaivePointLocation.

Referenced by RandomPointLocation::Exact(), RandomBestPointLocation::Exact(), and NaivePointLocation::OnClear().

virtual bool PointLocationBase::OnDelete ( int  id)
inlinevirtual

Call this when an index is deleted from the point list. Subclasses should return false if deletion is not supported

Reimplemented in RandomBestPointLocation, RandomPointLocation, and NaivePointLocation.


The documentation for this class was generated from the following files: