PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
nsearch::PointCloudAdaptor Struct Reference

Allows custom point cloud data structure to interface with nanoflann. See https://github.com/jlblancoc/nanoflann for more details. More...

#include <nflannSetup.h>

Collaboration diagram for nsearch::PointCloudAdaptor:

Public Types

typedef double coord_t
 Define coordinate type.
 

Public Member Functions

 PointCloudAdaptor (const PointCloud &obj)
 Constructor.
 
const PointCloudpointCloud () const
 Get vector of points.
 
size_t kdtree_get_point_count () const
 Get number of points in point cloud.
 
coord_t kdtree_get_pt (const size_t idx, const size_t dim) const
 Get specific coordinate of a point.
 
template<class BBOX >
bool kdtree_get_bbox (BBOX &) const
 Optional bounding-box computation: return false to default to a standard bbox computation loop. Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again. Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)
 

Data Fields

const PointCloudd_obj
 Const reference to list of points.
 

Detailed Description

Allows custom point cloud data structure to interface with nanoflann. See https://github.com/jlblancoc/nanoflann for more details.

Definition at line 26 of file nflannSetup.h.

Member Typedef Documentation

◆ coord_t

Define coordinate type.

Definition at line 28 of file nflannSetup.h.

Constructor & Destructor Documentation

◆ PointCloudAdaptor()

nsearch::PointCloudAdaptor::PointCloudAdaptor ( const PointCloud obj)
inline

Constructor.

Parameters
objVector of points

Definition at line 38 of file nflannSetup.h.

38: d_obj(obj) {}
const PointCloud & d_obj
Const reference to list of points.
Definition nflannSetup.h:31

Member Function Documentation

◆ kdtree_get_bbox()

template<class BBOX >
bool nsearch::PointCloudAdaptor::kdtree_get_bbox ( BBOX &  ) const
inline

Optional bounding-box computation: return false to default to a standard bbox computation loop. Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again. Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)

Returns
Bool False if default bounding-box calculation

Definition at line 75 of file nflannSetup.h.

75 {
76 return false;
77 }

◆ kdtree_get_point_count()

size_t nsearch::PointCloudAdaptor::kdtree_get_point_count ( ) const
inline

Get number of points in point cloud.

Returns
N Number of points

Definition at line 52 of file nflannSetup.h.

52{ return pointCloud().size(); }
const PointCloud & pointCloud() const
Get vector of points.
Definition nflannSetup.h:45

References pointCloud().

Here is the call graph for this function:

◆ kdtree_get_pt()

coord_t nsearch::PointCloudAdaptor::kdtree_get_pt ( const size_t  idx,
const size_t  dim 
) const
inline

Get specific coordinate of a point.

Parameters
idxId of a point
dimCoordinate id (e.g. 0, 1, 2)
Returns
Coord Coordinate of a point

Definition at line 62 of file nflannSetup.h.

62 {
63 return pointCloud()[idx][dim];
64 }

References pointCloud().

Here is the call graph for this function:

◆ pointCloud()

const PointCloud & nsearch::PointCloudAdaptor::pointCloud ( ) const
inline

Get vector of points.

Returns
Vector Vector of points

Definition at line 45 of file nflannSetup.h.

45{ return d_obj; }

References d_obj.

Referenced by kdtree_get_point_count(), and kdtree_get_pt().

Here is the caller graph for this function:

Field Documentation

◆ d_obj

const PointCloud& nsearch::PointCloudAdaptor::d_obj

Const reference to list of points.

Definition at line 31 of file nflannSetup.h.

Referenced by pointCloud().


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