Skip to content

Commit f99ab49

Browse files
committed
Merge branch 'develop' into bg-prepare
2 parents 4a494b4 + 4f128c4 commit f99ab49

File tree

642 files changed

+13241
-11238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

642 files changed

+13241
-11238
lines changed

.github/workflows/minimal-clang.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@ jobs:
3232

3333
include:
3434
- b2_toolset: clang-3.9
35-
b2_cxxstd: 03,11
35+
b2_cxxstd: 14
3636
version: "3.9"
3737
- b2_toolset: clang-4.0
38-
b2_cxxstd: 03,11
38+
b2_cxxstd: 14
3939
version: "4.0"
4040
- b2_toolset: clang-5.0
41-
b2_cxxstd: 03,11,14
41+
b2_cxxstd: 14
4242
version: "5.0"
4343
- b2_toolset: clang-6.0
44-
b2_cxxstd: 03,11,14
44+
b2_cxxstd: 14
4545
version: "6.0"
4646
- b2_toolset: clang-7
47-
b2_cxxstd: 03,11,14,17
47+
b2_cxxstd: 14,17
4848
version: "7"
4949
- b2_toolset: clang-8
50-
b2_cxxstd: 03,11,14,17
50+
b2_cxxstd: 14,17
5151
version: "8"
5252
- b2_toolset: clang-9
53-
b2_cxxstd: 03,11,14,17,2a
53+
b2_cxxstd: 14,17,2a
5454
version: "9"
5555
- b2_toolset: clang-10
56-
b2_cxxstd: 03,11,14,17,2a
56+
b2_cxxstd: 14,17,2a
5757
version: "10"
5858

5959
steps:
@@ -91,6 +91,7 @@ jobs:
9191
9292
- name: Install
9393
run: |
94+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
9495
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
9596
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
9697
sudo apt -q -y update

.github/workflows/minimal-gcc.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
b2_toolset: [
23-
gcc-4.8,
24-
gcc-4.9,
2523
gcc-5,
2624
gcc-6,
2725
gcc-7,
@@ -30,26 +28,20 @@ jobs:
3028
]
3129

3230
include:
33-
- b2_toolset: gcc-4.8
34-
b2_cxxstd: 03,11
35-
version: "4.8"
36-
- b2_toolset: gcc-4.9
37-
b2_cxxstd: 03,11
38-
version: "4.9"
3931
- b2_toolset: gcc-5
40-
b2_cxxstd: 03,11,14
32+
b2_cxxstd: 14
4133
version: "5"
4234
- b2_toolset: gcc-6
43-
b2_cxxstd: 03,11,14
35+
b2_cxxstd: 14
4436
version: "6"
4537
- b2_toolset: gcc-7
46-
b2_cxxstd: 03,11,14,17
38+
b2_cxxstd: 14,17
4739
version: "7"
4840
- b2_toolset: gcc-8
49-
b2_cxxstd: 03,11,14,17
41+
b2_cxxstd: 14,17
5042
version: "8"
5143
- b2_toolset: gcc-9
52-
b2_cxxstd: 03,11,14,17,2a
44+
b2_cxxstd: 14,17,2a
5345
version: "9"
5446

5547
steps:

Jamfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
project boost-geometry
1212
:
1313
requirements
14-
<include>../../boost/geometry/extensions/contrib/ttmath
1514
<toolset>msvc:<asynch-exceptions>on
1615
;
1716

doc/concept/point.qbk

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,31 @@ The Point Concept is defined as following:
3333
* `get` to get a coordinate value
3434
* `set` to set a coordinate value (this one is not checked for ConstPoint)
3535

36+
[heading Example]
37+
38+
While you can `#include boost/geometry/geometries/adapted/std_array.hpp` to use `std::array<T, D>` to model the Point concept,
39+
the following code spells it out in detail, as you might use for your own point types:
40+
```
41+
namespace boost { namespace geometry { namespace traits
42+
{
43+
44+
template <typename T, std::size_t D> struct tag<std::array<T, D>> { using type = point_tag; };
45+
template <typename T, std::size_t D> struct dimension<std::array<T, D>> : boost::mpl::int_<D> {};
46+
template <typename T, std::size_t D> struct coordinate_type<std::array<T, D>> { using type = T; };
47+
template <typename T, std::size_t D> struct coordinate_system<std::array<T, D>> { using type = boost::geometry::cs::cartesian; };
48+
49+
template <typename T, std::size_t D, std::size_t Index>
50+
struct access<std::array<T, D>, Index> {
51+
static_assert(Index < D, "Out of range");
52+
using Point = std::array<T, D>;
53+
using CoordinateType = typename coordinate_type<Point>::type;
54+
static inline CoordinateType get(Point const& p) { return p[Index]; }
55+
static inline void set(Point& p, CoordinateType const& value) { p[Index] = value; }
56+
};
57+
58+
}}} // namespace boost::geometry::traits
59+
```
60+
3661
[heading Available Models]
3762
* [link geometry.reference.models.model_point model::point]
3863
* [link geometry.reference.models.model_d2_point_xy model::d2::point_xy]

doc/doxy/doxygen_input/pages/doxygen_d_robustness.hpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,7 @@ a <a href="http://en.wikipedia.org/wiki/Long_double">long double</a>, not standa
5757
5858
By default, algorithms select the coordinate type of the input geometries. If there are two input geometries, and they have different coordinate types, the coordinate type with the most precision is selected. This is done by the meta-function \b select_most_precise.
5959
60-
Boost.Geometry supports also high precision arithmetic types, by adaption. The numeric_adaptor, used for adaption, is not part of Boost.Geometry itself but developed by us and sent (as preview) to the Boost List (as it turned out, that functionality might also be provided by Boost.Math bindings, but the mechanism is the same). Types from the following libraries are supported:
61-
62-
- GMP (http://gmplib.org)
63-
- CLN (http://www.ginac.de/CLN)
64-
65-
Note that the libraries themselves are not included in Boost.Geometry, they are completely independant of each other.
66-
67-
These numeric types can be used as following:
68-
\code
69-
boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> p4;
70-
boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> p5;
71-
\endcode
72-
73-
All algorithms using these points will use the \b GMP resp. \b CLN library for calculations.
60+
Boost.Geometry supports also high precision arithmetic types, by adaption. For example from Boost.Multiprecision.
7461
7562
\section robustness_par4 Calculation types
7663
@@ -81,21 +68,21 @@ If high precision arithmetic types are used as shown above, coordinates are stor
8168
8269
\code
8370
{
84-
typedef boost::geometry::point_xy<double> point_type;
85-
boost::geometry::linear_ring<point_type> ring;
71+
using point_type = bg::model::point<default_test_type, 2, bg::cs::cartesian> ;
72+
boost::geometry::model::ring<point_type> ring;
8673
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0));
8774
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0012));
8875
ring.push_back(boost::geometry::make<point_type>(1234567.89012345, 0.0));
8976
ring.push_back(ring.front());
9077
91-
typedef boost::numeric_adaptor::gmp_value_type gmp;
78+
using mp = boost::multiprecision::cpp_bin_float_100;
9279
93-
gmp area = boost::geometry::area(ring, boost::geometry::strategy::area::by_triangles<point_type, gmp>());
80+
auto area = boost::geometry::area(ring, boost::geometry::strategies::area::cartesian<mp>());
9481
std::cout << area << std::endl;
9582
}
9683
\endcode
9784
98-
Above shows how this is used to use \b GMP or \b CLN for double coordinates. Exactly the same mechanism works (of course) also to do calculation in double, where coordinates are stored in float.
85+
Above shows how this is used to use Boost.Multiprecision with double coordinates. Exactly the same mechanism works (of course) also to do calculation in double, where coordinates are stored in float.
9986
10087
\section robustness_par5 Strategies
10188

doc/src/examples/algorithms/assign_2d_point.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@
88
// http://www.boost.org/LICENSE_1_0.txt)
99

1010
//[assign_2d_point
11-
//` Shows the usage of assign to set point coordinates, and, besides that, shows how you can initialize ttmath points with high precision
11+
//` Shows the usage of assign to set point coordinates
1212

1313
#include <iostream>
1414
#include <iomanip>
1515

1616
#include <boost/geometry.hpp>
1717
#include <boost/geometry/geometries/point_xy.hpp>
1818

19-
#if defined(HAVE_TTMATH)
20-
# include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
21-
#endif
22-
23-
2419
int main()
2520
{
2621
using boost::geometry::assign_values;
@@ -29,21 +24,9 @@ int main()
2924
boost::geometry::model::d2::point_xy<double> p1;
3025
assign_values(p1, 1.2345, 2.3456);
3126

32-
#if defined(HAVE_TTMATH)
33-
boost::geometry::model::d2::point_xy<ttmath::Big<1,4> > p2;
34-
assign_values(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type.
35-
For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because
36-
if doubles are used for assignments the double-precision is used.
37-
>*/
38-
#endif
39-
4027
std::cout
4128
<< std::setprecision(20)
42-
<< boost::geometry::dsv(p1) << std::endl
43-
#if defined(HAVE_TTMATH)
44-
<< boost::geometry::dsv(p2) << std::endl
45-
#endif
46-
;
29+
<< boost::geometry::dsv(p1) << std::endl;
4730

4831
return 0;
4932
}

include/boost/geometry/algorithms/append.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
55
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
66

7-
// This file was modified by Oracle on 2014.
8-
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
9-
7+
// This file was modified by Oracle on 2014-2020.
8+
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
109
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
1110
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
1211

@@ -21,7 +20,9 @@
2120
#define BOOST_GEOMETRY_ALGORITHMS_APPEND_HPP
2221

2322

24-
#include <boost/range.hpp>
23+
#include <boost/range/begin.hpp>
24+
#include <boost/range/end.hpp>
25+
#include <boost/range/value_type.hpp>
2526

2627
#include <boost/variant/apply_visitor.hpp>
2728
#include <boost/variant/static_visitor.hpp>

include/boost/geometry/algorithms/area.hpp

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
66
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
77

8-
// This file was modified by Oracle on 2017, 2018.
9-
// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
8+
// This file was modified by Oracle on 2017-2020.
9+
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
1010
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
1111

1212
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
@@ -21,8 +21,10 @@
2121

2222
#include <boost/concept_check.hpp>
2323
#include <boost/core/ignore_unused.hpp>
24-
#include <boost/range/functions.hpp>
25-
#include <boost/range/metafunctions.hpp>
24+
#include <boost/range/begin.hpp>
25+
#include <boost/range/end.hpp>
26+
#include <boost/range/size.hpp>
27+
#include <boost/range/value_type.hpp>
2628

2729
#include <boost/variant/apply_visitor.hpp>
2830
#include <boost/variant/static_visitor.hpp>
@@ -43,10 +45,12 @@
4345
// #include <boost/geometry/algorithms/detail/throw_on_empty_input.hpp>
4446
#include <boost/geometry/algorithms/detail/multi_sum.hpp>
4547

46-
#include <boost/geometry/strategies/area.hpp>
47-
#include <boost/geometry/strategies/area_result.hpp>
48-
#include <boost/geometry/strategies/default_area_result.hpp>
48+
#include <boost/geometry/algorithms/area_result.hpp>
49+
#include <boost/geometry/algorithms/default_area_result.hpp>
50+
51+
#include <boost/geometry/strategies/area/services.hpp>
4952
#include <boost/geometry/strategies/default_strategy.hpp>
53+
#include <boost/geometry/strategy/area.hpp>
5054

5155
#include <boost/geometry/strategies/concepts/area_concept.hpp>
5256

@@ -86,23 +90,25 @@ template
8690
>
8791
struct ring_area
8892
{
89-
template <typename Ring, typename Strategy>
90-
static inline typename area_result<Ring, Strategy>::type
91-
apply(Ring const& ring, Strategy const& strategy)
93+
template <typename Ring, typename Strategies>
94+
static inline typename area_result<Ring, Strategies>::type
95+
apply(Ring const& ring, Strategies const& strategies)
9296
{
93-
BOOST_CONCEPT_ASSERT( (geometry::concepts::AreaStrategy<Ring, Strategy>) );
97+
using strategy_type = decltype(strategies.area(ring));
98+
99+
BOOST_CONCEPT_ASSERT( (geometry::concepts::AreaStrategy<Ring, strategy_type>) );
94100
assert_dimension<Ring, 2>();
95101

96102
// Ignore warning (because using static method sometimes) on strategy
97-
boost::ignore_unused(strategy);
103+
boost::ignore_unused(strategies);
98104

99105
// An open ring has at least three points,
100106
// A closed ring has at least four points,
101107
// if not, there is no (zero) area
102108
if (boost::size(ring)
103109
< core_detail::closure::minimum_ring_size<Closure>::value)
104110
{
105-
return typename area_result<Ring, Strategy>::type();
111+
return typename area_result<Ring, Strategies>::type();
106112
}
107113

108114
typedef typename reversible_view<Ring const, Direction>::type rview_type;
@@ -114,10 +120,12 @@ struct ring_area
114120

115121
rview_type rview(ring);
116122
view_type view(rview);
117-
typename Strategy::template state<Ring> state;
118123
iterator_type it = boost::begin(view);
119124
iterator_type end = boost::end(view);
120125

126+
strategy_type strategy = strategies.area(ring);
127+
typename strategy_type::template state<Ring> state;
128+
121129
for (iterator_type previous = it++;
122130
it != end;
123131
++previous, ++it)
@@ -216,7 +224,11 @@ struct area<MultiGeometry, multi_polygon_tag> : detail::multi_sum
216224
namespace resolve_strategy
217225
{
218226

219-
template <typename Strategy>
227+
template
228+
<
229+
typename Strategy,
230+
bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
231+
>
220232
struct area
221233
{
222234
template <typename Geometry>
@@ -227,16 +239,30 @@ struct area
227239
}
228240
};
229241

242+
template <typename Strategy>
243+
struct area<Strategy, false>
244+
{
245+
template <typename Geometry>
246+
static auto apply(Geometry const& geometry, Strategy const& strategy)
247+
{
248+
using strategies::area::services::strategy_converter;
249+
return dispatch::area
250+
<
251+
Geometry
252+
>::apply(geometry, strategy_converter<Strategy>::get(strategy));
253+
}
254+
};
255+
230256
template <>
231-
struct area<default_strategy>
257+
struct area<default_strategy, false>
232258
{
233259
template <typename Geometry>
234260
static inline typename area_result<Geometry>::type
235261
apply(Geometry const& geometry, default_strategy)
236262
{
237-
typedef typename strategy::area::services::default_strategy
263+
typedef typename strategies::area::services::default_strategy
238264
<
239-
typename cs_tag<Geometry>::type
265+
Geometry
240266
>::type strategy_type;
241267

242268
return dispatch::area<Geometry>::apply(geometry, strategy_type());

0 commit comments

Comments
 (0)