diff options
Diffstat (limited to 'boost/geometry/index/detail/rtree/pack_create.hpp')
-rw-r--r-- | boost/geometry/index/detail/rtree/pack_create.hpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/boost/geometry/index/detail/rtree/pack_create.hpp b/boost/geometry/index/detail/rtree/pack_create.hpp index 78e4712d2f..f8565bfb3e 100644 --- a/boost/geometry/index/detail/rtree/pack_create.hpp +++ b/boost/geometry/index/detail/rtree/pack_create.hpp @@ -4,6 +4,10 @@ // // Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland. // +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +// // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -137,6 +141,7 @@ class pack typedef typename geometry::coordinate_type<point_type>::type coordinate_type; typedef typename detail::default_content_result<Box>::type content_type; typedef typename Options::parameters_type parameters_type; + typedef typename detail::strategy_type<parameters_type>::type strategy_type; static const std::size_t dimension = geometry::dimension<point_type>::value; typedef typename rtree::container_from_elements_type< @@ -165,7 +170,7 @@ public: values_count = static_cast<size_type>(diff); entries.reserve(values_count); - expandable_box<Box> hint_box; + expandable_box<Box, strategy_type> hint_box(detail::get_strategy(parameters)); for ( ; first != last ; ++first ) { // NOTE: support for iterators not returning true references adapted @@ -194,19 +199,19 @@ public: } private: - template <typename BoxType> + template <typename BoxType, typename Strategy> class expandable_box { public: - expandable_box() - : m_initialized(false) + explicit expandable_box(Strategy const& strategy) + : m_strategy(strategy), m_initialized(false) {} template <typename Indexable> - explicit expandable_box(Indexable const& indexable) - : m_initialized(true) + explicit expandable_box(Indexable const& indexable, Strategy const& strategy) + : m_strategy(strategy), m_initialized(true) { - detail::bounds(indexable, m_box); + detail::bounds(indexable, m_box, m_strategy); } template <typename Indexable> @@ -217,12 +222,12 @@ private: // it's guaranteed that the Box will be initialized // only for Points, Boxes and Segments but that's ok // since only those Geometries can be stored - detail::bounds(indexable, m_box); + detail::bounds(indexable, m_box, m_strategy); m_initialized = true; } else { - geometry::expand(m_box, indexable); + detail::expand(m_box, indexable, m_strategy); } } @@ -238,8 +243,9 @@ private: } private: - bool m_initialized; BoxType m_box; + Strategy m_strategy; + bool m_initialized; }; struct subtree_elements_counts @@ -273,7 +279,8 @@ private: // calculate values box and copy values // initialize the box explicitly to avoid GCC-4.4 uninitialized variable warnings with O2 - expandable_box<Box> elements_box(translator(*(first->second))); + expandable_box<Box, strategy_type> elements_box(translator(*(first->second)), + detail::get_strategy(parameters)); rtree::elements(l).push_back(*(first->second)); // MAY THROW (A?,C) for ( ++first ; first != last ; ++first ) { @@ -319,7 +326,7 @@ private: std::size_t nodes_count = calculate_nodes_count(values_count, subtree_counts); rtree::elements(in).reserve(nodes_count); // MAY THROW (A) // calculate values box and copy values - expandable_box<Box> elements_box; + expandable_box<Box, strategy_type> elements_box(detail::get_strategy(parameters)); per_level_packets(first, last, hint_box, values_count, subtree_counts, next_subtree_counts, rtree::elements(in), elements_box, |