NDEVR
API Documentation
PCLRTreeWrapper< PointT >

Adapts the NDEVR RTree spatial index to the PCL search interface for nearest-neighbor queries. More...

Collaboration diagram for PCLRTreeWrapper< PointT >:
[legend]

Public Member Functions

 PCLRTreeWrapper (const Buffer< Vertex< 3, fltp04 > > &vertices, const RTree< 3, fltp04 > &tree, uint04 &total_search_ptr, uint04 search_count, LogPtr log=LogPtr())
 Constructor for KdTree.
virtual ~PCLRTreeWrapper ()
 Destructor for KdTree.
int nearestKSearch (const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const final override
 Search for the k-nearest neighbors for the given query point.
int radiusSearch (const PointT &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int k=0) const final override
 Search for all the nearest neighbors of the query point in a given radius.

Protected Attributes

const RTree< 3, fltp04 > & m_tree
 A pointer to the internal KdTree object.

Detailed Description

template<typename PointT>
class PCLRTreeWrapper< PointT >

Adapts the NDEVR RTree spatial index to the PCL search interface for nearest-neighbor queries.


Definition at line 17 of file PCLTreeWrapper.h.

Constructor & Destructor Documentation

◆ PCLRTreeWrapper()

template<typename PointT>
PCLRTreeWrapper< PointT >::PCLRTreeWrapper ( const Buffer< Vertex< 3, fltp04 > > & vertices,
const RTree< 3, fltp04 > & tree,
uint04 & total_search_ptr,
uint04 search_count,
LogPtr log = LogPtr() )
inline

Constructor for KdTree.

Parameters
[in]sortedset to true if the nearest neighbor search results need to be sorted in ascending order based on their distance to the query point

Definition at line 37 of file PCLTreeWrapper.h.

References m_tree.

Member Function Documentation

◆ nearestKSearch()

template<typename PointT>
int PCLRTreeWrapper< PointT >::nearestKSearch ( const PointT & point,
int k,
std::vector< int > & k_indices,
std::vector< float > & k_sqr_distances ) const
inlinefinaloverride

Search for the k-nearest neighbors for the given query point.

Parameters
[in]pointthe given query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns
number of neighbors found

Definition at line 75 of file PCLTreeWrapper.h.

References cast(), and radiusSearch().

◆ radiusSearch()

template<typename PointT>
int PCLRTreeWrapper< PointT >::radiusSearch ( const PointT & point,
double radius,
std::vector< int > & k_indices,
std::vector< float > & k_sqr_distances,
unsigned int k = 0 ) const
inlinefinaloverride

Search for all the nearest neighbors of the query point in a given radius.

Parameters
[in]pointthe given query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_sqr_distancesthe resultant squared distances to the neighboring points
[in]max_nnif given, bounds the maximum returned neighbors to this value. If max_nn is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in radius will be returned.
Returns
number of neighbors found in radius

Definition at line 94 of file PCLTreeWrapper.h.

References cast(), getMin(), IsInvalid(), and m_tree.

Referenced by nearestKSearch().


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