40 #ifndef PCL_SEARCH_KDTREE_H_
41 #define PCL_SEARCH_KDTREE_H_
43 #include <pcl/search/search.h>
44 #include <pcl/kdtree/kdtree_flann.h>
49 template <
typename T>
class PointRepresentation;
61 template<
typename Po
intT,
class Tree = pcl::KdTreeFLANN<Po
intT> >
79 typedef boost::shared_ptr<KdTree<PointT, Tree> >
Ptr;
80 typedef boost::shared_ptr<const KdTree<PointT, Tree> >
ConstPtr;
93 KdTree (
bool sorted =
true);
108 inline PointRepresentationConstPtr
111 return (
tree_->getPointRepresentation ());
130 return (
tree_->getEpsilon ());
139 const IndicesConstPtr& indices = IndicesConstPtr ());
151 std::vector<int> &k_indices,
152 std::vector<float> &k_sqr_distances)
const;
166 std::vector<int> &k_indices,
167 std::vector<float> &k_sqr_distances,
168 unsigned int max_nn = 0)
const;
176 #ifdef PCL_NO_PRECOMPILE
177 #include <pcl/search/impl/kdtree.hpp>
179 #define PCL_INSTANTIATE_KdTree(T) template class PCL_EXPORTS pcl::search::KdTree<T>;
182 #endif // PCL_SEARCH_KDTREE_H_
float getEpsilon() const
Get the search epsilon precision (error bound) for nearest neighbors searches.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const Tree > KdTreeConstPtr
boost::shared_ptr< std::vector< int > > IndicesPtr
KdTree(bool sorted=true)
Constructor for KdTree.
This file defines compatibility wrappers for low level I/O functions.
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a pointer to the point representation to use to convert points into k-D vectors.
boost::shared_ptr< Tree > KdTreePtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
Search< PointT >::PointCloudConstPtr PointCloudConstPtr
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
boost::shared_ptr< const KdTree< PointT, Tree > > ConstPtr
virtual ~KdTree()
Destructor for KdTree.
PointRepresentationConstPtr getPointRepresentation() const
Get a pointer to the point representation used when converting points into k-D vectors.
boost::shared_ptr< KdTree< PointT, Tree > > Ptr
KdTreePtr tree_
A pointer to the internal KdTree object.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
int radiusSearch(const PointT &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
Search for all the nearest neighbors of the query point in a given radius.
void setSortedResults(bool sorted_results)
Sets whether the results have to be sorted or not.
A point structure representing Euclidean xyz coordinates, and the RGB color.
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for the k-nearest neighbors for the given query point.
boost::shared_ptr< const PointRepresentation< PointT > > PointRepresentationConstPtr
Search< PointT >::PointCloud PointCloud