42 #include <pcl/search/search.h>
43 #include <pcl/kdtree/kdtree_flann.h>
48 template <
typename T>
class PointRepresentation;
60 template<
typename Po
intT,
class Tree = pcl::KdTreeFLANN<Po
intT> >
75 using Ptr = shared_ptr<KdTree<PointT, Tree> >;
76 using ConstPtr = shared_ptr<const KdTree<PointT, Tree> >;
89 KdTree (
bool sorted =
true);
105 return (
tree_->getPointRepresentation ());
124 return (
tree_->getEpsilon ());
146 std::vector<float> &k_sqr_distances)
const override;
161 std::vector<float> &k_sqr_distances,
162 unsigned int max_nn = 0)
const override;
170 #ifdef PCL_NO_PRECOMPILE
171 #include <pcl/search/impl/kdtree.hpp>
173 #define PCL_INSTANTIATE_KdTree(T) template class PCL_EXPORTS pcl::search::KdTree<T>;
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< const PointRepresentation< PointT > > ConstPtr
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
typename Tree::ConstPtr KdTreeConstPtr
int nearestKSearch(const PointT &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override
Search for the k-nearest neighbors for the given query point.
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
PointRepresentationConstPtr getPointRepresentation() const
Get a pointer to the point representation used when converting points into k-D vectors.
shared_ptr< KdTree< PointT, Tree > > Ptr
float getEpsilon() const
Get the search epsilon precision (error bound) for nearest neighbors searches.
shared_ptr< const KdTree< PointT, Tree > > ConstPtr
void setSortedResults(bool sorted_results) override
Sets whether the results have to be sorted or not.
~KdTree() override=default
Destructor for KdTree.
typename Search< PointT >::PointCloudConstPtr PointCloudConstPtr
typename PointRepresentation< PointT >::ConstPtr PointRepresentationConstPtr
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a pointer to the point representation to use to convert points into k-D vectors.
bool setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset.
KdTree(bool sorted=true)
Constructor for KdTree.
typename Tree::Ptr KdTreePtr
int radiusSearch(const PointT &point, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
Search for all the nearest neighbors of the query point in a given radius.
KdTreePtr tree_
A pointer to the internal KdTree object.
typename Search< PointT >::PointCloud PointCloud
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< const Indices > IndicesConstPtr
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.