mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
Merge pull request #1030 from awulkiew/fix/buffer
[buffer] Use output_point_type with helper geometries instead of model::point
This commit is contained in:
commit
b6f0bbd389
@ -1,6 +1,7 @@
|
|||||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||||
|
|
||||||
// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
|
// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
|
||||||
|
// Copyright (c) 2022 Adam Wulkiewicz, Lodz, Poland.
|
||||||
|
|
||||||
// This file was modified by Oracle on 2017-2022.
|
// This file was modified by Oracle on 2017-2022.
|
||||||
// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
|
// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
|
||||||
@ -37,7 +38,8 @@
|
|||||||
#include <boost/geometry/core/exterior_ring.hpp>
|
#include <boost/geometry/core/exterior_ring.hpp>
|
||||||
#include <boost/geometry/core/interior_rings.hpp>
|
#include <boost/geometry/core/interior_rings.hpp>
|
||||||
|
|
||||||
#include <boost/geometry/geometries/helper_geometry.hpp>
|
#include <boost/geometry/geometries/linestring.hpp>
|
||||||
|
#include <boost/geometry/geometries/ring.hpp>
|
||||||
|
|
||||||
#include <boost/geometry/strategies/buffer.hpp>
|
#include <boost/geometry/strategies/buffer.hpp>
|
||||||
#include <boost/geometry/strategies/side.hpp>
|
#include <boost/geometry/strategies/side.hpp>
|
||||||
@ -455,7 +457,7 @@ template
|
|||||||
>
|
>
|
||||||
struct buffer_inserter_ring
|
struct buffer_inserter_ring
|
||||||
{
|
{
|
||||||
typedef typename point_type<RingOutput>::type output_point_type;
|
using output_point_type = typename point_type<RingOutput>::type;
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
@ -526,7 +528,13 @@ struct buffer_inserter_ring
|
|||||||
RobustPolicy const& robust_policy,
|
RobustPolicy const& robust_policy,
|
||||||
Strategies const& strategies)
|
Strategies const& strategies)
|
||||||
{
|
{
|
||||||
using simplified_ring_t = typename helper_geometry<RingInput>::type;
|
// Use helper geometry to support non-mutable input Rings
|
||||||
|
using simplified_ring_t = model::ring
|
||||||
|
<
|
||||||
|
output_point_type,
|
||||||
|
point_order<RingInput>::value != counterclockwise,
|
||||||
|
closure<RingInput>::value != open
|
||||||
|
>;
|
||||||
simplified_ring_t simplified;
|
simplified_ring_t simplified;
|
||||||
detail::buffer::simplify_input(ring, distance, simplified, strategies);
|
detail::buffer::simplify_input(ring, distance, simplified, strategies);
|
||||||
|
|
||||||
@ -618,9 +626,8 @@ template
|
|||||||
>
|
>
|
||||||
struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||||
{
|
{
|
||||||
typedef typename ring_type<Polygon>::type output_ring_type;
|
using output_ring_type = typename ring_type<Polygon>::type;
|
||||||
typedef typename point_type<output_ring_type>::type output_point_type;
|
using output_point_type = typename point_type<output_ring_type>::type;
|
||||||
typedef typename point_type<Linestring>::type input_point_type;
|
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
@ -644,8 +651,8 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
|||||||
Strategies const& strategies,
|
Strategies const& strategies,
|
||||||
output_point_type& first_p1)
|
output_point_type& first_p1)
|
||||||
{
|
{
|
||||||
input_point_type const& ultimate_point = *(end - 1);
|
output_point_type const& ultimate_point = *(end - 1);
|
||||||
input_point_type const& penultimate_point = *(end - 2);
|
output_point_type const& penultimate_point = *(end - 2);
|
||||||
|
|
||||||
// For the end-cap, we need to have the last perpendicular point on the
|
// For the end-cap, we need to have the last perpendicular point on the
|
||||||
// other side of the linestring. If it is the second pass (right),
|
// other side of the linestring. If it is the second pass (right),
|
||||||
@ -711,7 +718,8 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
|||||||
RobustPolicy const& robust_policy,
|
RobustPolicy const& robust_policy,
|
||||||
Strategies const& strategies)
|
Strategies const& strategies)
|
||||||
{
|
{
|
||||||
typename helper_geometry<Linestring>::type simplified;
|
// Use helper geometry to support non-mutable input Linestrings
|
||||||
|
model::linestring<output_point_type> simplified;
|
||||||
detail::buffer::simplify_input(linestring, distance, simplified, strategies);
|
detail::buffer::simplify_input(linestring, distance, simplified, strategies);
|
||||||
|
|
||||||
geometry::strategy::buffer::result_code code = geometry::strategy::buffer::result_no_output;
|
geometry::strategy::buffer::result_code code = geometry::strategy::buffer::result_no_output;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user