SearchTreeFlann.hpp
Go to the documentation of this file.
1 
28 /*
29  * SearchTreeFlann.hpp
30  *
31  * Created on: Sep 22, 2015
32  * Author: Thomas Wiemann
33  */
34 
35 #ifndef LVR2_RECONSTRUCTION_SEARCHTREEFLANN_HPP_
36 #define LVR2_RECONSTRUCTION_SEARCHTREEFLANN_HPP_
37 
38 #include <vector>
39 #include <memory>
40 
41 #include <flann/flann.hpp>
42 
43 #include "lvr2/io/Timestamp.hpp"
44 #include "lvr2/io/PointBuffer.hpp"
46 
47 using std::vector;
48 using std::unique_ptr;
49 
50 namespace lvr2
51 {
52 
59 template<typename BaseVecT>
60 class SearchTreeFlann : public SearchTree<BaseVecT>
61 {
62 private:
63  using CoordT = typename BaseVecT::CoordType;
64 
65 public:
66 
73 
75  virtual int kSearch(
76  const BaseVecT& qp,
77  int k,
78  vector<size_t>& indices,
79  vector<CoordT>& distances
80  ) const override;
81 
83  virtual void radiusSearch(
84  const BaseVecT& qp,
85  CoordT r,
86  vector<size_t>& indices
87  ) const override;
88 
89  void kSearchMany(
90  const BaseVecT* query,
91  int n,
92  int k,
93  size_t* indices,
94  CoordT* distances
95  ) const;
96 
97 protected:
98 
100  unique_ptr<flann::Index<flann::L2_Simple<CoordT>>> m_tree;
101 
102  boost::shared_array<CoordT> m_data;
103 };
104 
105 } // namespace lvr2
106 
107 #include "lvr2/reconstruction/SearchTreeFlann.tcc"
108 
109 #endif /* LVR2_RECONSTRUCTION_SEARCHTREEFLANN_HPP_ */
SearchTreeFlann(PointBufferPtr buffer)
Takes the point-data and initializes the underlying searchtree.
boost::shared_array< CoordT > m_data
typename BaseVecT::CoordType CoordT
Definition: SearchTree.hpp:53
std::shared_ptr< PointBuffer > PointBufferPtr
SearchClass for point data.
virtual int kSearch(const BaseVecT &qp, int k, vector< size_t > &indices, vector< CoordT > &distances) const override
See interface documentation.
virtual void radiusSearch(const BaseVecT &qp, CoordT r, vector< size_t > &indices) const override
See interface documentation.
void kSearchMany(const BaseVecT *query, int n, int k, size_t *indices, CoordT *distances) const
Abstract interface for storing and searching through a set of points. Query functions for nearest nei...
Definition: SearchTree.hpp:50
unique_ptr< flann::Index< flann::L2_Simple< CoordT > > > m_tree
The FLANN search tree structure.


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09