41 #ifndef DTK_STATICSEARCHTREE_HPP 42 #define DTK_STATICSEARCHTREE_HPP 44 #include <Teuchos_Array.hpp> 45 #include <Teuchos_ArrayView.hpp> 46 #include <Teuchos_RCP.hpp> 48 #include <DTK_nanoflann.hpp> 55 class StaticSearchTree
59 StaticSearchTree() { }
62 virtual ~StaticSearchTree() { }
65 virtual Teuchos::Array<unsigned>
66 nnSearch(
const Teuchos::ArrayView<const double> &point,
67 const unsigned num_neighbors )
const = 0;
70 virtual Teuchos::Array<unsigned>
71 radiusSearch(
const Teuchos::ArrayView<const double> &point,
72 const double radius )
const = 0;
86 PointCloud(
const Teuchos::ArrayView<const double> &points )
95 inline std::size_t kdtree_get_point_count()
const 97 return d_points.size() / DIM;
101 double kdtree_distance(
const double *p1,
const std::size_t idx_p2,
102 std::size_t size )
const;
105 double kdtree_get_pt(
const std::size_t idx,
int dim )
const;
108 template <
class BBOX>
109 bool kdtree_get_bbox( BBOX & )
const 116 Teuchos::ArrayView<const double> d_points;
137 NanoflannTree(
const Teuchos::ArrayView<const double> &points,
138 const unsigned max_leaf_size );
144 Teuchos::Array<unsigned>
145 nnSearch(
const Teuchos::ArrayView<const double> &point,
146 const unsigned num_neighbors )
const;
149 Teuchos::Array<unsigned>
150 radiusSearch(
const Teuchos::ArrayView<const double> &point,
151 const double radius )
const;
155 PointCloud<DIM> d_cloud;
158 Teuchos::RCP<TreeType> d_tree;
173 #endif // end DTK_STATICSEARCHTREE_HPP
Spatial searching for point clouds.
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloud< DIM > >, PointCloud< DIM >, DIM, unsigned > TreeType
Tree typedef.
Spatial searching for point clouds.