]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / overlay / get_turn_info.cpp
index 6310e248ef8d43f376d23995ccef1a0caeb0bad6..3835f6f47615ca2a0e85122e28337f4c599ad614 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <geometry_test_common.hpp>
 
-
+#include <boost/array.hpp>
 #include <boost/foreach.hpp>
 
 #include <boost/geometry/algorithms/intersection.hpp>
 #endif
 
 
+// For test purposes, returns the point specified in the constructor
+template <typename Point>
+struct sub_range_from_points
+{
+    typedef Point point_type;
+
+    sub_range_from_points(Point const& i, Point const& j, Point const& k)
+    {
+        m_points[0] = i;
+        m_points[1] = j;
+        m_points[2] = k;
+    }
+
+    static inline bool is_first_segment() { return false; }
+    static inline bool is_last_segment() { return false; }
+
+    static inline std::size_t size() { return 3; }
+
+    inline Point const& at(std::size_t index) const
+    {
+        return m_points[index % 3];
+    }
+
+private :
+    boost::array<Point, 3> m_points;
+};
 
 template <typename P, typename T>
 void test_with_point(std::string const& caseid,
@@ -58,20 +84,19 @@ void test_with_point(std::string const& caseid,
     typedef bg::detail::overlay::turn_info
         <
             P,
-            typename bg::segment_ratio_type<P, rescale_policy_type>::type
+            typename bg::detail::segment_ratio_type<P, rescale_policy_type>::type
         > turn_info;
     typedef std::vector<turn_info> tp_vector;
     turn_info model;
     tp_vector info;
     strategy_type strategy;
     rescale_policy_type rescale_policy;
+    sub_range_from_points<P> sub_range_p(pi, pj, pk);
+    sub_range_from_points<P> sub_range_q(qi, qj, qk);
     bg::detail::overlay::get_turn_info
         <
             bg::detail::overlay::assign_null_policy
-        >::apply(pi, pj, pk, qi, qj, qk,
-                 false, false, false, false, // dummy parameters
-        model, strategy, rescale_policy, std::back_inserter(info));
-
+        >::apply(sub_range_p, sub_range_q, model, strategy, rescale_policy, std::back_inserter(info));
 
     if (info.size() == 0)
     {