]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/detail/relate/linear_linear.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / relate / linear_linear.hpp
index 520f2bd775f961fde864d1c1b39bd2de6953820e..ec8fe428d672fd02e83c555659942c50541ddb09 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
 
-// This file was modified by Oracle on 2013, 2014, 2015, 2017.
-// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019.
+// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
@@ -42,6 +42,8 @@ namespace detail { namespace relate {
 template <typename Result, typename BoundaryChecker, bool TransposeResult>
 class disjoint_linestring_pred
 {
+    typedef typename BoundaryChecker::equals_strategy_type equals_strategy_type;
+
 public:
     disjoint_linestring_pred(Result & res,
                              BoundaryChecker const& boundary_checker)
@@ -80,7 +82,8 @@ public:
         // point-like linestring
         if ( count == 2
           && equals::equals_point_point(range::front(linestring),
-                                        range::back(linestring)) )
+                                        range::back(linestring),
+                                        equals_strategy_type()) )
         {
             update<interior, exterior, '0', TransposeResult>(m_result);
         }
@@ -124,13 +127,18 @@ struct linear_linear
                              Result & result,
                              IntersectionStrategy const& intersection_strategy)
     {
+        typedef typename IntersectionStrategy::cs_tag cs_tag;
+
         // The result should be FFFFFFFFF
         relate::set<exterior, exterior, result_dimension<Geometry1>::value>(result);// FFFFFFFFd, d in [1,9] or T
         if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
             return;
 
         // get and analyse turns
-        typedef typename turns::get_turns<Geometry1, Geometry2>::turn_info turn_type;
+        typedef typename turns::get_turns
+            <
+                Geometry1, Geometry2
+            >::template turn_info_type<IntersectionStrategy>::type turn_type;
         std::vector<turn_type> turns;
 
         interrupt_policy_linear_linear<Result> interrupt_policy(result);
@@ -145,14 +153,24 @@ struct linear_linear
         if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
             return;
 
-        boundary_checker<Geometry1> boundary_checker1(geometry1);
-        disjoint_linestring_pred<Result, boundary_checker<Geometry1>, false> pred1(result, boundary_checker1);
+        typedef boundary_checker
+            <
+                Geometry1,
+                typename IntersectionStrategy::point_in_point_strategy_type
+            > boundary_checker1_type;
+        boundary_checker1_type boundary_checker1(geometry1);
+        disjoint_linestring_pred<Result, boundary_checker1_type, false> pred1(result, boundary_checker1);
         for_each_disjoint_geometry_if<0, Geometry1>::apply(turns.begin(), turns.end(), geometry1, pred1);
         if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
             return;
 
-        boundary_checker<Geometry2> boundary_checker2(geometry2);
-        disjoint_linestring_pred<Result, boundary_checker<Geometry2>, true> pred2(result, boundary_checker2);
+        typedef boundary_checker
+            <
+                Geometry2,
+                typename IntersectionStrategy::point_in_point_strategy_type
+            > boundary_checker2_type;
+        boundary_checker2_type boundary_checker2(geometry2);
+        disjoint_linestring_pred<Result, boundary_checker2_type, true> pred2(result, boundary_checker2);
         for_each_disjoint_geometry_if<1, Geometry2>::apply(turns.begin(), turns.end(), geometry2, pred2);
         if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
             return;
@@ -170,7 +188,7 @@ struct linear_linear
           || may_update<boundary, boundary, '0'>(result)
           || may_update<boundary, exterior, '0'>(result) )
         {
-            typedef turns::less<0, turns::less_op_linear_linear<0> > less;
+            typedef turns::less<0, turns::less_op_linear_linear<0>, cs_tag> less;
             std::sort(turns.begin(), turns.end(), less());
 
             turns_analyser<turn_type, 0> analyser;
@@ -190,7 +208,7 @@ struct linear_linear
           || may_update<boundary, boundary, '0', true>(result)
           || may_update<boundary, exterior, '0', true>(result) )
         {
-            typedef turns::less<1, turns::less_op_linear_linear<1> > less;
+            typedef turns::less<1, turns::less_op_linear_linear<1>, cs_tag> less;
             std::sort(turns.begin(), turns.end(), less());
 
             turns_analyser<turn_type, 1> analyser;
@@ -274,6 +292,8 @@ struct linear_linear
                    BoundaryChecker const& boundary_checker,
                    OtherBoundaryChecker const& other_boundary_checker)
         {
+            typedef typename BoundaryChecker::equals_strategy_type equals_strategy_type;
+
             overlay::operation_type const op = it->operations[op_id].operation;
 
             segment_identifier const& seg_id = it->operations[op_id].seg_id;
@@ -323,7 +343,9 @@ struct linear_linear
             {
                 // real exit point - may be multiple
                 // we know that we entered and now we exit
-                if ( ! turn_on_the_same_ip<op_id>(m_exit_watcher.get_exit_turn(), *it) )
+                if ( ! turn_on_the_same_ip<op_id>(m_exit_watcher.get_exit_turn(),
+                                                  *it,
+                                                  equals_strategy_type()) )
                 {
                     m_exit_watcher.reset_detected_exit();
                     
@@ -344,7 +366,9 @@ struct linear_linear
                     return;
 
                 if ( op == overlay::operation_intersection
-                  && turn_on_the_same_ip<op_id>(m_exit_watcher.get_exit_turn(), *it) )
+                  && turn_on_the_same_ip<op_id>(m_exit_watcher.get_exit_turn(),
+                                                *it,
+                                                equals_strategy_type()) )
                 {
                     fake_enter_detected = true;
                 }
@@ -647,6 +671,11 @@ struct linear_linear
                                 OtherBoundaryChecker const& /*other_boundary_checker*/,
                                 bool first_in_range)
         {
+            typedef typename BoundaryChecker::equals_strategy_type
+                equals_strategy1_type;
+            typedef typename OtherBoundaryChecker::equals_strategy_type
+                equals_strategy2_type;
+
             typename detail::single_geometry_return_type<Geometry const>::type
                 ls1_ref = detail::single_geometry(geometry, turn.operations[op_id].seg_id);
             typename detail::single_geometry_return_type<OtherGeometry const>::type
@@ -714,9 +743,13 @@ struct linear_linear
                 // here we don't know which one is degenerated
 
                 bool const is_point1 = boost::size(ls1_ref) == 2
-                                    && equals::equals_point_point(range::front(ls1_ref), range::back(ls1_ref));
+                                    && equals::equals_point_point(range::front(ls1_ref),
+                                                                  range::back(ls1_ref),
+                                                                  equals_strategy1_type());
                 bool const is_point2 = boost::size(ls2_ref) == 2
-                                    && equals::equals_point_point(range::front(ls2_ref), range::back(ls2_ref));
+                                    && equals::equals_point_point(range::front(ls2_ref),
+                                                                  range::back(ls2_ref),
+                                                                  equals_strategy2_type());
 
                 // if the second one is degenerated
                 if ( !is_point1 && is_point2 )