|
VAPOR3 3.9.4
|
This class implements a k-d space partitioning tree. More...
#include <KDTreeRG.h>
Public Member Functions | |
| KDTreeRG (const Grid &xg, const Grid &yg) | |
| virtual | ~KDTreeRG () |
| void | Nearest (const std::vector< float > &coordu, std::vector< size_t > &index) const |
| void | Nearest (const std::vector< double > &coordu, std::vector< size_t > &index) const |
| std::vector< size_t > | GetDimensions () const |
This class implements a k-d space partitioning tree.
This class provides an object-oriented interface to kdtree.c, which implements a k-d space partitioning tree.
Definition at line 22 of file KDTreeRG.h.
Construct a 2D k-d tree for a structured grid
Creates a 2D k-d space partitioning tree for a structured grid defined by a pair of Grid instances. The data values of the xg and yg Grid instances provide the coordinates of all of the points to be inserted into the k-d tree.
| [in] | xg | A Grid instance giving the X user coordinates for each point in the k-d tree. |
| [in] | yg | A Grid instance giving the Y user coordinates for each point in the k-d tree. The xg and yg Grid instances must have identical configurations, differing only in their data values. |
|
virtual |
Construct a 3D k-d tree for a structured grid
Creates a 3D k-d space partitioning tree for a structured grid
| [in] | xg | A Grid instance giving the X user coordinates for each point in the k-d tree. |
| [in] | yg | A Grid instance giving the Y user coordinates for each point in the k-d tree. |
| [in] | zg | A Grid instance giving the Z user coordinates for each point in the k-d tree. The xg, yg, and yg Grid instances must have identical configurations, differing only in their data values. |
|
inline |
Returns the dimesionality of the structured grids passed to the constructor.
This method returns a two or three element vector containing the dimensions of the Grid class instances passed to the constructor.
| vector |
Definition at line 92 of file KDTreeRG.h.
|
inline |
Definition at line 77 of file KDTreeRG.h.
| void VAPoR::KDTreeRG::Nearest | ( | const std::vector< float > & | coordu, |
| std::vector< size_t > & | index | ||
| ) | const |
Return indecies of nearest point
This method returns the ijk indeces of the grid vertex nearest, by measure of Cartesian distance, a specified point. The returned indeces may be used to access the xg, yg, and zg Grid instances passed into the constructor.
| [in] | coordu | A 2D or 3D vector of user coordinates specifying the location of a point in space. |
| [out] | index | The ijk indecies of the grid vertex nearest coordu. |