File indexing completed on 2025-01-18 09:35:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP
0017 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP
0018
0019 #include <boost/geometry/index/detail/rtree/node/node.hpp>
0020 #include <boost/geometry/index/detail/rtree/node/node_elements.hpp>
0021
0022 namespace boost { namespace geometry { namespace index {
0023
0024 namespace detail { namespace rtree { namespace visitors {
0025
0026 template <typename MembersHolder>
0027 class children_box
0028 : public MembersHolder::visitor_const
0029 {
0030 typedef typename MembersHolder::parameters_type parameters_type;
0031 typedef typename MembersHolder::translator_type translator_type;
0032 typedef typename MembersHolder::box_type box_type;
0033
0034 typedef typename MembersHolder::internal_node internal_node;
0035 typedef typename MembersHolder::leaf leaf;
0036
0037 public:
0038 inline children_box(box_type & result,
0039 parameters_type const& parameters,
0040 translator_type const& tr)
0041 : m_result(result), m_parameters(parameters), m_tr(tr)
0042 {}
0043
0044 inline void operator()(internal_node const& n)
0045 {
0046 typedef typename rtree::elements_type<internal_node>::type elements_type;
0047 elements_type const& elements = rtree::elements(n);
0048
0049 m_result = rtree::elements_box<box_type>(elements.begin(), elements.end(), m_tr,
0050 index::detail::get_strategy(m_parameters));
0051 }
0052
0053 inline void operator()(leaf const& n)
0054 {
0055 typedef typename rtree::elements_type<leaf>::type elements_type;
0056 elements_type const& elements = rtree::elements(n);
0057
0058 m_result = rtree::values_box<box_type>(elements.begin(), elements.end(), m_tr,
0059 index::detail::get_strategy(m_parameters));
0060 }
0061
0062 private:
0063 box_type & m_result;
0064 parameters_type const& m_parameters;
0065 translator_type const& m_tr;
0066 };
0067
0068 }}}
0069
0070 }}}
0071
0072 #endif