]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/strategies/segment_intersection.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / geometry / test / strategies / segment_intersection.cpp
index daf6e13ea7172e4a9567d3b6393e9b13842dc25f..5bccc1d4368bdf2ea1fd9b4f8e8b67836dcc445a 100644 (file)
@@ -30,7 +30,7 @@
 #include <boost/geometry/policies/relate/tupled.hpp>
 
 #include <boost/geometry/algorithms/intersection.hpp>
-
+#include <boost/geometry/algorithms/detail/overlay/segment_as_subrange.hpp>
 
 #include <boost/geometry/geometries/point.hpp>
 #include <boost/geometry/geometries/segment.hpp>
@@ -60,6 +60,9 @@ static void test_segment_intersection(int caseid,
     segment_type s12(p1,p2);
     segment_type s34(p3,p4);
 
+    bg::detail::segment_as_subrange<segment_type> sr12(s12);
+    bg::detail::segment_as_subrange<segment_type> sr34(s34);
+
     std::size_t expected_count = 0;
 
     if (expected_x1 != -99 && expected_y1 != -99)
@@ -74,17 +77,12 @@ static void test_segment_intersection(int caseid,
     // Using intersection_insert
 
     std::vector<P> out;
-    bg::detail::intersection::intersection_insert<P>(s12, s34, std::back_inserter(out));
+    bg::detail::intersection::intersection_insert<P>(s12, s34,
+        std::back_inserter(out));
 
     // Using strategy
-    typedef bg::detail::no_rescale_policy rescale_policy_type;
-    rescale_policy_type rescale_policy;
-    typedef typename bg::segment_ratio_type<P, rescale_policy_type>::type ratio_type;
-    typedef bg::segment_intersection_points
-    <
-        P,
-        ratio_type
-    > result_type;
+    typedef bg::segment_intersection_points<P> result_type;
+
     typedef bg::policies::relate::segments_intersection_points
         <
             result_type
@@ -92,14 +90,13 @@ static void test_segment_intersection(int caseid,
 
     result_type is
         = bg::strategy::intersection::cartesian_segments<>
-            ::apply(s12, s34, points_policy_type(), rescale_policy, p1, p2, p3, p4);
+            ::apply(sr12, sr34, points_policy_type());
 
     bg::policies::relate::direction_type dir
         = bg::strategy::intersection::cartesian_segments<>
-            ::apply(s12, s34, bg::policies::relate::segments_direction(),
-                    rescale_policy, p1, p2, p3, p4);
+            ::apply(sr12, sr34, bg::policies::relate::segments_direction());
 
-    BOOST_CHECK_EQUAL(boost::size(out), expected_count);
+    //BOOST_CHECK_EQUAL(boost::size(out), expected_count);
     BOOST_CHECK_EQUAL(is.count, expected_count);
     BOOST_CHECK_MESSAGE(dir.how == expected_how,
             caseid