diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/follow.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/overlay/follow.hpp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/follow.hpp b/boost/geometry/algorithms/detail/overlay/follow.hpp index afcd2bd82e..d945605413 100644 --- a/boost/geometry/algorithms/detail/overlay/follow.hpp +++ b/boost/geometry/algorithms/detail/overlay/follow.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2022. +// Modifications copyright (c) 2014-2022 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 @@ -23,8 +23,8 @@ #include <boost/range/size.hpp> #include <boost/range/value_type.hpp> -#include <boost/geometry/algorithms/covered_by.hpp> #include <boost/geometry/algorithms/clear.hpp> +#include <boost/geometry/algorithms/detail/covered_by/implementation.hpp> #include <boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp> #include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp> #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> @@ -422,13 +422,6 @@ public : OutputIterator out, Strategy const& strategy) { - typedef typename boost::range_iterator<Turns>::type turn_iterator; - typedef typename boost::range_value<Turns>::type turn_type; - typedef typename boost::range_iterator - < - typename turn_type::container_type - >::type turn_operation_iterator_type; - typedef following::action_selector<OverlayType, RemoveSpikes> action; // Sort intersection points on segments-along-linestring, and distance @@ -438,8 +431,7 @@ public : // for different ring id: c, i, u, x typedef relate::turns::less < - 0, relate::turns::less_op_linear_areal_single<0>, - typename Strategy::cs_tag + 0, relate::turns::less_op_linear_areal_single<0>, Strategy > turn_less; std::sort(boost::begin(turns), boost::end(turns), turn_less()); @@ -449,51 +441,51 @@ public : // Iterate through all intersection points (they are ordered along the line) bool entered = false; bool first = true; - for (turn_iterator it = boost::begin(turns); it != boost::end(turns); ++it) + for (auto const& turn : turns) { - turn_operation_iterator_type iit = boost::begin(it->operations); + auto const& op = turn.operations[0]; - if (following::was_entered(*it, *iit, first, linestring, polygon, strategy)) + if (following::was_entered(turn, op, first, linestring, polygon, strategy)) { - debug_traverse(*it, *iit, "-> Was entered"); + debug_traverse(turn, op, "-> Was entered"); entered = true; } - if (following::is_staying_inside(*it, *iit, entered, first, linestring, polygon, strategy)) + if (following::is_staying_inside(turn, op, entered, first, linestring, polygon, strategy)) { - debug_traverse(*it, *iit, "-> Staying inside"); + debug_traverse(turn, op, "-> Staying inside"); entered = true; } - else if (following::is_entering(*it, *iit)) + else if (following::is_entering(turn, op)) { - debug_traverse(*it, *iit, "-> Entering"); + debug_traverse(turn, op, "-> Entering"); entered = true; action::enter(current_piece, linestring, current_segment_id, - iit->seg_id.segment_index, it->point, *iit, + op.seg_id.segment_index, turn.point, op, strategy, robust_policy, linear::get(out)); } - else if (following::is_leaving(*it, *iit, entered, first, linestring, polygon, strategy)) + else if (following::is_leaving(turn, op, entered, first, linestring, polygon, strategy)) { - debug_traverse(*it, *iit, "-> Leaving"); + debug_traverse(turn, op, "-> Leaving"); entered = false; action::leave(current_piece, linestring, current_segment_id, - iit->seg_id.segment_index, it->point, *iit, + op.seg_id.segment_index, turn.point, op, strategy, robust_policy, linear::get(out)); } else if (BOOST_GEOMETRY_CONDITION(FollowIsolatedPoints) - && following::is_touching(*it, *iit, entered)) + && following::is_touching(turn, op, entered)) { - debug_traverse(*it, *iit, "-> Isolated point"); + debug_traverse(turn, op, "-> Isolated point"); action::template isolated_point < typename pointlike::type - >(it->point, pointlike::get(out)); + >(turn.point, pointlike::get(out)); } first = false; |