16 #ifndef dealii_numerics_rtree_h 17 #define dealii_numerics_rtree_h 28 #include <boost/geometry/index/rtree.hpp> 29 #include <boost/geometry/strategies/strategies.hpp> 132 template <
typename LeafType,
133 typename IndexType = boost::geometry::index::linear<16>>
134 using RTree = boost::geometry::index::rtree<LeafType, IndexType>;
146 template <
typename IndexType = boost::geometry::index::linear<16>,
147 typename LeafTypeIterator>
163 template <
typename IndexType = boost::geometry::index::linear<16>,
164 typename ContainerType>
182 template <
typename Value,
188 :
public boost::geometry::index::detail::rtree::visitor<
190 typename Options::parameters_type,
193 typename Options::node_tag,
209 typename boost::geometry::index::detail::rtree::internal_node<
211 typename Options::parameters_type,
214 typename Options::node_tag>::type;
219 using Leaf =
typename boost::geometry::index::detail::rtree::leaf<
221 typename Options::parameters_type,
224 typename Options::node_tag>::type;
313 template <
typename Rtree>
322 template <
typename IndexType,
typename LeafTypeIterator>
331 template <
typename IndexType,
typename ContainerType>
335 return pack_rtree<IndexType>(container.begin(), container.end());
340 template <
typename Value,
350 : translator(translator)
352 , target_level(target_level)
358 template <
typename Value,
368 typename boost::geometry::index::detail::rtree::elements_type<
371 const auto &elements = boost::geometry::index::detail::rtree::elements(node);
375 const auto offset =
boxes.size();
376 boxes.resize(offset + elements.size());
378 unsigned int i = offset;
379 for (
typename ElmentsType::const_iterator it = elements.begin();
380 it != elements.end();
383 boost::geometry::convert(it->first,
boxes[i]);
389 const size_t level_backup =
level;
392 for (
typename ElmentsType::const_iterator it = elements.begin();
393 it != elements.end();
396 boost::geometry::index::detail::rtree::apply_visitor(*
this, *it->second);
399 level = level_backup;
402 template <
typename Value,
414 template <
typename Rtree>
419 constexpr
unsigned int dim =
423 boost::geometry::index::detail::rtree::utilities::view<Rtree>;
426 std::vector<BoundingBox<dim>>
boxes;
428 if (rtv.depth() == 0)
434 boost::geometry::convert(tree.bounds(), boxes[0]);
442 typename RtreeView::options_type,
443 typename RtreeView::translator_type,
444 typename RtreeView::box_type,
445 typename RtreeView::allocators_type>
447 rtv.apply_visitor(extract_level_visitor);
455 template <
class Rtree>
457 n_levels(
const Rtree &tree)
459 boost::geometry::index::detail::rtree::utilities::view<Rtree> rtv(tree);
std::vector< BoundingBox< boost::geometry::dimension< typename Rtree::indexable_type >::value > > extract_rtree_level(const Rtree &tree, const unsigned int level)
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
template unsigned int min< unsigned int >(const unsigned int &, const MPI_Comm &)
boost::geometry::index::rtree< LeafType, IndexType > RTree
#define DEAL_II_NAMESPACE_CLOSE
VectorType::value_type * end(VectorType &V)
RTree< typename LeafTypeIterator::value_type, IndexType > pack_rtree(const LeafTypeIterator &begin, const LeafTypeIterator &end)
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_OPEN
VectorType::value_type * begin(VectorType &V)