diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:24:46 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:25:39 +0900 |
commit | 4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch) | |
tree | fd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/geometry/algorithms/detail/overlay/get_turns.hpp | |
parent | b5c87084afaef42b2d058f68091be31988a6a874 (diff) | |
download | boost-upstream/1.65.0.tar.gz boost-upstream/1.65.0.tar.bz2 boost-upstream/1.65.0.zip |
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/get_turns.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/overlay/get_turns.hpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 4e97a84a37..f88dfe8422 100644 --- a/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2014-2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2014, 2016, 2017. // Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. @@ -90,6 +90,9 @@ struct no_interrupt_policy { static bool const enabled = false; + // variable required by self_get_turn_points::get_turns + static bool const has_intersections = false; + template <typename Range> static inline bool apply(Range const&) { @@ -230,7 +233,7 @@ public : // section 2: [--------------] // section 1: |----|---|---|---|---| for (prev1 = it1++, next1++; - it1 != end1 && ! detail::section::exceeding<0>(dir1, *prev1, sec2.bounding_box, robust_policy); + it1 != end1 && ! detail::section::exceeding<0>(dir1, *prev1, sec1.bounding_box, sec2.bounding_box, robust_policy); ++prev1, ++it1, ++index1, ++next1, ++ndi1) { ever_circling_iterator<range1_iterator> nd_next1( @@ -248,7 +251,7 @@ public : next2++; for (prev2 = it2++, next2++; - it2 != end2 && ! detail::section::exceeding<0>(dir2, *prev2, sec1.bounding_box, robust_policy); + it2 != end2 && ! detail::section::exceeding<0>(dir2, *prev2, sec2.bounding_box, sec1.bounding_box, robust_policy); ++prev2, ++it2, ++index2, ++next2, ++ndi2) { bool skip = same_source; @@ -356,7 +359,7 @@ private : // skips to the begin-point, we loose the index or have to recalculate it) // So we mimic it here template <typename Range, typename Section, typename Box, typename RobustPolicy> - static inline void get_start_point_iterator(Section & section, + static inline void get_start_point_iterator(Section const& section, Range const& range, typename boost::range_iterator<Range const>::type& it, typename boost::range_iterator<Range const>::type& prev, @@ -370,7 +373,7 @@ private : // Mimic section-iterator: // Skip to point such that section interects other box prev = it++; - for(; it != end && detail::section::preceding<0>(dir, *it, other_bounding_box, robust_policy); + for(; it != end && detail::section::preceding<0>(dir, *it, section.bounding_box, other_bounding_box, robust_policy); prev = it++, index++, ndi++) {} // Go back one step because we want to start completely preceding @@ -418,6 +421,7 @@ struct section_visitor { if (! detail::disjoint::disjoint_box_box(sec1.bounding_box, sec2.bounding_box)) { + // false if interrupted return get_turns_in_sections < Geometry1, @@ -425,13 +429,12 @@ struct section_visitor Reverse1, Reverse2, Section, Section, TurnPolicy - >::apply( - m_source_id1, m_geometry1, sec1, - m_source_id2, m_geometry2, sec2, - false, - m_intersection_strategy, - m_rescale_policy, - m_turns, m_interrupt_policy); + >::apply(m_source_id1, m_geometry1, sec1, + m_source_id2, m_geometry2, sec2, + false, + m_intersection_strategy, + m_rescale_policy, + m_turns, m_interrupt_policy); } return true; } @@ -473,10 +476,13 @@ public: sections_type sec1, sec2; typedef boost::mpl::vector_c<std::size_t, 0, 1> dimensions; + typename IntersectionStrategy::envelope_strategy_type const + envelope_strategy = intersection_strategy.get_envelope_strategy(); + geometry::sectionalize<Reverse1, dimensions>(geometry1, robust_policy, - sec1, 0); + sec1, envelope_strategy, 0); geometry::sectionalize<Reverse2, dimensions>(geometry2, robust_policy, - sec2, 1); + sec2, envelope_strategy, 1); // ... and then partition them, intersecting overlapping sections in visitor method section_visitor |