cheshirekow
v0.1.0
|
a simple KDtree class More...
#include <mpblocks/kd_tree/Tree.h>
Public Types | |
typedef Traits::Format_t | Format_t |
number format, i.e. double, float More... | |
typedef Traits::HyperRect | HyperRect_t |
the hyper rectangle class shoudl be defined as an inner class of Traits, or a typedef in Traits More... | |
typedef ListBuilder< Traits > | ListBuilder_t |
typedef NearestSearchIface < Traits > | NNIface_t |
typedef Traits::Node | Node_t |
the node class, should be defined as an inner class of Traits More... | |
typedef Node< Traits > | NodeBase_t |
typedef Vector_t | Point_t |
the storage type for points More... | |
typedef RangeSearchIface< Traits > | RangeIface_t |
typedef Tree< Traits > | This_t |
typedef Eigen::Matrix < Format_t, Traits::NDim, 1 > | Vector_t |
a vector is the difference of two points More... | |
Public Member Functions | |
ListBuilder_t::List_t & | buildList (bool bfs=true) |
create a list of all the nodes in the tree, mostly only used for debug drawing More... | |
void | clear () |
clearout the data structure, note: does not destroy any object references More... | |
void | findNearest (const Point_t &q, NNIface_t &search) |
generic NN search, specific search depends on the implementing class of the NNIface More... | |
void | findRange (RangeIface_t &search) |
generic range search, specific search depends on the implementing class of the RangeIface More... | |
ListBuilder_t::List_t & | getList () |
return the list after buildList has been called, the reference is the same one returned by buildList but you may want to build the list and then use it multiple times later More... | |
Node_t * | getRoot () |
return the root node More... | |
void | insert (Node_t *) |
insert a node into the kd tree. The node should be newly created and contain no children More... | |
void | set_initRect (const HyperRect_t &h) |
int | size () |
return the number of points in the tree More... | |
Tree () | |
constructs a new kd-tree More... | |
~Tree () | |
destructs the tree and recursively frees all node data. note that nodes do not own their data if their data are pointers More... | |
Protected Attributes | |
HyperRect_t | m_bounds |
bounding rectangle More... | |
HyperRect_t | m_initRect |
initial rectangle, probably 0,0,0... More... | |
ListBuilder_t | m_lister |
helper for building a list of all nodes More... | |
HyperRect_t | m_rect |
hyper rectangle for searches More... | |
Node_t * | m_root |
root node of the tree (0 if empty) More... | |
int | m_size |
number of points More... | |
a simple KDtree class
Traits | traits class for kd-tree specifying numer type, dimension and the derived class for the node structure |
typedef Traits::Format_t mpblocks::kd_tree::Tree< Traits >::Format_t |
typedef Traits::HyperRect mpblocks::kd_tree::Tree< Traits >::HyperRect_t |
typedef ListBuilder<Traits > mpblocks::kd_tree::Tree< Traits >::ListBuilder_t |
typedef NearestSearchIface<Traits> mpblocks::kd_tree::Tree< Traits >::NNIface_t |
typedef Traits::Node mpblocks::kd_tree::Tree< Traits >::Node_t |
typedef Node<Traits> mpblocks::kd_tree::Tree< Traits >::NodeBase_t |
typedef Vector_t mpblocks::kd_tree::Tree< Traits >::Point_t |
typedef RangeSearchIface<Traits> mpblocks::kd_tree::Tree< Traits >::RangeIface_t |
typedef Tree<Traits> mpblocks::kd_tree::Tree< Traits >::This_t |
typedef Eigen::Matrix<Format_t,Traits::NDim,1> mpblocks::kd_tree::Tree< Traits >::Vector_t |
mpblocks::kd_tree::Tree< Traits >::Tree | ( | ) |
mpblocks::kd_tree::Tree< Traits >::~Tree | ( | ) |
ListBuilder< Traits >::List_t & mpblocks::kd_tree::Tree< Traits >::buildList | ( | bool | bfs = true | ) |
void mpblocks::kd_tree::Tree< Traits >::clear | ( | ) |
void mpblocks::kd_tree::Tree< Traits >::findNearest | ( | const Point_t & | q, |
NNIface_t & | search | ||
) |
void mpblocks::kd_tree::Tree< Traits >::findRange | ( | RangeIface_t & | search | ) |
|
inline |
|
inline |
void mpblocks::kd_tree::Tree< Traits >::insert | ( | Node_t * | n | ) |
insert a node into the kd tree. The node should be newly created and contain no children
[in] | point | the k-dimensional point to insert into the graph |
[in] | data | the data to store at the newly created node (will most-likely contain *point) |
void mpblocks::kd_tree::Tree< Traits >::set_initRect | ( | const HyperRect_t & | h | ) |
int mpblocks::kd_tree::Tree< Traits >::size | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |