]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / buffer / turn_in_original_visitor.hpp
index d51220dac84a348d2d08aef8ea7130c0fbea38d9..b1930dc0c4e4f65e307cd2c5ed4515383de06021 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
 
-// This file was modified by Oracle on 2016, 2018.
-// Modifications copyright (c) 2016-2018 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2016-2020.
+// Modifications copyright (c) 2016-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,
@@ -31,31 +31,40 @@ namespace boost { namespace geometry
 namespace detail { namespace buffer
 {
 
+
+template <typename Strategy>    
 struct original_get_box
 {
+    explicit original_get_box(Strategy const& strategy)
+        : m_strategy(strategy)
+    {}
+
     template <typename Box, typename Original>
-    static inline void apply(Box& total, Original const& original)
+    inline void apply(Box& total, Original const& original) const
     {
         assert_coordinate_type_equal(total, original.m_box);
-        typedef typename strategy::expand::services::default_strategy
-            <
-                box_tag, typename cs_tag<Box>::type
-            >::type expand_strategy_type;
-
-        geometry::expand(total, original.m_box, expand_strategy_type());
+        geometry::expand(total, original.m_box, m_strategy);
     }
+
+    Strategy const& m_strategy;
 };
 
-template <typename DisjointBoxBoxStrategy>
+template <typename Strategy>
 struct original_overlaps_box
 {
+    explicit original_overlaps_box(Strategy const& strategy)
+        : m_strategy(strategy)
+    {}
+
     template <typename Box, typename Original>
-    static inline bool apply(Box const& box, Original const& original)
+    inline bool apply(Box const& box, Original const& original) const
     {
         assert_coordinate_type_equal(box, original.m_box);
         return ! detail::disjoint::disjoint_box_box(box, original.m_box,
-                                                    DisjointBoxBoxStrategy());
+                                                    m_strategy);
     }
+
+    Strategy const& m_strategy;
 };
 
 struct include_turn_policy
@@ -67,11 +76,15 @@ struct include_turn_policy
     }
 };
 
-template <typename DisjointPointBoxStrategy>
+template <typename Strategy>
 struct turn_in_original_overlaps_box
 {
+    explicit turn_in_original_overlaps_box(Strategy const& strategy)
+        : m_strategy(strategy)
+    {}
+
     template <typename Box, typename Turn>
-    static inline bool apply(Box const& box, Turn const& turn)
+    inline bool apply(Box const& box, Turn const& turn) const
     {
         if (! turn.is_turn_traversable || turn.within_original)
         {
@@ -80,8 +93,10 @@ struct turn_in_original_overlaps_box
         }
 
         return ! geometry::detail::disjoint::disjoint_point_box(
-                    turn.point, box, DisjointPointBoxStrategy());
+                    turn.point, box, m_strategy);
     }
+
+    Strategy const& m_strategy;
 };
 
 //! Check if specified is in range of specified iterators
@@ -210,13 +225,13 @@ inline int point_in_original(Point const& point, Original const& original,
 }
 
 
-template <typename Turns, typename PointInGeometryStrategy>
+template <typename Turns, typename Strategy>
 class turn_in_original_visitor
 {
 public:
-    turn_in_original_visitor(Turns& turns, PointInGeometryStrategy const& strategy)
+    turn_in_original_visitor(Turns& turns, Strategy const& strategy)
         : m_mutable_turns(turns)
-        , m_point_in_geometry_strategy(strategy)
+        , m_strategy(strategy)
     {}
 
     template <typename Turn, typename Original>
@@ -234,13 +249,14 @@ public:
             return true;
         }
 
-        if (geometry::disjoint(turn.point, original.m_box))
+        if (geometry::disjoint(turn.point, original.m_box, m_strategy))
         {
             // Skip all disjoint
             return true;
         }
 
-        int const code = point_in_original(turn.point, original, m_point_in_geometry_strategy);
+        int const code = point_in_original(turn.point, original,
+                                           m_strategy.relate(turn.point, original.m_ring));
 
         if (code == -1)
         {
@@ -277,7 +293,7 @@ public:
 
 private :
     Turns& m_mutable_turns;
-    PointInGeometryStrategy const& m_point_in_geometry_strategy;
+    Strategy const& m_strategy;
 };