From b8cf34c691623e4ec329053cbbf68522a855882d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 5 Dec 2019 15:12:59 +0900 Subject: Imported Upstream version 1.67.0 --- .../algorithms/detail/buffer/buffer_inserter.hpp | 50 +++++----------------- .../algorithms/detail/buffer/buffer_policies.hpp | 4 ++ .../detail/buffer/buffered_piece_collection.hpp | 23 +++++++--- .../detail/buffer/turn_in_piece_visitor.hpp | 2 + 4 files changed, 33 insertions(+), 46 deletions(-) (limited to 'boost/geometry/algorithms/detail/buffer') diff --git a/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp b/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp index 990081a86c..a969b21cfb 100644 --- a/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +++ b/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp @@ -41,10 +41,6 @@ #include -#if defined(BOOST_GEOMETRY_BUFFER_SIMPLIFY_WITH_AX) -#include -#endif - namespace boost { namespace geometry { @@ -67,45 +63,21 @@ inline void simplify_input(Range const& range, // sensitive to small scale input features, however the result will // look better. // It also gets rid of duplicate points -#if ! defined(BOOST_GEOMETRY_BUFFER_SIMPLIFY_WITH_AX) - geometry::simplify(range, simplified, distance.simplify_distance()); -#else - typedef typename boost::range_value::type point_type; - typedef strategy::distance::detail::projected_point_ax<> ax_type; - typedef typename strategy::distance::services::return_type + typedef typename geometry::point_type::type point_type; + typedef typename strategy::distance::services::default_strategy < - strategy::distance::detail::projected_point_ax<>, - point_type, - point_type - >::type return_type; - - typedef strategy::distance::detail::projected_point_ax_less + point_tag, segment_tag, point_type + >::type ds_strategy_type; + typedef strategy::simplify::douglas_peucker < - return_type - > comparator_type; + point_type, ds_strategy_type + > strategy_type; + + geometry::detail::simplify::simplify_range<2>::apply(range, + simplified, distance.simplify_distance(), + strategy_type()); - typedef strategy::simplify::detail::douglas_peucker - < - point_type, - strategy::distance::detail::projected_point_ax<>, - comparator_type - > dp_ax; - - return_type max_distance(distance.simplify_distance() * 2.0, - distance.simplify_distance()); - comparator_type comparator(max_distance); - dp_ax strategy(comparator); - - geometry::simplify(range, simplified, max_distance, strategy); -#endif - - if (boost::size(simplified) == 2 - && geometry::equals(geometry::range::front(simplified), - geometry::range::back(simplified))) - { - traits::resize::apply(simplified, 1); - } } diff --git a/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp b/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp index 92dcdcc7b0..0374b53a99 100644 --- a/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp +++ b/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp @@ -127,6 +127,10 @@ public : void visit_traverse_reject(Turns const& , Turn const& , Operation const& , detail::overlay::traverse_error_type ) {} + + template + void visit_generated_rings(Rings const& ) + {} }; diff --git a/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index bc9c1ca7fb..ba824243cc 100644 --- a/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2016-2017. // Modifications copyright (c) 2016-2017 Oracle and/or its affiliates. @@ -155,8 +156,14 @@ struct buffered_piece_collection robust_point_type >::type robust_area_strategy_type; - typedef typename area_strategy_type::return_type area_result_type; - typedef typename robust_area_strategy_type::return_type robust_area_result_type; + typedef typename area_strategy_type::template result_type + < + point_type + >::type area_result_type; + typedef typename robust_area_strategy_type::template result_type + < + robust_point_type + >::type robust_area_result_type; typedef typename geometry::rescale_policy_type < @@ -603,7 +610,11 @@ struct buffered_piece_collection if (multi0 == multi1) { const deflate_properties& prop = properties[multi0]; - if (! prop.has_inflated && prop.count < 3) + + // NOTE: Keep brackets around prop.count + // avoid gcc-bug "parse error in template argument list" + // GCC versions 5.4 and 5.5 (and probably more) + if (! prop.has_inflated && (prop.count) < 3) { // Property is not inflated // Not enough points, this might be caused by where @@ -1570,10 +1581,8 @@ struct buffered_piece_collection } } - // Assign parents, checking orientation but NOT discarding double - // negative rings (negative child with negative parent) - detail::overlay::assign_parents(offsetted_rings, traversed_rings, - selected, m_intersection_strategy, true, false); + detail::overlay::assign_parents(offsetted_rings, traversed_rings, + selected, m_intersection_strategy); return detail::overlay::add_rings(selected, offsetted_rings, traversed_rings, out, m_area_strategy); } diff --git a/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp b/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp index 29e49f9dae..eb6fc02c8c 100644 --- a/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp +++ b/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp @@ -36,6 +36,8 @@ #if defined(BOOST_GEOMETRY_BUFFER_USE_SIDE_OF_INTERSECTION) #include +#else +#include #endif -- cgit v1.2.3