diff DEPENDENCIES/generic/include/boost/geometry/policies/relate/tupled.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/geometry/policies/relate/tupled.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/geometry/policies/relate/tupled.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -14,8 +14,6 @@
 
 #include <boost/tuple/tuple.hpp>
 #include <boost/geometry/strategies/side_info.hpp>
-#include <boost/geometry/util/select_calculation_type.hpp>
-#include <boost/geometry/util/select_most_precise.hpp>
 
 namespace boost { namespace geometry
 {
@@ -26,7 +24,7 @@
 
 // "tupled" to return intersection results together.
 // Now with two, with some meta-programming and derivations it can also be three (or more)
-template <typename Policy1, typename Policy2, typename CalculationType = void>
+template <typename Policy1, typename Policy2>
 struct segments_tupled
 {
     typedef boost::tuple
@@ -35,101 +33,41 @@
             typename Policy2::return_type
         > return_type;
 
-    // Take segments of first policy, they should be equal
-    typedef typename Policy1::segment_type1 segment_type1;
-    typedef typename Policy1::segment_type2 segment_type2;
-
-    typedef typename select_calculation_type
-        <
-            segment_type1,
-            segment_type2,
-            CalculationType
-        >::type coordinate_type;
-
-    // Get the same type, but at least a double
-    typedef typename select_most_precise<coordinate_type, double>::type rtype;
-
-    template <typename R>
-    static inline return_type segments_intersect(side_info const& sides,
-                    R const& r,
-                    coordinate_type const& dx1, coordinate_type const& dy1,
-                    coordinate_type const& dx2, coordinate_type const& dy2,
-                    segment_type1 const& s1, segment_type2 const& s2)
+    template <typename Segment1, typename Segment2, typename SegmentIntersectionInfo>
+    static inline return_type segments_crosses(side_info const& sides,
+                    SegmentIntersectionInfo const& sinfo,
+                    Segment1 const& s1, Segment2 const& s2)
     {
         return boost::make_tuple
             (
-                Policy1::segments_intersect(sides, r,
-                    dx1, dy1, dx2, dy2, s1, s2),
-                Policy2::segments_intersect(sides, r,
-                    dx1, dy1, dx2, dy2, s1, s2)
+                Policy1::segments_crosses(sides, sinfo, s1, s2),
+                Policy2::segments_crosses(sides, sinfo, s1, s2)
             );
     }
 
-    static inline return_type collinear_touch(coordinate_type const& x,
-                coordinate_type const& y, int arrival_a, int arrival_b)
+    template <typename Segment1, typename Segment2, typename Ratio>
+    static inline return_type segments_collinear(
+                    Segment1 const& segment1, Segment2 const& segment2,
+                    bool opposite,
+                    int pa1, int pa2, int pb1, int pb2,
+                    Ratio const& ra1, Ratio const& ra2,
+                    Ratio const& rb1, Ratio const& rb2)
     {
         return boost::make_tuple
             (
-                Policy1::collinear_touch(x, y, arrival_a, arrival_b),
-                Policy2::collinear_touch(x, y, arrival_a, arrival_b)
+                Policy1::segments_collinear(segment1, segment2,
+                                            opposite,
+                                            pa1, pa2, pb1, pb2,
+                                            ra1, ra2, rb1, rb2),
+                Policy2::segments_collinear(segment1, segment2,
+                                            opposite,
+                                            pa1, pa2, pb1, pb2,
+                                            ra1, ra2, rb1, rb2)
             );
     }
 
-    template <typename S>
-    static inline return_type collinear_interior_boundary_intersect(S const& segment,
-                bool a_within_b,
-                int arrival_a, int arrival_b, bool opposite)
-    {
-        return boost::make_tuple
-            (
-                Policy1::collinear_interior_boundary_intersect(segment, a_within_b, arrival_a, arrival_b, opposite),
-                Policy2::collinear_interior_boundary_intersect(segment, a_within_b, arrival_a, arrival_b, opposite)
-            );
-    }
-
-    static inline return_type collinear_a_in_b(segment_type1 const& segment,
-                bool opposite)
-    {
-        return boost::make_tuple
-            (
-                Policy1::collinear_a_in_b(segment, opposite),
-                Policy2::collinear_a_in_b(segment, opposite)
-            );
-    }
-    static inline return_type collinear_b_in_a(segment_type2 const& segment,
-                    bool opposite)
-    {
-        return boost::make_tuple
-            (
-                Policy1::collinear_b_in_a(segment, opposite),
-                Policy2::collinear_b_in_a(segment, opposite)
-            );
-    }
-
-
-    static inline return_type collinear_overlaps(
-                    coordinate_type const& x1, coordinate_type const& y1,
-                    coordinate_type const& x2, coordinate_type const& y2,
-                    int arrival_a, int arrival_b, bool opposite)
-    {
-        return boost::make_tuple
-            (
-                Policy1::collinear_overlaps(x1, y1, x2, y2, arrival_a, arrival_b, opposite),
-                Policy2::collinear_overlaps(x1, y1, x2, y2, arrival_a, arrival_b, opposite)
-            );
-    }
-
-    static inline return_type segment_equal(segment_type1 const& s,
-                bool opposite)
-    {
-        return boost::make_tuple
-            (
-                Policy1::segment_equal(s, opposite),
-                Policy2::segment_equal(s, opposite)
-            );
-    }
-
-    static inline return_type degenerate(segment_type1 const& segment,
+    template <typename Segment>
+    static inline return_type degenerate(Segment const& segment,
                 bool a_degenerate)
     {
         return boost::make_tuple
@@ -139,6 +77,18 @@
             );
     }
 
+    template <typename Segment, typename Ratio>
+    static inline return_type one_degenerate(Segment const& segment,
+            Ratio const& ratio,
+            bool a_degenerate)
+    {
+        return boost::make_tuple
+            (
+                Policy1::one_degenerate(segment, ratio, a_degenerate),
+                Policy2::one_degenerate(segment, ratio, a_degenerate)
+            );
+    }
+
     static inline return_type disjoint()
     {
         return boost::make_tuple
@@ -157,15 +107,6 @@
             );
     }
 
-    static inline return_type collinear_disjoint()
-    {
-        return boost::make_tuple
-            (
-                Policy1::collinear_disjoint(),
-                Policy2::collinear_disjoint()
-            );
-    }
-
 };
 
 }} // namespace policies::relate