#include <kdTree.h>
This class implements classical kd tree for nearest neighbors search
Classes | |
struct | TREENODE |
Protected Attributes | |
type::vector< TREENODE > | tree |
unsigned int | firstNode |
Public Member Functions | |
bool | isEmpty () const |
void | build (const VecCoord &positions) |
update tree (to be used whenever positions have changed) More... | |
void | build (const VecCoord &positions, const type::vector< unsigned int > &ROI) |
update tree based on positions subset (to be used whenever points p have changed) More... | |
void | getNClosest (distanceSet &cl, const Coord &x, const VecCoord &positions, const unsigned int n) const |
get an ordered set of n distance/index pairs between positions and x More... | |
unsigned int | getClosest (const Coord &x, const VecCoord &positions) const |
get the index of the closest point between positions and x More... | |
bool | getNClosestCached (distanceSet &cl, distanceToPoint &cacheThresh_max, distanceToPoint &cacheThresh_min, Coord &previous_x, const Coord &x, const VecCoord &positions, const unsigned int n) const |
use distance caching to accelerate closest point computation when positions are fixed (see simon96 thesis) More... | |
Protected Member Functions | |
void | print (const unsigned int index) |
unsigned int | build (UIlist &list, unsigned char direction, const VecCoord &positions) |
void | closest (distanceSet &cl, const Coord &x, const unsigned int ¤tnode, const VecCoord &positions, unsigned N) const |
void | closest (distanceToPoint &cl, const Coord &x, const unsigned int ¤tnode, const VecCoord &positions) const |
Friends | |
To be Data-zable | |
std::ostream & | operator<< (std::ostream &os, const kdTree< Coord > &) |
std::istream & | operator>> (std::istream &is, kdTree< Coord > &) |
|
protected |
|
protected |
void sofa::helper::kdTree< Coord >::build | ( | const VecCoord & | positions | ) |
update tree (to be used whenever positions have changed)
void sofa::helper::kdTree< Coord >::build | ( | const VecCoord & | positions, |
const type::vector< unsigned int > & | ROI | ||
) |
update tree based on positions subset (to be used whenever points p have changed)
|
protected |
|
protected |
|
protected |
unsigned int sofa::helper::kdTree< Coord >::getClosest | ( | const Coord & | x, |
const VecCoord & | positions | ||
) | const |
get the index of the closest point between positions and x
void sofa::helper::kdTree< Coord >::getNClosest | ( | distanceSet & | cl, |
const Coord & | x, | ||
const VecCoord & | positions, | ||
const unsigned int | n | ||
) | const |
get an ordered set of n distance/index pairs between positions and x
bool sofa::helper::kdTree< Coord >::getNClosestCached | ( | distanceSet & | cl, |
distanceToPoint & | cacheThresh_max, | ||
distanceToPoint & | cacheThresh_min, | ||
Coord & | previous_x, | ||
const Coord & | x, | ||
const VecCoord & | positions, | ||
const unsigned int | n | ||
) | const |
use distance caching to accelerate closest point computation when positions are fixed (see simon96 thesis)
|
inline |
|
protected |
|
friend |
|
friend |