41 #ifndef PCL_KDTREE_KDTREE_FLANN_H_
42 #define PCL_KDTREE_KDTREE_FLANN_H_
44 #include <pcl/kdtree/kdtree.h>
51 template <
typename T>
class Index;
57 template <
typename T>
class PointRepresentation;
65 template <
typename Po
intT,
typename Dist = ::flann::L2_Simple<
float> >
86 typedef boost::shared_ptr<KdTreeFLANN<PointT> >
Ptr;
87 typedef boost::shared_ptr<const KdTreeFLANN<PointT> >
ConstPtr;
108 flann_index_ = k.flann_index_;
110 index_mapping_ = k.index_mapping_;
111 identity_mapping_ = k.identity_mapping_;
113 total_nr_points_ = k.total_nr_points_;
114 param_k_ = k.param_k_;
115 param_radius_ = k.param_radius_;
161 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const;
181 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const;
193 convertCloudToArray (
const PointCloud &cloud);
201 convertCloudToArray (
const PointCloud &cloud,
const std::vector<int> &indices);
206 getName ()
const {
return (
"KdTreeFLANN"); }
209 boost::shared_ptr<FLANNIndex> flann_index_;
215 std::vector<int> index_mapping_;
218 bool identity_mapping_;
224 int total_nr_points_;
227 boost::shared_ptr<flann::SearchParams> param_k_;
230 boost::shared_ptr<flann::SearchParams> param_radius_;
234 #ifdef PCL_NO_PRECOMPILE
235 #include <pcl/kdtree/impl/kdtree_flann.hpp>
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.
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for k-nearest neighbors for the given query point.
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
boost::shared_ptr< KdTree< FeatureT > > Ptr
void setSortedResults(bool sorted)
KdTreeFLANN(bool sorted=true)
Default Constructor for KdTreeFLANN.
virtual ~KdTreeFLANN()
Destructor for KdTreeFLANN.
boost::shared_ptr< std::vector< int > > IndicesPtr
KdTree< PointT >::PointCloud PointCloud
::flann::Index< Dist > FLANNIndex
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
KdTree< PointT >::PointCloudConstPtr PointCloudConstPtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
KdTree represents the base spatial locator class for kd-tree implementations.
KdTreeFLANN< PointT > & operator=(const KdTreeFLANN< PointT > &k)
Copy operator.
boost::shared_ptr< const PointCloud > PointCloudConstPtr
boost::shared_ptr< KdTreeFLANN< PointT > > Ptr
boost::shared_ptr< const KdTreeFLANN< PointT > > ConstPtr