Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:31

0001 // Boost.Geometry Index
0002 //
0003 // R-tree node children box calculating visitor implementation
0004 //
0005 // Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
0006 //
0007 // This file was modified by Oracle on 2019-2023.
0008 // Modifications copyright (c) 2019-2023 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 //
0012 // Use, modification and distribution is subject to the Boost Software License,
0013 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0014 // http://www.boost.org/LICENSE_1_0.txt)
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 }}} // namespace detail::rtree::visitors
0069 
0070 }}} // namespace boost::geometry::index
0071 
0072 #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP