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);
107 return (
tree_->getPointRepresentation ());
126 return (
tree_->getEpsilon ());
148 std::vector<float> &k_sqr_distances)
const override;
163 std::vector<float> &k_sqr_distances,
164 unsigned int max_nn = 0)
const override;
172 #ifdef PCL_NO_PRECOMPILE 173 #include <pcl/search/impl/kdtree.hpp> 175 #define PCL_INSTANTIATE_KdTree(T) template class PCL_EXPORTS pcl::search::KdTree<T>; shared_ptr< KdTree< SceneT, pcl::KdTreeFLANN< SceneT > > > Ptr
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
KdTree(bool sorted=true)
Constructor for KdTree.
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.
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a pointer to the point representation to use to convert points into k-D vectors.
void setSortedResults(bool sorted_results) override
Sets whether the results have to be sorted or not.
typename PointRepresentation< SceneT >::ConstPtr PointRepresentationConstPtr
PointRepresentationConstPtr getPointRepresentation() const
Get a pointer to the point representation used when converting points into k-D vectors.
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
typename Search< SceneT >::PointCloud PointCloud
shared_ptr< const Indices > IndicesConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset.
shared_ptr< const PointRepresentation< PointT > > ConstPtr
KdTreePtr tree_
A pointer to the internal KdTree object.
IndicesAllocator<> Indices
Type used for indices in PCL.
typename pcl::KdTreeFLANN< SceneT > ::Ptr KdTreePtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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.
shared_ptr< const KdTree< SceneT, pcl::KdTreeFLANN< SceneT > > > ConstPtr
typename pcl::KdTreeFLANN< SceneT > ::ConstPtr KdTreeConstPtr
float getEpsilon() const
Get the search epsilon precision (error bound) for nearest neighbors searches.
A point structure representing Euclidean xyz coordinates, and the RGB color.
typename PointCloud::ConstPtr PointCloudConstPtr
~KdTree()
Destructor for KdTree.