HighMap library (C++)
Loading...
Searching...
No Matches
hmap::NanoflannPointCloudAdaptor Struct Reference

Adaptor exposing a 2D point cloud to nanoflann. More...

#include <kd_tree.hpp>

Collaboration diagram for hmap::NanoflannPointCloudAdaptor:

Public Member Functions

 NanoflannPointCloudAdaptor (const std::vector< float > &x_, const std::vector< float > &y_)
 Construct the adaptor from coordinate arrays.
 
size_t kdtree_get_point_count () const
 Get the number of points in the dataset.
 
float kdtree_get_pt (const size_t idx, int dim) const
 Get a coordinate component of a point.
 
template<class BBOX >
bool kdtree_get_bbox (BBOX &) const
 Optional bounding-box computation (unused).
 

Public Attributes

const std::vector< float > & x
 
const std::vector< float > & y
 

Detailed Description

Adaptor exposing a 2D point cloud to nanoflann.

This class provides the minimal interface required by nanoflann to access a set of 2D points stored as separate x and y coordinate arrays.

The data is not owned by the adaptor; it references external vectors.

Constructor & Destructor Documentation

◆ NanoflannPointCloudAdaptor()

hmap::NanoflannPointCloudAdaptor::NanoflannPointCloudAdaptor ( const std::vector< float > &  x_,
const std::vector< float > &  y_ 
)

Construct the adaptor from coordinate arrays.

Parameters
x_Vector of x coordinates
y_Vector of y coordinates

Member Function Documentation

◆ kdtree_get_point_count()

size_t hmap::NanoflannPointCloudAdaptor::kdtree_get_point_count ( ) const
inline

Get the number of points in the dataset.

Returns
Number of points

◆ kdtree_get_pt()

float hmap::NanoflannPointCloudAdaptor::kdtree_get_pt ( const size_t  idx,
int  dim 
) const
inline

Get a coordinate component of a point.

Parameters
idxPoint index
dimDimension (0 = x, 1 = y)
Returns
Coordinate value

◆ kdtree_get_bbox()

template<class BBOX >
bool hmap::NanoflannPointCloudAdaptor::kdtree_get_bbox ( BBOX &  ) const
inline

Optional bounding-box computation (unused).

Returns
Always false (no bounding box provided)

Member Data Documentation

◆ x

const std::vector<float>& hmap::NanoflannPointCloudAdaptor::x

Reference to x coordinates

◆ y

const std::vector<float>& hmap::NanoflannPointCloudAdaptor::y

Reference to y coordinates


The documentation for this struct was generated from the following files: