eLynx::Math::KDTree< T > Class Template Reference
#include <KDTree.h>
List of all members.
Detailed Description
template<typename T>
class eLynx::Math::KDTree< T >
2D binary tree. See
KD Binary Tree.
Definition at line 38 of file KDTree.h.
Constructor & Destructor Documentation
Class constructor The canonical method of kd-tree construction has the following constraints: As one moves down the tree, one cycles through the axes used to select the splitting planes. (For example, the root would have an x-aligned plane, the root's children would both have y-aligned planes, the root's grandchildren would all have z-aligned planes, and so on.) At each step, the point selected to create the splitting plane is the median of the points being put into the kd-tree, with respect to their coordinates in the axis being used. This method leads to a balanced kd-tree, in which each leaf node is about the same distance from the root. (Note the assumption that we feed the entire set of points into the algorithm up-front.)
- Parameters:
-
| iPoints | array of 2D points to insert into the tree. |
| iSize | number of points. |
| iWidth | width of the image which contains all points |
| iHeight | height of the image which contains all points |
Member Function Documentation
Finds up to specified number of NN to specified location not in the tree
- Parameters:
-
| iPoint | target point. |
| iNumber | max number of returned points. |
| oPoints | closest iNumber points. |
Finds a NN to specified location not in the tree
- Parameters:
-
| iPoint | target point. |
| oNeighbor | nearest point to the target point. |
| oDistance | distance to nearest point from the target point. |
- Returns:
- true if KDTree is not empty
The documentation for this class was generated from the following file: