X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fgeometry%2Falgorithms%2Fdetail%2Foverlay%2Fintersection_insert.hpp;h=9232b0f40764aa3f1f50d98cdae052bb0b1a81f8;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=60255cd9538170242677bc794d1543ed377d94cd;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/boost/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/ceph/src/boost/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 60255cd95..9232b0f40 100644 --- a/ceph/src/boost/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/ceph/src/boost/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014, 2015, 2017. -// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015, 2017, 2019. +// Modifications copyright (c) 2014-2019 Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -35,8 +35,9 @@ #include #include #include +#include -#include +#include #include #include @@ -71,52 +72,32 @@ struct intersection_segment_segment_point > static inline OutputIterator apply(Segment1 const& segment1, Segment2 const& segment2, - RobustPolicy const& robust_policy, + RobustPolicy const& , OutputIterator out, Strategy const& strategy) { - typedef typename point_type::type point_type; - - typedef typename geometry::robust_point_type - < - typename geometry::point_type::type, - RobustPolicy - >::type robust_point_type; + // Make sure this is only called with no rescaling + BOOST_STATIC_ASSERT((boost::is_same + < + no_rescale_policy_tag, + typename rescale_policy_type::type + >::value)); - // TODO: rescale segment -> robust points - robust_point_type pi_rob, pj_rob, qi_rob, qj_rob; - { - // Workaround: - point_type pi, pj, qi, qj; - assign_point_from_index<0>(segment1, pi); - assign_point_from_index<1>(segment1, pj); - assign_point_from_index<0>(segment2, qi); - assign_point_from_index<1>(segment2, qj); - geometry::recalculate(pi_rob, pi, robust_policy); - geometry::recalculate(pj_rob, pj, robust_policy); - geometry::recalculate(qi_rob, qi, robust_policy); - geometry::recalculate(qj_rob, qj, robust_policy); - } + typedef typename point_type::type point_type; // Get the intersection point (or two points) - typedef segment_intersection_points - < - point_type, - typename segment_ratio_type - < - point_type, RobustPolicy - >::type - > intersection_return_type; + typedef segment_intersection_points intersection_return_type; typedef policies::relate::segments_intersection_points < intersection_return_type > policy_type; + detail::segment_as_subrange sub_range1(segment1); + detail::segment_as_subrange sub_range2(segment2); + intersection_return_type - is = strategy.apply(segment1, segment2, - policy_type(), robust_policy, - pi_rob, pj_rob, qi_rob, qj_rob); + is = strategy.apply(sub_range1, sub_range2, policy_type()); for (std::size_t i = 0; i < is.count; i++) { @@ -144,13 +125,14 @@ struct intersection_linestring_linestring_point OutputIterator out, Strategy const& strategy) { - typedef typename point_type::type point_type; - - typedef detail::overlay::turn_info - < - point_type, - typename segment_ratio_type::type - > turn_info; + // Make sure this is only called with no rescaling + BOOST_STATIC_ASSERT((boost::is_same + < + no_rescale_policy_tag, + typename rescale_policy_type::type + >::value)); + + typedef detail::overlay::turn_info turn_info; std::deque turns; geometry::get_intersection_points(linestring1, linestring2, @@ -408,6 +390,13 @@ struct intersection_of_linestring_with_areal OutputIterator out, Strategy const& strategy) { + // Make sure this is only called with no rescaling + BOOST_STATIC_ASSERT((boost::is_same + < + no_rescale_policy_tag, + typename rescale_policy_type::type + >::value)); + if (boost::size(linestring) == 0) { return out; @@ -423,21 +412,26 @@ struct intersection_of_linestring_with_areal > follower; typedef typename point_type::type point_type; + + typedef geometry::segment_ratio + < + typename coordinate_type::type + > ratio_type; + #ifdef BOOST_GEOMETRY_SETOPS_LA_OLD_BEHAVIOR typedef detail::overlay::traversal_turn_info < - point_type, - typename geometry::segment_ratio_type::type + point_type, ratio_type > turn_info; #else typedef detail::overlay::turn_info < point_type, - typename geometry::segment_ratio_type::type, + ratio_type, detail::overlay::turn_operation_linear < point_type, - typename geometry::segment_ratio_type::type + ratio_type > > turn_info; #endif @@ -602,19 +596,23 @@ struct intersection_linear_areal_point OutputIterator out, Strategy const& strategy) { - typedef typename geometry::segment_ratio_type - < - PointOut, RobustPolicy - >::type segment_ratio_type; + // Make sure this is only called with no rescaling + BOOST_STATIC_ASSERT((boost::is_same + < + no_rescale_policy_tag, + typename rescale_policy_type::type + >::value)); + + typedef geometry::segment_ratio::type> ratio_type; typedef detail::overlay::turn_info < PointOut, - segment_ratio_type, + ratio_type, detail::overlay::turn_operation_linear < PointOut, - segment_ratio_type + ratio_type > > turn_info; @@ -1288,13 +1286,16 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1, concepts::check(); concepts::check(); - typedef typename geometry::rescale_policy_type + typedef typename geometry::rescale_overlay_policy_type < - typename geometry::point_type::type // TODO from both + Geometry1, + Geometry2, + typename Strategy::cs_tag >::type rescale_policy_type; rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry1, geometry2); + = geometry::get_rescale_policy( + geometry1, geometry2, strategy); return detail::intersection::insert <