diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:33:54 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:36:09 +0900 |
commit | d9ec475d945d3035377a0d89ed42e382d8988891 (patch) | |
tree | 34aff2cee4b209906243ab5499d61f3edee2982f /boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp | |
parent | 71d216b90256936a9638f325af9bc69d720e75de (diff) | |
download | boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.gz boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.bz2 boost-d9ec475d945d3035377a0d89ed42e382d8988891.zip |
Imported Upstream version 1.60.0
Change-Id: Ie709530d6d5841088ceaba025cbe175a4ef43050
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp b/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp index 3f81c4dca9..bc84286241 100644 --- a/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp +++ b/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp @@ -26,7 +26,9 @@ #include <boost/geometry/algorithms/detail/ring_identifier.hpp> #include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp> +#include <boost/geometry/algorithms/detail/overlay/handle_colocations.hpp> #include <boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp> +#include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp> #include <boost/geometry/policies/robustness/robust_type.hpp> #include <boost/geometry/strategies/side.hpp> #ifdef BOOST_GEOMETRY_DEBUG_ENRICH @@ -466,6 +468,7 @@ inline void create_map(TurnPoints const& turn_points, MappedVector& mapped_vecto template < bool Reverse1, bool Reverse2, + overlay_type OverlayType, typename TurnPoints, typename Geometry1, typename Geometry2, typename RobustPolicy, @@ -490,10 +493,9 @@ inline void enrich_intersection_points(TurnPoints& turn_points, std::vector<indexed_turn_operation> > mapped_vector_type; - // DISCARD ALL UU - // #76 is the reason that this is necessary... - // With uu, at all points there is the risk that rings are being traversed twice or more. - // Without uu, all rings having only uu will be untouched and gathered by assemble + // Iterate through turns and discard uu + // and check if there are possible colocations + bool check_colocations = false; for (typename boost::range_iterator<TurnPoints>::type it = boost::begin(turn_points); it != boost::end(turn_points); @@ -501,14 +503,34 @@ inline void enrich_intersection_points(TurnPoints& turn_points, { if (it->both(detail::overlay::operation_union)) { + // Discard (necessary for a.o. #76). With uu, at all points there + // is the risk that rings are being traversed twice or more. + // Without uu, all rings having only uu will be untouched + // and gathered by assemble it->discarded = true; + check_colocations = true; } - if (it->both(detail::overlay::operation_none)) + else if (it->combination(detail::overlay::operation_union, + detail::overlay::operation_blocked)) + { + check_colocations = true; + } + else if (OverlayType == overlay_difference + && it->both(detail::overlay::operation_intersection)) + { + // For difference operation (u/u -> i/i) + check_colocations = true; + } + else if (it->both(detail::overlay::operation_none)) { it->discarded = true; } } + if (check_colocations) + { + detail::overlay::handle_colocations<OverlayType>(turn_points); + } // Create a map of vectors of indexed operation-types to be able // to sort intersection points PER RING |