10#ifndef PCL_SEARCH_AUTO_IMPL_HPP_
11#define PCL_SEARCH_AUTO_IMPL_HPP_
13#include <pcl/pcl_config.h>
14#include <pcl/common/utils.h>
15#include <pcl/search/auto.h>
16#include <pcl/search/brute_force.h>
18#include <pcl/search/kdtree.h>
20#include <pcl/search/kdtree_nanoflann.h>
21#include <pcl/search/octree.h>
22#include <pcl/search/organized.h>
24template<
typename Po
intT>
27 if constexpr (pcl::traits::has_xyz_v<PointT>) {
39 searcher =
new pcl::search::KdTreeNanoflann<PointT, pcl::DefaultPointRepresentation<PointT>::NR_DIMS> (sorted_results, (purpose ==
pcl::search::Purpose::one_knn_search ? 10 : 20));
56 if constexpr (pcl::traits::has_xyz_v<PointT>) {
70template<
typename Po
intT>
75 auto searcher =
new pcl::search::KdTreeNanoflann<PointT, pcl::DefaultPointRepresentation<PointT>::NR_DIMS> (sorted_results, (purpose ==
pcl::search::Purpose::one_knn_search ? 10 : 20));
76 searcher->setPointRepresentation (point_representation);
77 if(searcher->setInputCloud (cloud, indices)) {
84 searcher->setPointRepresentation (point_representation);
85 if(searcher->setInputCloud (cloud, indices)) {
97 searcher->setPointRepresentation (point_representation);
98 if(searcher->setInputCloud (cloud, indices)) {
107 searcher->setPointRepresentation (point_representation);
108 searcher->setInputCloud (cloud, indices);
113#define PCL_INSTANTIATE_AutoSelectMethod(T) template PCL_EXPORTS pcl::search::Search<T> * pcl::search::autoSelectMethod<T>(const typename pcl::PointCloud<T>::ConstPtr& cloud, const pcl::IndicesConstPtr& indices, bool sorted_results, pcl::search::Purpose purpose);
115#define PCL_INSTANTIATE_AutoSelectMethod2(T) template PCL_EXPORTS pcl::search::Search<T> * pcl::search::autoSelectMethod<T>(const typename pcl::PointCloud<T>::ConstPtr& cloud, const pcl::IndicesConstPtr& indices, const pcl::shared_ptr<const pcl::PointRepresentation<T> >& point_representation, bool sorted_results, pcl::search::Purpose purpose);
DefaultPointRepresentation extends PointRepresentation to define default behavior for common point ty...
bool isOrganized() const
Return whether a dataset is organized (e.g., arranged in a structured grid).
shared_ptr< const PointCloud< PointT > > ConstPtr
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
Implementation of a simple brute force search algorithm.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
search::Octree is a wrapper class which implements nearest neighbor search operations based on the pc...
OrganizedNeighbor is a class for optimized nearest neighbor search in organized projectable point clo...
virtual bool setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Pass the input dataset that the search will be performed on.
virtual void setSortedResults(bool sorted)
sets whether the results should be sorted (ascending in the distance) or not
@ one_knn_search
The search method will mainly be used for nearestKSearch where k is 1.
pcl::search::Search< PointT > * autoSelectMethod(const typename pcl::PointCloud< PointT >::ConstPtr &cloud, bool sorted_results, Purpose purpose=Purpose::undefined)
Automatically select the fastest search method for the given point cloud.
void ignore(const T &...)
Utility function to eliminate unused variable warnings.
shared_ptr< const Indices > IndicesConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.