]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/strategies/segment_intersection_collinear.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / geometry / test / strategies / segment_intersection_collinear.cpp
index c681864814a68b23305bbaa957db3ff26bde1381..287888f9256b38242017eb1f111f91d5861f0b2d 100644 (file)
@@ -29,7 +29,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>
@@ -62,7 +62,7 @@ static void test_segment_intersection(std::string const& case_id,
                 int expected_x2 = -99, int expected_y2 = -99)
 
 {
-    boost::ignore_unused_variable_warning(case_id);
+    boost::ignore_unused(case_id);
 
     typedef bg::model::referring_segment<const P> segment_type;
 
@@ -72,21 +72,13 @@ static void test_segment_intersection(std::string const& case_id,
     bg::assign_values(p3, x3, y3);
     bg::assign_values(p4, x4, y4);
 
-    segment_type s12(p1,p2);
-    segment_type s34(p3,p4);
+    segment_type s12(p1, p2);
+    segment_type s34(p3, p4);
 
-    typedef bg::detail::no_rescale_policy rescale_policy_type;
-    rescale_policy_type rescale_policy;
+    bg::detail::segment_as_subrange<segment_type> sr12(s12);
+    bg::detail::segment_as_subrange<segment_type> sr34(s34);
 
-    typedef bg::segment_intersection_points
-    <
-        P,
-        typename bg::segment_ratio_type
-        <
-            P,
-            rescale_policy_type
-        >::type
-    > result_type;
+    typedef bg::segment_intersection_points<P> result_type;
 
     typedef bg::policies::relate::segments_intersection_points
         <
@@ -96,13 +88,12 @@ static void test_segment_intersection(std::string const& case_id,
     // Get the intersection point (or two points)
     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());
 
     // Get just a character for Left/Right/intersects/etc, purpose is more for debugging
     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());
 
     std::size_t expected_count =
         check(is, 0, expected_x1, expected_y1)
@@ -125,7 +116,7 @@ static void test_segment_ratio(std::string const& case_id,
                 std::size_t expected_count = 2)
 
 {
-    boost::ignore_unused_variable_warning(case_id);
+    boost::ignore_unused(case_id);
 
     typedef bg::model::referring_segment<const P> segment_type;
 
@@ -138,15 +129,10 @@ static void test_segment_ratio(std::string const& case_id,
     segment_type s12(p1, p2);
     segment_type s34(p3, p4);
 
-    typedef bg::detail::no_rescale_policy rescale_policy_type;
-    rescale_policy_type rescale_policy;
+    bg::detail::segment_as_subrange<segment_type> sr12(s12);
+    bg::detail::segment_as_subrange<segment_type> sr34(s34);
 
-    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
         <
@@ -156,7 +142,9 @@ static void test_segment_ratio(std::string const& case_id,
     // Get the intersection point (or two points)
     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());
+
+    typedef bg::segment_ratio<typename bg::coordinate_type<P>::type> ratio_type;
 
     ratio_type expected_a1(expected_pair_a1.first, expected_pair_a1.second);
     ratio_type expected_a2(expected_pair_a2.first, expected_pair_a2.second);