1
1
// Boost.Geometry (aka GGL, Generic Geometry Library)
2
2
3
3
// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
4
- // Copyright (c) 2022 Adam Wulkiewicz, Lodz, Poland.
4
+ // Copyright (c) 2022-2023 Adam Wulkiewicz, Lodz, Poland.
5
5
6
6
// This file was modified by Oracle on 2017-2022.
7
7
// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
44
44
#include < boost/geometry/strategies/buffer.hpp>
45
45
#include < boost/geometry/strategies/side.hpp>
46
46
47
- #include < boost/geometry/util/condition .hpp>
47
+ #include < boost/geometry/util/constexpr .hpp>
48
48
#include < boost/geometry/util/math.hpp>
49
49
#include < boost/geometry/util/type_traits.hpp>
50
50
@@ -942,17 +942,17 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
942
942
{
943
943
boost::ignore_unused (visit_pieces_policy);
944
944
945
- typedef detail::buffer::buffered_piece_collection
946
- <
947
- typename geometry::ring_type<GeometryOutput>::type,
948
- Strategies,
949
- DistanceStrategy,
950
- RobustPolicy
951
- > collection_type ;
945
+ using collection_type = detail::buffer::buffered_piece_collection
946
+ <
947
+ typename geometry::ring_type<GeometryOutput>::type,
948
+ Strategies,
949
+ DistanceStrategy,
950
+ RobustPolicy
951
+ > ;
952
952
collection_type collection (strategies, distance_strategy, robust_policy);
953
953
collection_type const & const_collection = collection;
954
954
955
- bool const areal = util::is_areal<GeometryInput>::value;
955
+ static constexpr bool areal = util::is_areal<GeometryInput>::value;
956
956
957
957
dispatch::buffer_inserter
958
958
<
@@ -969,7 +969,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
969
969
robust_policy, strategies);
970
970
971
971
collection.get_turns ();
972
- if ( BOOST_GEOMETRY_CONDITION ( areal) )
972
+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
973
973
{
974
974
collection.check_turn_in_original ();
975
975
}
@@ -989,7 +989,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
989
989
// phase 1: turns (after enrichment/clustering)
990
990
visit_pieces_policy.apply (const_collection, 1 );
991
991
992
- if ( BOOST_GEOMETRY_CONDITION ( areal) )
992
+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
993
993
{
994
994
collection.deflate_check_turns ();
995
995
}
@@ -1001,8 +1001,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
1001
1001
// - the output is counter clockwise
1002
1002
// and avoid reversing twice
1003
1003
bool reverse = distance_strategy.negative () && areal;
1004
- if (BOOST_GEOMETRY_CONDITION (
1005
- geometry::point_order<GeometryOutput>::value == counterclockwise))
1004
+ if BOOST_GEOMETRY_CONSTEXPR (geometry::point_order<GeometryOutput>::value == counterclockwise)
1006
1005
{
1007
1006
reverse = ! reverse;
1008
1007
}
@@ -1011,9 +1010,12 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
1011
1010
collection.reverse ();
1012
1011
}
1013
1012
1014
- if ( BOOST_GEOMETRY_CONDITION (distance_strategy. negative () && areal) )
1013
+ if BOOST_GEOMETRY_CONSTEXPR ( areal)
1015
1014
{
1016
- collection.discard_nonintersecting_deflated_rings ();
1015
+ if (distance_strategy.negative ())
1016
+ {
1017
+ collection.discard_nonintersecting_deflated_rings ();
1018
+ }
1017
1019
}
1018
1020
1019
1021
collection.template assign <GeometryOutput>(out);
0 commit comments