|
HighMap library (C++)
|
Context wrapper for KD-tree operations. More...
#include <kd_tree.hpp>

Public Member Functions | |
| KDTreeContext (const std::vector< float > &x_, const std::vector< float > &y_) | |
| Construct the KD-tree context and build the index. | |
| glm::vec2 | compte_neighbor_distance_range (size_t k_neighbors) const |
| Estimate the range of neighbor distances. | |
| void | neighbor_search (float x_query, float y_query, size_t k_neighbors, std::vector< size_t > &indices, std::vector< float > &distances) const |
| Perform a k-nearest neighbor search. | |
| std::vector< nanoflann::ResultItem< unsigned int, float > > | radius_search (float x_query, float y_query, float radius) const |
| Perform a radius-based neighbor search. | |
Public Attributes | |
| const std::vector< float > & | x |
| const std::vector< float > & | y |
| NanoflannPointCloudAdaptor | adaptor |
| KDTree | index |
Context wrapper for KD-tree operations.
This class encapsulates:
It provides convenient methods for nearest-neighbor and radius-based queries.
| hmap::KDTreeContext::KDTreeContext | ( | const std::vector< float > & | x_, |
| const std::vector< float > & | y_ | ||
| ) |
Construct the KD-tree context and build the index.
| x_ | Vector of x coordinates |
| y_ | Vector of y coordinates |
| glm::vec2 hmap::KDTreeContext::compte_neighbor_distance_range | ( | size_t | k_neighbors | ) | const |
Estimate the range of neighbor distances.
Computes the minimum and maximum distance to the k-th nearest neighbor across all points in the dataset.
| k_neighbors | Number of neighbors considered |
| void hmap::KDTreeContext::neighbor_search | ( | float | x_query, |
| float | y_query, | ||
| size_t | k_neighbors, | ||
| std::vector< size_t > & | indices, | ||
| std::vector< float > & | distances | ||
| ) | const |
Perform a k-nearest neighbor search.
| x_query | Query x coordinate | |
| y_query | Query y coordinate | |
| k_neighbors | Number of neighbors to retrieve | |
| [out] | indices | Output indices of neighbors |
| [out] | distances | Output squared distances to neighbors |
| std::vector< nanoflann::ResultItem< unsigned int, float > > hmap::KDTreeContext::radius_search | ( | float | x_query, |
| float | y_query, | ||
| float | radius | ||
| ) | const |
Perform a radius-based neighbor search.
| x_query | Query x coordinate |
| y_query | Query y coordinate |
| radius | Search radius (Euclidean distance) |
| const std::vector<float>& hmap::KDTreeContext::x |
Reference to x coordinates
| const std::vector<float>& hmap::KDTreeContext::y |
Reference to y coordinates
| NanoflannPointCloudAdaptor hmap::KDTreeContext::adaptor |
Nanoflann adaptor
| KDTree hmap::KDTreeContext::index |
KD-tree index