]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / detail / overlay / get_turn_info_la.hpp
index 5b5273392c14be2b9c403e2438e3bd9a5c0436d5..576ab5f7bf517a31dd7bb6e12525054abcc9547c 100644 (file)
@@ -3,8 +3,8 @@
 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
 // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
 
-// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018.
-// Modifications copyright (c) 2013-2018 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2013-2020.
+// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
@@ -79,7 +79,7 @@ struct get_turn_info_linear_areal
             case 's' : // starts from the middle
                 get_turn_info_for_endpoint<true, true>(range_p, range_q,
                     tp_model, inters, method_none, out,
-                    umbrella_strategy.get_point_in_point_strategy());
+                    umbrella_strategy);
                 break;
 
             case 'd' : // disjoint: never do anything
@@ -89,13 +89,13 @@ struct get_turn_info_linear_areal
             {
                 if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
                         tp_model, inters, method_touch_interior, out,
-                        umbrella_strategy.get_point_in_point_strategy()) )
+                        umbrella_strategy) )
                 {
                     // do nothing
                 }
                 else
                 {
-                    typedef touch_interior<TurnInfo> handler;
+                    using handler = touch_interior<TurnInfo, verify_policy_la>;
 
                     // If Q (1) arrives (1)
                     if ( inters.d_info().arrival[1] == 1 )
@@ -109,7 +109,7 @@ struct get_turn_info_linear_areal
                         // Swap p/q
                         handler::template apply<1>(range_q, range_p,
                                     tp, inters.i_info(), inters.d_info(),
-                                    inters.get_swapped_sides(), umbrella_strategy);
+                                    inters.swapped_sides(), umbrella_strategy);
                     }
 
                     if ( tp.operations[1].operation == operation_blocked )
@@ -124,7 +124,7 @@ struct get_turn_info_linear_areal
                     // this function assumes that 'u' must be set for a spike
                     calculate_spike_operation(tp.operations[0].operation,
                                               inters,
-                                              umbrella_strategy.get_point_in_point_strategy());
+                                              umbrella_strategy);
                     
                     *out++ = tp;
                 }
@@ -144,13 +144,14 @@ struct get_turn_info_linear_areal
                 // Both touch (both arrive there)
                 if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
                         tp_model, inters, method_touch, out,
-                        umbrella_strategy.get_point_in_point_strategy()) )
+                        umbrella_strategy) )
                 {
                     // do nothing
                 }
                 else 
                 {
-                    touch<TurnInfo>::apply(range_p, range_q, tp,
+                    using handler = touch<TurnInfo, verify_policy_la>;
+                    handler::apply(range_p, range_q, tp,
                         inters.i_info(), inters.d_info(), inters.sides(),
                         umbrella_strategy);
 
@@ -218,7 +219,7 @@ struct get_turn_info_linear_areal
                     bool ignore_spike
                         = calculate_spike_operation(tp.operations[0].operation,
                                                     inters,
-                                                    umbrella_strategy.get_point_in_point_strategy());
+                                                    umbrella_strategy);
 
                     if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
                       || ignore_spike
@@ -234,7 +235,7 @@ struct get_turn_info_linear_areal
             {
                 if ( get_turn_info_for_endpoint<true, true>(range_p, range_q,
                         tp_model, inters, method_equal, out,
-                        umbrella_strategy.get_point_in_point_strategy()) )
+                        umbrella_strategy) )
                 {
                     // do nothing
                 }
@@ -246,7 +247,8 @@ struct get_turn_info_linear_areal
                     {
                         // Both equal
                         // or collinear-and-ending at intersection point
-                        equal<TurnInfo>::apply(range_p, range_q, tp,
+                        using handler = equal<TurnInfo, verify_policy_la>;
+                        handler::apply(range_p, range_q, tp,
                             inters.i_info(), inters.d_info(), inters.sides(),
                             umbrella_strategy);
 
@@ -279,7 +281,7 @@ struct get_turn_info_linear_areal
                 if ( get_turn_info_for_endpoint<true, true>(
                         range_p, range_q,
                         tp_model, inters, method_collinear, out,
-                        umbrella_strategy.get_point_in_point_strategy()) )
+                        umbrella_strategy) )
                 {
                     // do nothing
                 }
@@ -295,7 +297,8 @@ struct get_turn_info_linear_areal
                         if ( inters.d_info().arrival[0] == 0 )
                         {
                             // Collinear, but similar thus handled as equal
-                            equal<TurnInfo>::apply(range_p, range_q, tp,
+                            using handler = equal<TurnInfo, verify_policy_la>;
+                            handler::apply(range_p, range_q, tp,
                                 inters.i_info(), inters.d_info(), inters.sides(),
                                 umbrella_strategy);
 
@@ -304,8 +307,9 @@ struct get_turn_info_linear_areal
                         }
                         else
                         {
-                            collinear<TurnInfo>::apply(range_p, range_q, tp,
-                                inters.i_info(), inters.d_info(), inters.sides());
+                            using handler = collinear<TurnInfo, verify_policy_la>;
+                            handler::apply(range_p, range_q, tp, inters.i_info(),
+                                           inters.d_info(), inters.sides());
 
                             //method_replace = method_touch_interior;
                             //version = append_collinear;
@@ -359,13 +363,13 @@ struct get_turn_info_linear_areal
 
                     if ( range_p.is_first_segment()
                       && equals::equals_point_point(range_p.at(0), tp.point,
-                                                    umbrella_strategy.get_point_in_point_strategy()) )
+                                                    umbrella_strategy) )
                     {
                         tp.operations[0].position = position_front;
                     }
                     else if ( range_p.is_last_segment()
                            && equals::equals_point_point(range_p.at(1), tp.point,
-                                                         umbrella_strategy.get_point_in_point_strategy()) )
+                                                         umbrella_strategy) )
                     {
                         tp.operations[0].position = position_back;
                     }
@@ -392,10 +396,10 @@ struct get_turn_info_linear_areal
 
     template <typename Operation,
               typename IntersectionInfo,
-              typename EqPPStrategy>
+              typename Strategy>
     static inline bool calculate_spike_operation(Operation & op,
                                                  IntersectionInfo const& inters,
-                                                 EqPPStrategy const& strategy)
+                                                 Strategy const& strategy)
     {
         bool is_p_spike = ( op == operation_union || op == operation_intersection )
                        && inters.is_spike_p();
@@ -415,7 +419,7 @@ struct get_turn_info_linear_areal
                 // spike on the edge point
                 // if it's already known that the spike is going out this musn't be checked
                 if ( ! going_out
-                  && detail::equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
+                  && equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
                 {
                     int const pk_q2 = inters.sides().pk_wrt_q2();
                     going_in = pk_q1 < 0 && pk_q2 < 0; // Pk on the right of both
@@ -427,7 +431,7 @@ struct get_turn_info_linear_areal
                 // spike on the edge point
                 // if it's already known that the spike is going in this musn't be checked
                 if ( ! going_in
-                  && detail::equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
+                  && equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
                 {
                     int const pk_q2 = inters.sides().pk_wrt_q2();
                     going_in = pk_q1 < 0 || pk_q2 < 0; // Pk on the right of one of them
@@ -679,7 +683,7 @@ struct get_turn_info_linear_areal
               typename TurnInfo,
               typename IntersectionInfo,
               typename OutputIterator,
-              typename EqPPStrategy>
+              typename Strategy>
     static inline bool get_turn_info_for_endpoint(
                             UniqueSubRange1 const& range_p,
                             UniqueSubRange2 const& range_q,
@@ -687,7 +691,7 @@ struct get_turn_info_linear_areal
                             IntersectionInfo const& inters,
                             method_type /*method*/,
                             OutputIterator out,
-                            EqPPStrategy const& strategy)
+                            Strategy const& strategy)
     {
         namespace ov = overlay;
         typedef ov::get_turn_info_for_endpoint<EnableFirst, EnableLast> get_info_e;
@@ -705,9 +709,6 @@ struct get_turn_info_linear_areal
             return false;
         }
 
-        typename IntersectionInfo::side_strategy_type const& sides
-                = inters.get_side_strategy();
-
         linear_intersections intersections(range_p.at(0),
                                            range_q.at(0),
                                            inters.result(),
@@ -738,6 +739,8 @@ struct get_turn_info_linear_areal
             }
             else
             {
+                auto const sides = strategy.side();
+
                 // pi is the intersection point at qj or in the middle of q1
                 // so consider segments
                 // 1. pi at qj: qi-qj-pj and qi-qj-qk
@@ -807,6 +810,8 @@ struct get_turn_info_linear_areal
             }
             else //if ( result.template get<0>().count == 1 )
             {
+                auto const sides = strategy.side();
+
                 // pj is the intersection point at qj or in the middle of q1
                 // so consider segments
                 // 1. pj at qj: qi-qj-pi and qi-qj-qk
@@ -863,14 +868,6 @@ struct get_turn_info_linear_areal
         // don't ignore anything for now
         return false;
     }
-
-    template <typename Point1, typename Point2, typename IntersectionStrategy>
-    static inline bool equals_point_point(Point1 const& point1, Point2 const& point2,
-                                          IntersectionStrategy const& strategy)
-    {
-        return detail::equals::equals_point_point(point1, point2,
-                                                  strategy.get_point_in_point_strategy());
-    }
 };
 
 }} // namespace detail::overlay