summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/buffer
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/geometry/algorithms/detail/buffer
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/geometry/algorithms/detail/buffer')
-rw-r--r--boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp50
-rw-r--r--boost/geometry/algorithms/detail/buffer/buffer_policies.hpp4
-rw-r--r--boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp23
-rw-r--r--boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp2
4 files changed, 33 insertions, 46 deletions
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 <boost/geometry/views/detail/normalized_view.hpp>
-#if defined(BOOST_GEOMETRY_BUFFER_SIMPLIFY_WITH_AX)
-#include <boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp>
-#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<Range>::type point_type;
- typedef strategy::distance::detail::projected_point_ax<> ax_type;
- typedef typename strategy::distance::services::return_type
+ typedef typename geometry::point_type<Range>::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<Range>::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 <typename Rings>
+ 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 <float> 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<overlay_buffer>(offsetted_rings, traversed_rings,
+ selected, m_intersection_strategy);
return detail::overlay::add_rings<GeometryOutput>(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 <boost/geometry/strategies/cartesian/side_of_intersection.hpp>
+#else
+#include <boost/geometry/strategies/agnostic/point_in_poly_winding.hpp>
#endif