]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/detail/within/multi_point.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / within / multi_point.hpp
index 319a782f3a7209716f10580db244451a34566efd..349ef0302626fa14da8181ea97e4bdae8c153fff 100644 (file)
@@ -1,7 +1,6 @@
 // Boost.Geometry
 
 // Copyright (c) 2017-2020, 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,
@@ -54,10 +53,12 @@ struct multi_point_point
                              Point const& point,
                              Strategy const& strategy)
     {
+        auto const s = strategy.relate(multi_point, point);
+
         typedef typename boost::range_const_iterator<MultiPoint>::type iterator;
         for ( iterator it = boost::begin(multi_point) ; it != boost::end(multi_point) ; ++it )
         {
-            if (! strategy.apply(*it, point))
+            if (! s.apply(*it, point))
             {
                 return false;
             }
@@ -126,11 +127,9 @@ struct multi_point_single_geometry
 
         // Create envelope of geometry
         box2_type box;
-        geometry::envelope(linear_or_areal, box, strategy.get_envelope_strategy());
+        geometry::envelope(linear_or_areal, box, strategy);
         geometry::detail::expand_by_epsilon(box);
 
-        typedef typename Strategy::disjoint_point_box_strategy_type point_in_box_type;
-
         // Test each Point with envelope and then geometry if needed
         // If in the exterior, break
         bool result = false;
@@ -138,8 +137,10 @@ struct multi_point_single_geometry
         typedef typename boost::range_const_iterator<MultiPoint>::type iterator;
         for ( iterator it = boost::begin(multi_point) ; it != boost::end(multi_point) ; ++it )
         {
-            int in_val = 0;
+            typedef decltype(strategy.covered_by(*it, box)) point_in_box_type;
 
+            int in_val = 0;
+            
             // exterior of box and of geometry
             if (! point_in_box_type::apply(*it, box)
                 || (in_val = point_in_geometry(*it, linear_or_areal, strategy)) < 0)
@@ -173,9 +174,6 @@ struct multi_point_multi_geometry
         typedef model::box<point2_type> box2_type;
         static const bool is_linear = util::is_linear<LinearOrAreal>::value;
 
-        typename Strategy::envelope_strategy_type const
-            envelope_strategy = strategy.get_envelope_strategy();
-
         // TODO: box pairs could be constructed on the fly, inside the rtree
 
         // Prepare range of envelopes and ids
@@ -185,23 +183,16 @@ struct multi_point_multi_geometry
         box_pair_vector boxes(count2);
         for (std::size_t i = 0 ; i < count2 ; ++i)
         {
-            geometry::envelope(linear_or_areal, boxes[i].first, envelope_strategy);
+            geometry::envelope(linear_or_areal, boxes[i].first, strategy);
             geometry::detail::expand_by_epsilon(boxes[i].first);
             boxes[i].second = i;
         }
 
         // Create R-tree
-        typedef strategy::index::services::from_strategy
-            <
-                Strategy
-            > index_strategy_from;
-        typedef index::parameters
-            <
-                index::rstar<4>, typename index_strategy_from::type
-            > index_parameters_type;
+        typedef index::parameters<index::rstar<4>, Strategy> index_parameters_type;
         index::rtree<box_pair_type, index_parameters_type>
             rtree(boxes.begin(), boxes.end(),
-                  index_parameters_type(index::rstar<4>(), index_strategy_from::get(strategy)));
+                  index_parameters_type(index::rstar<4>(), strategy));
 
         // For each point find overlapping envelopes and test corresponding single geometries
         // If a point is in the exterior break