VAPOR3 3.9.4
|
This class implements a k-d tree for a structured grid over a reduced region-of-interest (ROI) More...
#include <KDTreeRG.h>
Public Member Functions | |
KDTreeRGSubset () | |
KDTreeRGSubset (const KDTreeRG *kdtreerg, const std::vector< size_t > &min, const std::vector< size_t > &max) | |
~KDTreeRGSubset () | |
void | Nearest (const std::vector< float > &coordu, std::vector< size_t > &coord) 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 tree for a structured grid over a reduced region-of-interest (ROI)
class KDTreeRGSubset
This class provides a k-d tree for a structured grid over an ROI. The class constructor is passed a pointer to a KDTreeRG instance that defines a k-d tree over a structured grid. This class can be used to cull out points outside of an axis-aligned region of interest specified by min
and max
. The advantage of using this class over simply creating a new instance of KDTreeRG is the avoidance of the cost of rebuilding the k-d tree from scratch.
Definition at line 168 of file KDTreeRG.h.
VAPoR::KDTreeRGSubset::KDTreeRGSubset | ( | ) |
VAPoR::KDTreeRGSubset::KDTreeRGSubset | ( | const KDTreeRG * | kdtreerg, |
const std::vector< size_t > & | min, | ||
const std::vector< size_t > & | max | ||
) |
Construct a KDTreeRGSubset instance.
Construct a KDTreeRGSubset instance.
[in] | kdtreerg | A pointer to a KDTreeRG instance. The pointer is shallow copied and the referenced contents should remain valid until this class instance is destroyed. |
[in] | min | A two or three element vector of ijk coordinate indeces of the first grid point defined by xg, yg, and zg. |
[in] | max | A two or three element vector of ijk coordinate indeces of the last grid point defined by xg, yg, and zg. |
kdtreerg
is shallow copied and the referenced contents should remain valid until this class instance is destroyed.
|
inline |
Definition at line 190 of file KDTreeRG.h.
|
inline |
Definition at line 215 of file KDTreeRG.h.
|
inline |
Definition at line 208 of file KDTreeRG.h.
void VAPoR::KDTreeRGSubset::Nearest | ( | const std::vector< float > & | coordu, |
std::vector< size_t > & | coord | ||
) | const |
Return indecies of nearest point
This method returns the ijk index of the grid vertex nearest, by measure of Cartesian distance, a specified point. The returned indecies may be used to access the xg
, yg
, and zg
Grid instances passed into the constructor used to create kdtreerg
.
[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 . |