]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/sym_difference.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / sym_difference.hpp
index 4d8550bcb13546206c33683cbe70d288955181b1..6d9992de7c3b67c60acfffed53314f2a67597f48 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
 
-// This file was modified by Oracle on 2015, 2017, 2019, 2020.
-// Modifications copyright (c) 2015-2020 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2015-2021.
+// Modifications copyright (c) 2015-2021 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 #include <boost/geometry/geometries/multi_polygon.hpp>
 #include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
 #include <boost/geometry/strategies/default_strategy.hpp>
-#include <boost/geometry/strategies/relate.hpp>
+#include <boost/geometry/strategies/detail.hpp>
+#include <boost/geometry/strategies/relate/cartesian.hpp>
+#include <boost/geometry/strategies/relate/geographic.hpp>
+#include <boost/geometry/strategies/relate/spherical.hpp>
 #include <boost/geometry/util/range.hpp>
 
 
@@ -497,9 +500,9 @@ template
 inline OutputIterator sym_difference_insert(Geometry1 const& geometry1,
             Geometry2 const& geometry2, OutputIterator out)
 {
-    typedef typename strategy::intersection::services::default_strategy
+    typedef typename strategies::relate::services::default_strategy
         <
-            typename cs_tag<GeometryOut>::type
+            Geometry1, Geometry2
         >::type strategy_type;
 
     return sym_difference_insert<GeometryOut>(geometry1, geometry2, out, strategy_type());
@@ -511,15 +514,14 @@ inline OutputIterator sym_difference_insert(Geometry1 const& geometry1,
 
 namespace resolve_strategy {
 
+template
+<
+    typename Strategy,
+    bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
+>
 struct sym_difference
 {
-    template
-    <
-        typename Geometry1,
-        typename Geometry2,
-        typename Collection,
-        typename Strategy
-    >
+    template <typename Geometry1, typename Geometry2, typename Collection>
     static inline void apply(Geometry1 const& geometry1,
                              Geometry2 const& geometry2,
                              Collection & output_collection,
@@ -535,24 +537,45 @@ struct sym_difference
             geometry::detail::output_geometry_back_inserter(output_collection),
             strategy);
     }
+};
 
-    template
-    <
-        typename Geometry1,
-        typename Geometry2,
-        typename Collection
-    >
+template <typename Strategy>
+struct sym_difference<Strategy, false>
+{
+    template <typename Geometry1, typename Geometry2, typename Collection>
+    static inline void apply(Geometry1 const& geometry1,
+                             Geometry2 const& geometry2,
+                             Collection & output_collection,
+                             Strategy const& strategy)
+    {
+        using strategies::relate::services::strategy_converter;
+
+        sym_difference
+            <
+                decltype(strategy_converter<Strategy>::get(strategy))
+            >::apply(geometry1, geometry2, output_collection,
+                     strategy_converter<Strategy>::get(strategy));
+    }
+};
+
+template <>
+struct sym_difference<default_strategy, false>
+{
+    template <typename Geometry1, typename Geometry2, typename Collection>
     static inline void apply(Geometry1 const& geometry1,
                              Geometry2 const& geometry2,
                              Collection & output_collection,
                              default_strategy)
     {
-        typedef typename strategy::relate::services::default_strategy
+        typedef typename strategies::relate::services::default_strategy
             <
                 Geometry1, Geometry2
             >::type strategy_type;
 
-        apply(geometry1, geometry2, output_collection, strategy_type());
+        sym_difference
+            <
+                strategy_type
+            >::apply(geometry1, geometry2, output_collection, strategy_type());
     }
 };
 
@@ -571,9 +594,10 @@ struct sym_difference
                              Collection& output_collection,
                              Strategy const& strategy)
     {
-        resolve_strategy::sym_difference::apply(geometry1, geometry2,
-                                                output_collection,
-                                                strategy);
+        resolve_strategy::sym_difference
+            <
+                Strategy
+            >::apply(geometry1, geometry2, output_collection, strategy);
     }
 };