]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / disjoint / linear_areal.hpp
index a56f56e6216a873038be7598b402372fe7bc4cbc..53eec91a7aa74e01781c0a0482650f8a71bc7c31 100644 (file)
@@ -5,11 +5,12 @@
 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
 // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
 
-// This file was modified by Oracle on 2013-2020.
-// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2013-2021.
+// Modifications copyright (c) 2013-2021, Oracle and/or its affiliates.
 
-// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
+// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -40,7 +41,6 @@
 #include <boost/geometry/algorithms/not_implemented.hpp>
 
 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
-#include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
 #include <boost/geometry/algorithms/detail/point_on_border.hpp>
 
 #include <boost/geometry/algorithms/detail/disjoint/linear_linear.hpp>
@@ -74,7 +74,7 @@ struct disjoint_no_intersections_policy
         point1_type p;
         geometry::point_on_border(p, g1);
 
-        return !geometry::covered_by(p, g2, strategy);
+        return ! geometry::covered_by(p, g2, strategy);
     }
 };
 
@@ -120,9 +120,7 @@ struct disjoint_linear_areal
             return false;
         }
 
-        return NoIntersectionsPolicy
-                ::apply(g1, g2,
-                        strategy.template get_point_in_geometry_strategy<Geometry1, Geometry2>());
+        return NoIntersectionsPolicy::apply(g1, g2, strategy);
     }
 };
 
@@ -143,31 +141,25 @@ struct disjoint_segment_areal
 template <typename Segment, typename Polygon>
 class disjoint_segment_areal<Segment, Polygon, polygon_tag>
 {
-private:
+    
     template <typename InteriorRings, typename Strategy>
     static inline
     bool check_interior_rings(InteriorRings const& interior_rings,
                               Segment const& segment,
                               Strategy const& strategy)
     {
-        typedef typename boost::range_value<InteriorRings>::type ring_type;
+        using ring_type = typename boost::range_value<InteriorRings>::type;
 
-        typedef unary_disjoint_geometry_to_query_geometry
+        using unary_predicate_type = unary_disjoint_geometry_to_query_geometry
             <
                 Segment,
                 Strategy,
-                disjoint_range_segment_or_box
-                    <
-                        ring_type, closure<ring_type>::value, Segment
-                    >
-            > unary_predicate_type;
-                
-        return check_iterator_range
-            <
-                unary_predicate_type
-            >::apply(boost::begin(interior_rings),
-                     boost::end(interior_rings),
-                     unary_predicate_type(segment, strategy));
+                disjoint_range_segment_or_box<ring_type, Segment>
+            >;
+
+        return std::all_of(boost::begin(interior_rings),
+                           boost::end(interior_rings),
+                           unary_predicate_type(segment, strategy));
     }
 
 
@@ -177,17 +169,16 @@ public:
                              Polygon const& polygon,
                              IntersectionStrategy const& strategy)
     {
-        typedef typename geometry::ring_type<Polygon>::type ring;
-
-        if ( !disjoint_range_segment_or_box
-                 <
-                     ring, closure<Polygon>::value, Segment
-                 >::apply(geometry::exterior_ring(polygon), segment, strategy) )
+        if (! disjoint_range_segment_or_box
+                <
+                    typename geometry::ring_type<Polygon>::type,
+                    Segment
+                >::apply(geometry::exterior_ring(polygon), segment, strategy))
         {
             return false;
         }
 
-        if ( !check_interior_rings(geometry::interior_rings(polygon), segment, strategy) )
+        if (! check_interior_rings(geometry::interior_rings(polygon), segment, strategy))
         {
             return false;
         }
@@ -195,8 +186,7 @@ public:
         typename point_type<Segment>::type p;
         detail::assign_point_from_index<0>(segment, p);
 
-        return !geometry::covered_by(p, polygon,
-                    strategy.template get_point_in_geometry_strategy<Segment, Polygon>());
+        return ! geometry::covered_by(p, polygon, strategy);
     }
 };
 
@@ -224,10 +214,7 @@ struct disjoint_segment_areal<Segment, Ring, ring_tag>
                              Ring const& ring,
                              IntersectionStrategy const& strategy)
     {
-        if ( !disjoint_range_segment_or_box
-                 <
-                     Ring, closure<Ring>::value, Segment
-                 >::apply(ring, segment, strategy) )
+        if (! disjoint_range_segment_or_box<Ring, Segment>::apply(ring, segment, strategy))
         {
             return false;
         }
@@ -235,8 +222,7 @@ struct disjoint_segment_areal<Segment, Ring, ring_tag>
         typename point_type<Segment>::type p;
         detail::assign_point_from_index<0>(segment, p);
 
-        return !geometry::covered_by(p, ring,
-                    strategy.template get_point_in_geometry_strategy<Segment, Ring>());
+        return ! geometry::covered_by(p, ring, strategy);
     }
 };