summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/select_rings.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:38:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:39:52 +0900
commit5cde13f21d36c7224b0e13d11c4b49379ae5210d (patch)
treee8269ac85a4b0f7d416e2565fa4f451b5cb41351 /boost/geometry/algorithms/detail/overlay/select_rings.hpp
parentd9ec475d945d3035377a0d89ed42e382d8988891 (diff)
downloadboost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.gz
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.bz2
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.zip
Imported Upstream version 1.61.0
Change-Id: I96a1f878d1e6164f01e9aadd5147f38fca448d90 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/select_rings.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/select_rings.hpp42
1 files changed, 17 insertions, 25 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/select_rings.hpp b/boost/geometry/algorithms/detail/overlay/select_rings.hpp
index d18e012b2d..1b3cd866d7 100644
--- a/boost/geometry/algorithms/detail/overlay/select_rings.hpp
+++ b/boost/geometry/algorithms/detail/overlay/select_rings.hpp
@@ -35,13 +35,11 @@ namespace detail { namespace overlay
struct ring_turn_info
{
- bool has_uu_turn;
bool has_normal_turn;
bool within_other;
ring_turn_info()
- : has_uu_turn(false)
- , has_normal_turn(false)
+ : has_normal_turn(false)
, within_other(false)
{}
};
@@ -174,7 +172,7 @@ struct decide<overlay_union>
{
static bool include(ring_identifier const& , ring_turn_info const& info)
{
- return info.has_uu_turn || ! info.within_other;
+ return ! info.within_other;
}
static bool reversed(ring_identifier const& , ring_turn_info const& )
@@ -190,19 +188,16 @@ struct decide<overlay_difference>
{
// Difference: A - B
- // If this is A (source_index=0) and there is only a u/u turn,
- // then the ring is inside B
- // If this is B (source_index=1) and there is only a u/u turn,
- // then the ring is NOT inside A
+ // If this is A (source_index=0), then the ring is inside B
+ // If this is B (source_index=1), then the ring is NOT inside A
// If this is A and the ring is within the other geometry,
// then we should NOT include it.
// If this is B then we SHOULD include it.
- bool const is_first = id.source_index == 0;
- bool const within_other = info.within_other
- || (is_first && info.has_uu_turn);
- return is_first ? ! within_other : within_other;
+ return id.source_index == 0
+ ? ! info.within_other
+ : info.within_other;
}
static bool reversed(ring_identifier const& id, ring_turn_info const& info)
@@ -219,7 +214,7 @@ struct decide<overlay_intersection>
{
static bool include(ring_identifier const& , ring_turn_info const& info)
{
- return ! info.has_uu_turn && info.within_other;
+ return info.within_other;
}
static bool reversed(ring_identifier const& , ring_turn_info const& )
@@ -266,19 +261,16 @@ inline void update_ring_selection(Geometry1 const& geometry1,
continue;
}
- if (! info.has_uu_turn)
+ // Check if the ring is within the other geometry, by taking
+ // a point lying on the ring
+ switch(id.source_index)
{
- // Check if the ring is within the other geometry, by taking
- // a point lying on the ring
- switch(id.source_index)
- {
- case 0 :
- info.within_other = geometry::within(it->second.point, geometry2);
- break;
- case 1 :
- info.within_other = geometry::within(it->second.point, geometry1);
- break;
- }
+ case 0 :
+ info.within_other = geometry::within(it->second.point, geometry2);
+ break;
+ case 1 :
+ info.within_other = geometry::within(it->second.point, geometry1);
+ break;
}
if (decide<OverlayType>::include(id, info))