From 275d25739d66df2be4e03d19b514607ac89455e5 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 14 Dec 2016 14:14:55 -0800 Subject: [PATCH] Update to wagyu-0.2.1 (eec53a6) --- mapbox/geometry/wagyu/active_bound_list.hpp | 5 +++-- mapbox/geometry/wagyu/build_edges.hpp | 3 ++- mapbox/geometry/wagyu/intersect_util.hpp | 12 ++++++------ mapbox/geometry/wagyu/local_minimum.hpp | 2 ++ mapbox/geometry/wagyu/ring.hpp | 1 + mapbox/geometry/wagyu/topology_correction.hpp | 1 + 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mapbox/geometry/wagyu/active_bound_list.hpp b/mapbox/geometry/wagyu/active_bound_list.hpp index 2f1c9701..e08c5683 100644 --- a/mapbox/geometry/wagyu/active_bound_list.hpp +++ b/mapbox/geometry/wagyu/active_bound_list.hpp @@ -2,6 +2,7 @@ #ifdef DEBUG #include +#include #endif #include @@ -246,7 +247,7 @@ void set_winding_count(active_bound_list_itr& bnd_itr, if ((*rev_bnd_itr)->winding_count * (*rev_bnd_itr)->winding_delta < 0) { // prev edge is 'decreasing' WindCount (WC) toward zero // so we're outside the previous polygon ... - if (std::abs((*rev_bnd_itr)->winding_count) > 1) { + if (std::abs(static_cast((*rev_bnd_itr)->winding_count)) > 1) { // outside prev poly but still inside another. // when reversing direction of prev poly use the same WC if ((*rev_bnd_itr)->winding_delta * (*bnd_itr)->winding_delta < 0) { @@ -320,7 +321,7 @@ bool is_contributing(bound const& bnd, } break; case fill_type_non_zero: - if (std::abs(bnd.winding_count) != 1) { + if (std::abs(static_cast(bnd.winding_count)) != 1) { return false; } break; diff --git a/mapbox/geometry/wagyu/build_edges.hpp b/mapbox/geometry/wagyu/build_edges.hpp index b7ce6d44..37d5fe44 100644 --- a/mapbox/geometry/wagyu/build_edges.hpp +++ b/mapbox/geometry/wagyu/build_edges.hpp @@ -79,10 +79,11 @@ bool build_edge_list(mapbox::geometry::linear_ring const& path_geometry, edge // Find next non repeated point going backwards from // end for pt1 while (pt1 == pt2) { - pt1 = *(++itr_rev); + ++itr_rev; if (itr_rev == path_geometry.rend()) { return false; } + pt1 = *itr_rev; } ++itr; mapbox::geometry::point pt3 = *itr; diff --git a/mapbox/geometry/wagyu/intersect_util.hpp b/mapbox/geometry/wagyu/intersect_util.hpp index 77be594c..2f6c40c3 100644 --- a/mapbox/geometry/wagyu/intersect_util.hpp +++ b/mapbox/geometry/wagyu/intersect_util.hpp @@ -141,13 +141,13 @@ void intersect_bounds(active_bound_list_itr& b1, } } else if ((*b1)->poly_type != (*b2)->poly_type) { // toggle subj open path index on/off when std::abs(clip.WndCnt) == 1 - if (((*b1)->winding_delta == 0) && std::abs((*b2)->winding_count) == 1 && + if (((*b1)->winding_delta == 0) && std::abs(static_cast((*b2)->winding_count)) == 1 && (cliptype != clip_type_union || (*b2)->winding_count2 == 0)) { add_point(b1, active_bounds, pt, rings); if (b1Contributing) { (*b1)->ring = nullptr; } - } else if (((*b2)->winding_delta == 0) && (std::abs((*b1)->winding_count) == 1) && + } else if (((*b2)->winding_delta == 0) && (std::abs(static_cast((*b1)->winding_count)) == 1) && (cliptype != clip_type_union || (*b1)->winding_count2 == 0)) { add_point(b2, active_bounds, pt, rings); if (b2Contributing) { @@ -217,7 +217,7 @@ void intersect_bounds(active_bound_list_itr& b1, case fill_type_even_odd: case fill_type_non_zero: default: - b1Wc = std::abs((*b1)->winding_count); + b1Wc = std::abs(static_cast((*b1)->winding_count)); } switch (b2FillType) { case fill_type_positive: @@ -229,7 +229,7 @@ void intersect_bounds(active_bound_list_itr& b1, case fill_type_even_odd: case fill_type_non_zero: default: - b2Wc = std::abs((*b2)->winding_count); + b2Wc = std::abs(static_cast((*b2)->winding_count)); } if (b1Contributing && b2Contributing) { if ((b1Wc != 0 && b1Wc != 1) || (b2Wc != 0 && b2Wc != 1) || @@ -269,7 +269,7 @@ void intersect_bounds(active_bound_list_itr& b1, case fill_type_even_odd: case fill_type_non_zero: default: - b1Wc2 = std::abs((*b1)->winding_count2); + b1Wc2 = std::abs(static_cast((*b1)->winding_count2)); } switch (b2FillType2) { case fill_type_positive: @@ -281,7 +281,7 @@ void intersect_bounds(active_bound_list_itr& b1, case fill_type_even_odd: case fill_type_non_zero: default: - b2Wc2 = std::abs((*b2)->winding_count2); + b2Wc2 = std::abs(static_cast((*b2)->winding_count2)); } if ((*b1)->poly_type != (*b2)->poly_type) { diff --git a/mapbox/geometry/wagyu/local_minimum.hpp b/mapbox/geometry/wagyu/local_minimum.hpp index afd0a69a..fe03d84c 100644 --- a/mapbox/geometry/wagyu/local_minimum.hpp +++ b/mapbox/geometry/wagyu/local_minimum.hpp @@ -2,7 +2,9 @@ #ifdef DEBUG #include +#include #endif + #include #include diff --git a/mapbox/geometry/wagyu/ring.hpp b/mapbox/geometry/wagyu/ring.hpp index b4eda27b..d4cf303a 100644 --- a/mapbox/geometry/wagyu/ring.hpp +++ b/mapbox/geometry/wagyu/ring.hpp @@ -13,6 +13,7 @@ #ifdef DEBUG #include #include +#include #include // // void* callstack[128]; diff --git a/mapbox/geometry/wagyu/topology_correction.hpp b/mapbox/geometry/wagyu/topology_correction.hpp index d65e1ffd..ffbfc25d 100644 --- a/mapbox/geometry/wagyu/topology_correction.hpp +++ b/mapbox/geometry/wagyu/topology_correction.hpp @@ -16,6 +16,7 @@ #ifdef DEBUG #include +#include #endif namespace mapbox {