Point Cloud Library (PCL) 1.15.1-dev
Loading...
Searching...
No Matches
auto.h
1/*
2* SPDX-License-Identifier: BSD-3-Clause
3*
4* Point Cloud Library (PCL) - www.pointclouds.org
5* Copyright (c) 2025-, Open Perception Inc.
6*
7* All rights reserved
8*/
9
10#pragma once
11
12#include <pcl/point_cloud.h>
13#include <pcl/search/search.h>
14
15namespace pcl {
16 template <typename T> class PointRepresentation;
17
18 namespace search {
19 enum class Purpose : std::uint32_t {
20 undefined = 0, ///< Default value, for general-purpose search method
21 radius_search = 1, ///< The search method will mainly be used for radiusSearch
22 one_knn_search = 2, ///< The search method will mainly be used for nearestKSearch where k is 1
23 many_knn_search = 4 ///< The search method will mainly be used for nearestKSearch where k is larger than 1
24 };
25
26 /**
27 * Automatically select the fastest search method for the given point cloud. Make sure to delete the returned object after use!
28 * \param[in] cloud Point cloud, this function will pass it to the search method via setInputCloud
29 * \param[in] sorted_results Whether the search method should always return results sorted by distance (may be slower than unsorted)
30 * \param[in] purpose Optional, can be used to give more information about what this search method will be used for, to achieve optimal performance
31 */
32 template<typename PointT>
34 {
35 return autoSelectMethod<PointT>(cloud, pcl::IndicesConstPtr(), sorted_results, purpose);
36 }
37
38 /**
39 * Automatically select the fastest search method for the given point cloud. Make sure to delete the returned object after use!
40 * \param[in] cloud Point cloud, this function will pass it to the search method via setInputCloud
41 * \param[in] indices Will be passed to the search method via setInputCloud, together with the point cloud
42 * \param[in] sorted_results Whether the search method should always return results sorted by distance (may be slower than unsorted)
43 * \param[in] purpose Optional, can be used to give more information about what this search method will be used for, to achieve optimal performance
44 */
45 template<typename PointT>
46 pcl::search::Search<PointT> * autoSelectMethod(const typename pcl::PointCloud<PointT>::ConstPtr& cloud, const pcl::IndicesConstPtr& indices, bool sorted_results, Purpose purpose = Purpose::undefined);
47
48 /**
49 * Automatically select the fastest search method for the given point cloud. Make sure to delete the returned object after use!
50 * \param[in] cloud Point cloud, this function will pass it to the search method via setInputCloud
51 * \param[in] indices Will be passed to the search method via setInputCloud, together with the point cloud
52 * \param[in] point_representation Determines which fields are used for searching
53 * \param[in] sorted_results Whether the search method should always return results sorted by distance (may be slower than unsorted)
54 * \param[in] purpose Optional, can be used to give more information about what this search method will be used for, to achieve optimal performance
55 */
56 template<typename PointT>
57 pcl::search::Search<PointT> * autoSelectMethod(const typename pcl::PointCloud<PointT>::ConstPtr& cloud, const pcl::IndicesConstPtr& indices, const pcl::shared_ptr<const pcl::PointRepresentation<PointT>>& point_representation, bool sorted_results, Purpose purpose = Purpose::undefined);
58 } // namespace search
59} // namespace pcl
60
61#ifdef PCL_NO_PRECOMPILE
62#include <pcl/search/impl/auto.hpp>
63#endif
shared_ptr< const PointCloud< PointT > > ConstPtr
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
Generic search class.
Definition search.h:78
@ undefined
Default value, for general-purpose search method.
@ one_knn_search
The search method will mainly be used for nearestKSearch where k is 1.
@ radius_search
The search method will mainly be used for radiusSearch.
@ many_knn_search
The search method will mainly be used for nearestKSearch where k is larger than 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.
Definition auto.h:33
shared_ptr< const Indices > IndicesConstPtr
Definition pcl_base.h:59