Merge remote-tracking branch 'origin/develop' into feature/robust_convex_hull

This commit is contained in:
Vissarion Fysikopoulos 2020-10-16 10:47:24 +03:00
commit 02f52eca68
526 changed files with 4919 additions and 30146 deletions

View File

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

View File

@ -20,7 +20,6 @@ jobs:
fail-fast: false
matrix:
b2_toolset: [
gcc-4.9,
gcc-5,
gcc-6,
gcc-7,
@ -29,9 +28,6 @@ jobs:
]
include:
- b2_toolset: gcc-4.9
b2_cxxstd: 14
version: "4.9"
- b2_toolset: gcc-5
b2_cxxstd: 14
version: "5"

View File

@ -11,7 +11,6 @@
project boost-geometry
:
requirements
<include>../../boost/geometry/extensions/contrib/ttmath
<toolset>msvc:<asynch-exceptions>on
;

View File

@ -57,20 +57,7 @@ a <a href="http://en.wikipedia.org/wiki/Long_double">long double</a>, not standa
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.
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:
- GMP (http://gmplib.org)
- CLN (http://www.ginac.de/CLN)
Note that the libraries themselves are not included in Boost.Geometry, they are completely independant of each other.
These numeric types can be used as following:
\code
boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> p4;
boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> p5;
\endcode
All algorithms using these points will use the \b GMP resp. \b CLN library for calculations.
Boost.Geometry supports also high precision arithmetic types, by adaption. For example from Boost.Multiprecision.
\section robustness_par4 Calculation types
@ -81,21 +68,21 @@ Example:
\code
{
typedef boost::geometry::point_xy<double> point_type;
boost::geometry::linear_ring<point_type> ring;
using point_type = bg::model::point<default_test_type, 2, bg::cs::cartesian> ;
boost::geometry::model::ring<point_type> ring;
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0));
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0012));
ring.push_back(boost::geometry::make<point_type>(1234567.89012345, 0.0));
ring.push_back(ring.front());
typedef boost::numeric_adaptor::gmp_value_type gmp;
using mp = boost::multiprecision::cpp_bin_float_100;
gmp area = boost::geometry::area(ring, boost::geometry::strategy::area::by_triangles<point_type, gmp>());
auto area = boost::geometry::area(ring, boost::geometry::strategies::area::cartesian<mp>());
std::cout << area << std::endl;
}
\endcode
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.
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.
\section robustness_par5 Strategies

View File

@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//[assign_2d_point
//` Shows the usage of assign to set point coordinates, and, besides that, shows how you can initialize ttmath points with high precision
//` Shows the usage of assign to set point coordinates
#include <iostream>
#include <iomanip>
@ -16,11 +16,6 @@
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#if defined(HAVE_TTMATH)
# include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
#endif
int main()
{
using boost::geometry::assign_values;
@ -29,21 +24,9 @@ int main()
boost::geometry::model::d2::point_xy<double> p1;
assign_values(p1, 1.2345, 2.3456);
#if defined(HAVE_TTMATH)
boost::geometry::model::d2::point_xy<ttmath::Big<1,4> > p2;
assign_values(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type.
For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because
if doubles are used for assignments the double-precision is used.
>*/
#endif
std::cout
<< std::setprecision(20)
<< boost::geometry::dsv(p1) << std::endl
#if defined(HAVE_TTMATH)
<< boost::geometry::dsv(p2) << std::endl
#endif
;
<< boost::geometry::dsv(p1) << std::endl;
return 0;
}

View File

@ -11,7 +11,6 @@
project boost-geometry-extensions
:
requirements
<include>../../../boost/geometry/extensions/contrib/ttmath
<toolset>msvc:<asynch-exceptions>on
;

View File

@ -15,7 +15,6 @@ project boost-geometry-extensions-test
:
requirements
<include>../../test
<include>../../../boost/geometry/extensions/contrib/ttmath
<toolset>msvc:<asynch-exceptions>on
<toolset>msvc:<cxxflags>/bigobj
<host-os>windows,<toolset>intel:<cxxflags>/bigobj

View File

@ -118,9 +118,5 @@ int test_main(int, char* [])
//test_all<bg::model::d2::point_xy<float> >();
test_all<bg::model::d2::point_xy<double> >();
#if defined(HAVE_TTMATH)
test_all<bg::model::d2::point_xy<ttmath_big> >();
#endif
return 0;
}

View File

@ -120,10 +120,5 @@ int test_main(int, char* [])
{
test_all<bg::model::point<double, 2, bg::cs::geographic<bg::degree> > >();
#if defined(HAVE_TTMATH)
typedef ttmath::Big<1,4> tt;
test_all<bg::model::point<tt, 2, bg::cs::geographic<bg::degree> > >();
#endif
return 0;
}

View File

@ -21,8 +21,9 @@
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/range/functions.hpp>
#include <boost/range/metafunctions.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/value_type.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@ -14,6 +14,8 @@
#define BOOST_GEOMETRY_STRATEGY_AREA_RESULT_HPP
#include <type_traits>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/cs.hpp>
@ -23,11 +25,8 @@
#include <boost/geometry/strategy/area.hpp>
#include <boost/geometry/util/select_most_precise.hpp>
#include <boost/geometry/util/select_sequence_element.hpp>
#include <boost/geometry/util/sequence.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant/variant_fwd.hpp>
@ -47,9 +46,10 @@ template
bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
>
struct area_result
: decltype(std::declval<Strategy>().area(std::declval<Geometry>()))
::template result_type<Geometry>
{};
{
typedef decltype(std::declval<Strategy>().area(std::declval<Geometry>())) strategy_type;
typedef typename strategy_type::template result_type<Geometry>::type type;
};
template
<
@ -61,6 +61,46 @@ struct area_result<Geometry, Strategy, false>
{};
template <typename Geometry>
struct default_area_result
: area_result
<
Geometry,
typename geometry::strategies::area::services::default_strategy
<
Geometry
>::type
>
{};
template <typename Curr, typename Next>
struct more_precise_coordinate_type
: std::is_same
<
typename geometry::coordinate_type<Curr>::type,
typename geometry::select_most_precise
<
typename geometry::coordinate_type<Curr>::type,
typename geometry::coordinate_type<Next>::type
>::type
>
{};
template <typename Curr, typename Next>
struct more_precise_default_area_result
: std::is_same
<
typename default_area_result<Curr>::type,
typename geometry::select_most_precise
<
typename default_area_result<Curr>::type,
typename default_area_result<Next>::type
>::type
>
{};
}} // namespace detail::area
#endif //DOXYGEN_NO_DETAIL
@ -79,13 +119,14 @@ struct area_result
: detail::area::area_result<Geometry, Strategy>
{};
template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Strategy>
struct area_result<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Strategy>
template <typename ...Ts, typename Strategy>
struct area_result<boost::variant<Ts...>, Strategy>
: geometry::area_result
<
typename geometry::util::select_sequence_element
typename util::select_pack_element
<
typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types
detail::area::more_precise_coordinate_type,
Ts...
>::type,
Strategy
>
@ -93,53 +134,17 @@ struct area_result<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Strategy>
template <typename Geometry>
struct area_result<Geometry, default_strategy>
: geometry::area_result
<
Geometry,
typename geometry::strategies::area::services::default_strategy
<
Geometry
>::type
>
: detail::area::default_area_result<Geometry>
{};
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace area
{
template <typename Curr, typename Next>
struct pred_more_precise_default_area_result
{
typedef typename geometry::area_result<Curr, default_strategy>::type curr_result_t;
typedef typename geometry::area_result<Next, default_strategy>::type next_result_t;
typedef typename boost::mpl::if_c
<
boost::is_same
<
curr_result_t,
typename geometry::select_most_precise
<
curr_result_t,
next_result_t
>::type
>::value,
Curr,
Next
>::type type;
};
}} // namespace detail::area
#endif //DOXYGEN_NO_DETAIL
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct area_result<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, default_strategy>
template <typename ...Ts>
struct area_result<boost::variant<Ts...>, default_strategy>
: geometry::area_result
<
typename geometry::util::select_sequence_element
typename util::select_pack_element
<
typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types,
geometry::detail::area::pred_more_precise_default_area_result
detail::area::more_precise_default_area_result,
Ts...
>::type,
default_strategy
>

View File

@ -5,6 +5,10 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Samuel Debionne, Grenoble, France.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -20,8 +24,6 @@
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
@ -38,6 +40,7 @@
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@ -233,20 +236,16 @@ struct assign
static bool const same_point_order
= point_order<Geometry1>::value == point_order<Geometry2>::value;
BOOST_MPL_ASSERT_MSG
(
(same_point_order),
ASSIGN_IS_NOT_SUPPORTED_FOR_DIFFERENT_POINT_ORDER,
(types<Geometry1, Geometry2>)
);
BOOST_GEOMETRY_STATIC_ASSERT(
same_point_order,
"Assign is not supported for different point orders.",
Geometry1, Geometry2);
static bool const same_closure
= closure<Geometry1>::value == closure<Geometry2>::value;
BOOST_MPL_ASSERT_MSG
(
(same_closure),
ASSIGN_IS_NOT_SUPPORTED_FOR_DIFFERENT_CLOSURE,
(types<Geometry1, Geometry2>)
);
BOOST_GEOMETRY_STATIC_ASSERT(
same_closure,
"Assign is not supported for different closures.",
Geometry1, Geometry2);
dispatch::convert<Geometry2, Geometry1>::apply(geometry2, geometry1);
}

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -15,7 +19,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_CLEAR_HPP
#include <boost/type_traits/remove_const.hpp>
#include <type_traits>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
@ -54,14 +58,14 @@ struct polygon_clear
{
traits::clear
<
typename boost::remove_reference
typename std::remove_reference
<
typename traits::interior_mutable_type<Polygon>::type
>::type
>::apply(interior_rings(polygon));
traits::clear
<
typename boost::remove_reference
typename std::remove_reference
<
typename traits::ring_mutable_type<Polygon>::type
>::type

View File

@ -21,11 +21,10 @@
#include <cstddef>
#include <type_traits>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
@ -226,7 +225,7 @@ struct polygon_to_polygon
// Container should be resizeable
traits::resize
<
typename boost::remove_reference
typename std::remove_reference
<
typename traits::interior_mutable_type<Polygon2>::type
>::type
@ -295,10 +294,15 @@ template
typename Tag1 = typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
typename Tag2 = typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
std::size_t DimensionCount = dimension<Geometry1>::type::value,
bool UseAssignment = boost::is_same<Geometry1, Geometry2>::value
&& !boost::is_array<Geometry1>::value
bool UseAssignment = std::is_same<Geometry1, Geometry2>::value
&& !std::is_array<Geometry1>::value
>
struct convert: not_implemented<Tag1, Tag2, boost::mpl::int_<DimensionCount> >
struct convert
: not_implemented
<
Tag1, Tag2,
std::integral_constant<std::size_t, DimensionCount>
>
{};
@ -456,7 +460,7 @@ struct convert<Polygon, Ring, polygon_tag, ring_tag, DimensionCount, false>
// Dispatch for multi <-> multi, specifying their single-version as policy.
// Note that, even if the multi-types are mutually different, their single
// version types might be the same and therefore we call boost::is_same again
// version types might be the same and therefore we call std::is_same again
template <typename Multi1, typename Multi2, std::size_t DimensionCount>
struct convert<Multi1, Multi2, multi_tag, multi_tag, DimensionCount, false>

View File

@ -24,9 +24,7 @@
#include <cstddef>
#include <functional>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -19,8 +23,6 @@
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
namespace boost { namespace geometry
{
@ -31,22 +33,20 @@ namespace dispatch
{
template <typename GeometryTag, typename Geometry, typename Range, bool IsConst>
template <typename GeometryTag, typename Geometry, typename Range>
struct as_range
{
static inline typename add_const_if_c<IsConst, Range>::type& get(
typename add_const_if_c<IsConst, Geometry>::type& input)
static inline Range& get(Geometry& input)
{
return input;
}
};
template <typename Geometry, typename Range, bool IsConst>
struct as_range<polygon_tag, Geometry, Range, IsConst>
template <typename Geometry, typename Range>
struct as_range<polygon_tag, Geometry, Range>
{
static inline typename add_const_if_c<IsConst, Range>::type& get(
typename add_const_if_c<IsConst, Geometry>::type& input)
static inline Range& get(Geometry& input)
{
return exterior_ring(input);
}
@ -73,8 +73,7 @@ inline Range& as_range(Geometry& input)
<
typename tag<Geometry>::type,
Geometry,
Range,
false
Range
>::get(input);
}
@ -91,9 +90,8 @@ inline Range const& as_range(Geometry const& input)
return dispatch::as_range
<
typename tag<Geometry>::type,
Geometry,
Range,
true
Geometry const,
Range const
>::get(input);
}

View File

@ -7,10 +7,11 @@
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2018.
// Modifications copyright (c) 2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2018-2020.
// Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -21,11 +22,10 @@
#include <cstddef>
#include <type_traits>
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
@ -34,11 +34,11 @@
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/is_inverse_spheroidal_coordinates.hpp>
#include <boost/geometry/util/for_each_coordinate.hpp>
@ -254,11 +254,9 @@ namespace dispatch
template <typename GeometryTag, typename Geometry, std::size_t DimensionCount>
struct assign
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this Geometry type.",
GeometryTag, Geometry, std::integral_constant<std::size_t, DimensionCount>);
};
template <typename Point>

View File

@ -2,8 +2,8 @@
// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2017.
// Modifications copyright (c) 2017 Oracle and/or its affiliates.
// This file was modified by Oracle on 2017-2020.
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
@ -16,21 +16,10 @@
#include <cstddef>
#include <iterator>
#include <boost/core/ignore_unused.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/strategies/buffer.hpp>
#include <boost/geometry/strategies/side.hpp>
#include <boost/geometry/algorithms/detail/direction_code.hpp>
#include <boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp>
#include <boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp>
@ -38,6 +27,18 @@
#include <boost/geometry/algorithms/num_interior_rings.hpp>
#include <boost/geometry/algorithms/simplify.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/strategies/buffer.hpp>
#include <boost/geometry/strategies/side.hpp>
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/type_traits.hpp>
#include <boost/geometry/views/detail/normalized_view.hpp>
@ -148,19 +149,19 @@ struct buffer_range
{
// The corner is convex, we create a join
// TODO (future) - avoid a separate vector, add the piece directly
output_point_type const
intersection_point
= line_line_intersection::apply(perp1, perp2,
prev_perp1, prev_perp2);
std::vector<output_point_type> range_out;
if (join_strategy.apply(intersection_point,
previous_input, prev_perp2, perp1,
distance.apply(previous_input, input, side),
range_out))
output_point_type intersection_point;
if (line_line_intersection::apply(perp1, perp2,
prev_perp1, prev_perp2, intersection_point))
{
collection.add_piece(geometry::strategy::buffer::buffered_join,
previous_input, range_out);
std::vector<output_point_type> range_out;
if (join_strategy.apply(intersection_point,
previous_input, prev_perp2, perp1,
distance.apply(previous_input, input, side),
range_out))
{
collection.add_piece(geometry::strategy::buffer::buffered_join,
previous_input, range_out);
}
}
}
break;
@ -942,11 +943,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
collection_type collection(intersection_strategy, distance_strategy, robust_policy);
collection_type const& const_collection = collection;
bool const areal = boost::is_same
<
typename tag_cast<typename tag<GeometryInput>::type, areal_tag>::type,
areal_tag
>::type::value;
bool const areal = util::is_areal<GeometryInput>::value;
dispatch::buffer_inserter
<

View File

@ -198,6 +198,7 @@ struct piece_get_box
template <typename Box, typename Piece>
static inline void apply(Box& total, Piece const& piece)
{
assert_coordinate_type_equal(total, piece.m_piece_border.m_envelope);
typedef typename strategy::expand::services::default_strategy
<
box_tag, typename cs_tag<Box>::type
@ -212,11 +213,13 @@ struct piece_get_box
};
template <typename DisjointBoxBoxStrategy>
struct piece_ovelaps_box
struct piece_overlaps_box
{
template <typename Box, typename Piece>
static inline bool apply(Box const& box, Piece const& piece)
{
assert_coordinate_type_equal(box, piece.m_piece_border.m_envelope);
if (piece.type == strategy::buffer::buffered_flat_end
|| piece.type == strategy::buffer::buffered_concave)
{
@ -245,16 +248,18 @@ struct turn_get_box
<
point_tag, typename cs_tag<Box>::type
>::type expand_strategy_type;
assert_coordinate_type_equal(total, turn.point);
geometry::expand(total, turn.point, expand_strategy_type());
}
};
template <typename DisjointPointBoxStrategy>
struct turn_ovelaps_box
struct turn_overlaps_box
{
template <typename Box, typename Turn>
static inline bool apply(Box const& box, Turn const& turn)
{
assert_coordinate_type_equal(turn.point, box);
return ! geometry::detail::disjoint::disjoint_point_box(turn.point, box,
DisjointPointBoxStrategy());
}

View File

@ -3,8 +3,8 @@
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2016-2019.
// Modifications copyright (c) 2016-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2016-2020.
// Modifications copyright (c) 2016-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
@ -57,8 +57,6 @@
#include <boost/geometry/views/detail/normalized_view.hpp>
#include <boost/geometry/util/range.hpp>
// TODO remove this
#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
namespace boost { namespace geometry
{
@ -124,7 +122,7 @@ struct buffered_piece_collection
typedef typename geometry::point_type<Ring>::type point_type;
typedef typename geometry::coordinate_type<Ring>::type coordinate_type;
// Robust ring/polygon type, always clockwise
// Ring/polygon type, always clockwise
typedef geometry::model::ring<point_type> clockwise_ring_type;
typedef geometry::model::box<point_type> box_type;
@ -243,7 +241,7 @@ struct buffered_piece_collection
// The dimension is critical because the direction is later used
// in the optimization for within checks using winding strategy
// and this strategy is scanning in x direction.
typedef boost::mpl::vector_c<std::size_t, 0> dimensions;
typedef std::integer_sequence<std::size_t, 0> dimensions;
geometry::sectionalize<false, dimensions>(m_ring,
detail::no_rescale_policy(), m_sections,
envelope_strategy, expand_strategy);
@ -274,10 +272,15 @@ struct buffered_piece_collection
buffered_ring_collection<Ring> traversed_rings;
segment_identifier current_segment_id;
// Specificly for offsetted rings around points
// but also for large joins with many points
typedef geometry::sections<box_type, 2> sections_type;
sections_type monotonic_sections;
// Monotonic sections (used for offsetted rings around points)
// are still using a robust type, to be comparable with turn calculations,
// which is using rescaling.
typedef geometry::model::box
<
typename geometry::robust_point_type<point_type, RobustPolicy>::type
> robust_box_type;
typedef geometry::sections <robust_box_type, 2> robust_sections_type;
robust_sections_type monotonic_sections;
// Define the clusters, mapping cluster_id -> turns
typedef std::map
@ -461,14 +464,14 @@ struct buffered_piece_collection
// Check if a turn is inside any of the originals
inline void check_turn_in_original()
{
typedef turn_in_original_ovelaps_box
typedef turn_in_original_overlaps_box
<
typename IntersectionStrategy::disjoint_point_box_strategy_type
> turn_in_original_ovelaps_box_type;
typedef original_ovelaps_box
> turn_in_original_overlaps_box_type;
typedef original_overlaps_box
<
typename IntersectionStrategy::disjoint_box_box_strategy_type
> original_ovelaps_box_type;
> original_overlaps_box_type;
turn_in_original_visitor
<
@ -482,8 +485,8 @@ struct buffered_piece_collection
include_turn_policy,
detail::partition::include_all_policy
>::apply(m_turns, original_rings, visitor,
turn_get_box(), turn_in_original_ovelaps_box_type(),
original_get_box(), original_ovelaps_box_type());
turn_get_box(), turn_in_original_overlaps_box_type(),
original_get_box(), original_overlaps_box_type());
bool const deflate = m_distance_strategy.negative();
@ -591,7 +594,7 @@ struct buffered_piece_collection
m_envelope_strategy);
geometry::partition
<
box_type
robust_box_type
>::apply(monotonic_sections, visitor,
get_section_box_type(),
overlaps_section_box_type());
@ -607,21 +610,21 @@ struct buffered_piece_collection
turn_vector_type, piece_vector_type, DistanceStrategy
> visitor(m_turns, m_pieces, m_distance_strategy);
typedef turn_ovelaps_box
typedef turn_overlaps_box
<
typename IntersectionStrategy::disjoint_point_box_strategy_type
> turn_ovelaps_box_type;
typedef piece_ovelaps_box
> turn_overlaps_box_type;
typedef piece_overlaps_box
<
typename IntersectionStrategy::disjoint_box_box_strategy_type
> piece_ovelaps_box_type;
> piece_overlaps_box_type;
geometry::partition
<
box_type
>::apply(m_turns, m_pieces, visitor,
turn_get_box(), turn_ovelaps_box_type(),
piece_get_box(), piece_ovelaps_box_type());
turn_get_box(), turn_overlaps_box_type(),
piece_get_box(), piece_overlaps_box_type());
}
}
@ -851,7 +854,7 @@ struct buffered_piece_collection
typedef geometry::detail::sectionalize::sectionalize_part
<
point_type,
boost::mpl::vector_c<std::size_t, 0, 1> // x,y dimension
std::integer_sequence<std::size_t, 0, 1> // x,y dimension
> sectionalizer;
// Create a ring-identifier. The source-index is the piece index

View File

@ -149,7 +149,6 @@ class piece_turn_visitor
return ! m_rings[piece1.first_seg_id.multi_index].has_concave;
}
template <std::size_t Dimension, typename Iterator, typename Box>
inline void move_begin_iterator(Iterator& it_begin, Iterator it_beyond,
signed_size_type& index, int dir,

View File

@ -24,12 +24,13 @@ namespace boost { namespace geometry
namespace detail { namespace buffer
{
// TODO: it might once be changed this to proper strategy
// TODO: this might once be changed to a proper strategy
struct line_line_intersection
{
template <typename Point>
static inline Point
apply(Point const& pi, Point const& pj, Point const& qi, Point const& qj)
static inline bool
apply(Point const& pi, Point const& pj, Point const& qi, Point const& qj,
Point& ip)
{
typedef typename coordinate_type<Point>::type ct;
typedef model::infinite_line<ct> line_type;
@ -39,12 +40,7 @@ struct line_line_intersection
// The input lines are not parallel, they intersect, because
// their join type is checked before.
Point ip;
bool const intersecting = arithmetic::intersection_point(p, q, ip);
BOOST_GEOMETRY_ASSERT(intersecting);
boost::ignore_unused(intersecting);
return ip;
return arithmetic::intersection_point(p, q, ip);
}
};

View File

@ -15,6 +15,7 @@
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/algorithms/detail/buffer/buffer_policies.hpp>
#include <boost/geometry/algorithms/expand.hpp>
@ -35,6 +36,7 @@ struct original_get_box
template <typename Box, typename Original>
static inline void apply(Box& total, Original const& original)
{
assert_coordinate_type_equal(total, original.m_box);
typedef typename strategy::expand::services::default_strategy
<
box_tag, typename cs_tag<Box>::type
@ -45,11 +47,12 @@ struct original_get_box
};
template <typename DisjointBoxBoxStrategy>
struct original_ovelaps_box
struct original_overlaps_box
{
template <typename Box, typename Original>
static inline bool apply(Box const& box, Original const& original)
{
assert_coordinate_type_equal(box, original.m_box);
return ! detail::disjoint::disjoint_box_box(box, original.m_box,
DisjointBoxBoxStrategy());
}
@ -65,7 +68,7 @@ struct include_turn_policy
};
template <typename DisjointPointBoxStrategy>
struct turn_in_original_ovelaps_box
struct turn_in_original_overlaps_box
{
template <typename Box, typename Turn>
static inline bool apply(Box const& box, Turn const& turn)

View File

@ -13,11 +13,10 @@
#include <vector>
#include <boost/mpl/assert.hpp>
#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/radian_access.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/strategies/geographic/point_order.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/range.hpp>
@ -323,10 +322,9 @@ template
>
struct calculate_point_order
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_TAG, (types<VersionTag>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this VersionTag.",
VersionTag);
};
template <typename Strategy>

View File

@ -2,8 +2,8 @@
// Copyright (c) 2015-2020 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2015, 2017, 2019.
// Modifications copyright (c) 2015-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2015-2020.
// Modifications copyright (c) 2015-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,15 +16,16 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DIRECTION_CODE_HPP
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/arithmetic/infinite_line_functions.hpp>
#include <boost/geometry/algorithms/detail/make/make.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>
#include <boost/geometry/util/normalize_spheroidal_coordinates.hpp>
#include <boost/mpl/assert.hpp>
namespace boost { namespace geometry
{
@ -37,7 +38,9 @@ namespace detail
template <typename CSTag>
struct direction_code_impl
{
BOOST_MPL_ASSERT_MSG((false), NOT_IMPLEMENTED_FOR_THIS_CS, (CSTag));
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this coordinate system.",
CSTag);
};
template <>
@ -91,9 +94,10 @@ struct direction_code_impl<spherical_equatorial_tag>
typedef typename coordinate_type<Point2>::type coord2_t;
typedef typename cs_angular_units<Point1>::type units_t;
typedef typename cs_angular_units<Point2>::type units2_t;
BOOST_MPL_ASSERT_MSG((boost::is_same<units_t, units2_t>::value),
NOT_IMPLEMENTED_FOR_DIFFERENT_UNITS,
(units_t, units2_t));
BOOST_GEOMETRY_STATIC_ASSERT(
(std::is_same<units_t, units2_t>::value),
"Not implemented for different units.",
units_t, units2_t);
typedef typename geometry::select_coordinate_type <Point1, Point2>::type calc_t;
typedef math::detail::constants_on_spheroid<coord1_t, units_t> constants1;
@ -223,16 +227,16 @@ struct direction_code_impl<spherical_tag>
{
return direction_code_impl
<
typename boost::mpl::if_c
std::conditional_t
<
boost::is_same
std::is_same
<
typename geometry::cs_tag<Point1>::type,
spherical_polar_tag
>::value,
spherical_polar_tag,
spherical_equatorial_tag
>::type
>
>::apply(segment_a, segment_b, p);
}
};

View File

@ -15,8 +15,10 @@
#include <algorithm>
#include <vector>
#include <boost/range.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/tag.hpp>

View File

@ -6,8 +6,8 @@
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2014 Samuel Debionne, Grenoble, France.
// This file was modified by Oracle on 2014, 2018.
// Modifications copyright (c) 2014-2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -24,10 +24,6 @@
#include <boost/concept_check.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>

View File

@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014, Oracle and/or its affiliates.
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@ -10,7 +11,8 @@
#ifndef BOOST_GEOMETRY_ALGORITHS_DETAIL_DISTANCE_IS_COMPARABLE_HPP
#define BOOST_GEOMETRY_ALGORITHS_DETAIL_DISTANCE_IS_COMPARABLE_HPP
#include <boost/type_traits/is_same.hpp>
#include <type_traits>
#include <boost/geometry/strategies/distance.hpp>
@ -26,7 +28,7 @@ namespace detail { namespace distance
// metafunction to determine is a strategy is comparable or not
template <typename Strategy>
struct is_comparable
: boost::is_same
: std::is_same
<
Strategy,
typename strategy::distance::services::comparable_type

View File

@ -5,8 +5,8 @@
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2014, 2019.
// Modifications copyright (c) 2014-2019, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -22,10 +22,10 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_POINT_TO_GEOMETRY_HPP
#include <iterator>
#include <type_traits>
#include <boost/core/ignore_unused.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/point_type.hpp>
@ -259,7 +259,7 @@ template
typename Point,
typename MultiGeometry,
typename Strategy,
bool CheckCoveredBy = boost::is_same
bool CheckCoveredBy = std::is_same
<
typename tag<MultiGeometry>::type, multi_polygon_tag
>::value

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014-2019 Oracle and/or its affiliates.
// Copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -13,14 +13,12 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_SEGMENT_TO_BOX_HPP
#include <cstddef>
#include <functional>
#include <type_traits>
#include <vector>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
@ -771,19 +769,19 @@ public:
if (detail::equals::equals_point_point(p[0], p[1],
sb_strategy.get_equals_point_point_strategy()))
{
typedef typename boost::mpl::if_
typedef std::conditional_t
<
boost::is_same
std::is_same
<
ps_comparable_strategy,
SBStrategy
>,
>::value,
typename strategy::distance::services::comparable_type
<
typename SBStrategy::distance_pb_strategy::type
>::type,
typename SBStrategy::distance_pb_strategy::type
>::type point_box_strategy_type;
> point_box_strategy_type;
return dispatch::distance
<

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2015-2018, Oracle and/or its affiliates.
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -13,9 +13,9 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_RANGE_OF_BOXES_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_RANGE_OF_BOXES_HPP
#include <cstddef>
#include <algorithm>
#include <cstddef>
#include <type_traits>
#include <vector>
#include <boost/range.hpp>
@ -239,7 +239,7 @@ struct envelope_range_of_boxes
RangeOfBoxes const
>::type iterator_type;
static const bool is_equatorial = ! boost::is_same
static const bool is_equatorial = ! std::is_same
<
typename cs_tag<box_type>::type,
spherical_polar_tag

View File

@ -147,7 +147,7 @@ private:
// For high precision arithmetic, we have to be
// more relaxed then using ==
// Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) )
// is not always true (at least, it is not for ttmath)
// is not always true (at least, not for some user defined types)
return math::equals_with_epsilon(dx, other.dx)
&& math::equals_with_epsilon(dy, other.dy);
}

View File

@ -5,8 +5,8 @@
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2014, 2015, 2016, 2017, 2018, 2019.
// Modifications copyright (c) 2014-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -23,10 +23,10 @@
#include <cstddef>
#include <type_traits>
#include <vector>
#include <boost/range.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/tags.hpp>
@ -243,14 +243,14 @@ struct equals_by_collection_or_relate
Geometry2 const& geometry2,
Strategy const& strategy)
{
typedef typename boost::is_base_of
typedef std::is_base_of
<
nyi::not_implemented_tag,
typename collected_vector
<
Geometry1, Geometry2, Strategy
>::type
>::type enable_relate_type;
> enable_relate_type;
return apply(geometry1, geometry2, strategy, enable_relate_type());
}
@ -260,7 +260,7 @@ private:
static inline bool apply(Geometry1 const& geometry1,
Geometry2 const& geometry2,
Strategy const& strategy,
boost::false_type /*enable_relate*/)
std::false_type /*enable_relate*/)
{
return equals_by_collection<TrivialCheck>::apply(geometry1, geometry2, strategy);
}
@ -269,7 +269,7 @@ private:
static inline bool apply(Geometry1 const& geometry1,
Geometry2 const& geometry2,
Strategy const& strategy,
boost::true_type /*enable_relate*/)
std::true_type /*enable_relate*/)
{
return equals_by_relate<Geometry1, Geometry2>::apply(geometry1, geometry2, strategy);
}

View File

@ -1,6 +1,6 @@
// Boost.Geometry
// Copyright (c) 2015-2019, Oracle and/or its affiliates.
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -11,10 +11,9 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_EXPAND_BY_EPSILON_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_EXPAND_BY_EPSILON_HPP
#include <cstddef>
#include <algorithm>
#include <boost/type_traits/is_integral.hpp>
#include <cstddef>
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@ -79,7 +78,7 @@ struct corner_by_epsilon<Point, PlusOrMinus, D, D>
template
<
typename Box,
bool Enable = ! boost::is_integral<typename coordinate_type<Box>::type>::value
bool Enable = ! std::is_integral<typename coordinate_type<Box>::type>::value
>
struct expand_by_epsilon
{

View File

@ -19,21 +19,20 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_FOR_EACH_RANGE_HPP
#include <type_traits>
#include <utility>
#include <boost/concept/requires.hpp>
#include <boost/core/addressof.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
#include <boost/geometry/util/type_traits.hpp>
#include <boost/geometry/views/box_view.hpp>
#include <boost/geometry/views/segment_view.hpp>
@ -66,7 +65,7 @@ struct fe_range_segment
template <typename Functor>
static inline bool apply(Segment& segment, Functor&& f)
{
return f(segment_view<typename boost::remove_const<Segment>::type>(segment));
return f(segment_view<typename std::remove_const<Segment>::type>(segment));
}
};
@ -101,7 +100,7 @@ struct fe_range_box
template <typename Functor>
static inline bool apply(Box& box, Functor&& f)
{
return f(box_view<typename boost::remove_const<Box>::type>(box));
return f(box_view<typename std::remove_const<Box>::type>(box));
}
};
@ -139,11 +138,9 @@ template
>
struct for_each_range
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this Geometry type.",
Geometry, Tag);
};
@ -196,11 +193,11 @@ struct for_each_range<Geometry, multi_linestring_tag>
Geometry,
detail::for_each::fe_range_range
<
typename add_const_if_c
util::transcribe_const_t
<
boost::is_const<Geometry>::value,
Geometry,
typename boost::range_value<Geometry>::type
>::type
>
>
>
{};
@ -213,11 +210,11 @@ struct for_each_range<Geometry, multi_polygon_tag>
Geometry,
detail::for_each::fe_range_polygon
<
typename add_const_if_c
util::transcribe_const_t
<
boost::is_const<Geometry>::value,
Geometry,
typename boost::range_value<Geometry>::type
>::type
>
>
>
{};

View File

@ -14,9 +14,10 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_MULTI_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_MULTI_HPP
#include <type_traits>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/geometry_id.hpp>
#include <boost/geometry/core/is_areal.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@ -446,12 +447,12 @@ struct intersection_insert
MultiLinestring, Ring, TupledOut,
// NOTE: points can be the result only in case of intersection.
// TODO: union should require L and A
typename boost::mpl::if_c
std::conditional_t
<
(OverlayType == overlay_intersection),
point_tag,
void
>::type,
>,
linestring_tag
>
{};
@ -484,12 +485,12 @@ struct intersection_insert
MultiLinestring, Polygon, TupledOut,
// NOTE: points can be the result only in case of intersection.
// TODO: union should require L and A
typename boost::mpl::if_c
std::conditional_t
<
(OverlayType == overlay_intersection),
point_tag,
void
>::type,
>,
linestring_tag
>
{};
@ -524,12 +525,12 @@ struct intersection_insert
// TODO: in general the result of difference should depend on the first argument
// but this specialization calls L/A in reality so the first argument is linear.
// So expect only L for difference?
typename boost::mpl::if_c
std::conditional_t
<
(OverlayType == overlay_intersection),
point_tag,
void
>::type,
>,
linestring_tag
>
{};
@ -561,12 +562,12 @@ struct intersection_insert
MultiLinestring, MultiPolygon, TupledOut,
// NOTE: points can be the result only in case of intersection.
// TODO: union should require L and A
typename boost::mpl::if_c
std::conditional_t
<
(OverlayType == overlay_intersection),
point_tag,
void
>::type,
>,
linestring_tag
>
{};

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014-2018, Oracle and/or its affiliates.
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -12,8 +12,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_INVALID_COORDINATE_HPP
#include <cstddef>
#include <boost/type_traits/is_floating_point.hpp>
#include <type_traits>
#include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
#include <boost/geometry/algorithms/validity_failure_type.hpp>
@ -115,7 +114,7 @@ template
<
typename Geometry,
typename Tag = typename tag<Geometry>::type,
bool HasFloatingPointCoordinates = boost::is_floating_point
bool HasFloatingPointCoordinates = std::is_floating_point
<
typename coordinate_type<Geometry>::type
>::value

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014-2019, Oracle and/or its affiliates.
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -12,10 +12,10 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_SPIKES_HPP
#include <algorithm>
#include <type_traits>
#include <boost/core/ignore_unused.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/point_type.hpp>
@ -137,8 +137,8 @@ struct has_spikes
typedef typename closeable_view<Range const, Closure>::type view_type;
typedef typename boost::range_iterator<view_type const>::type iterator;
bool const is_linear
= boost::is_same<typename tag<Range>::type, linestring_tag>::value;
bool const is_linestring
= std::is_same<typename tag<Range>::type, linestring_tag>::value;
view_type const view(range);
@ -169,7 +169,7 @@ struct has_spikes
if (detail::is_spike_or_equal(*next, *cur, *prev, strategy))
{
return
! visitor.template apply<failure_spikes>(is_linear, *cur);
! visitor.template apply<failure_spikes>(is_linestring, *cur);
}
prev = cur;
cur = next;
@ -180,7 +180,7 @@ struct has_spikes
equals_point_point(range::front(view), range::back(view),
strategy.get_equals_point_point_strategy()))
{
return apply_at_closure(view, visitor, strategy, is_linear);
return apply_at_closure(view, visitor, strategy, is_linestring);
}
return ! visitor.template apply<no_failure>();

View File

@ -35,6 +35,7 @@
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/util/sequence.hpp>
#include <boost/geometry/geometries/box.hpp>
@ -243,7 +244,7 @@ protected:
inline bool apply(partition_item<Iterator, Box> const& item1,
partition_item<Iterator, Box> const& item2)
{
typedef boost::mpl::vector
typedef util::type_sequence
<
geometry::de9im::static_mask<'T'>,
geometry::de9im::static_mask<'*', 'T'>,

View File

@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2015, Oracle and/or its affiliates.
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@ -11,14 +12,12 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_MAX_INTERVAL_GAP_HPP
#include <cstddef>
#include <functional>
#include <queue>
#include <utility>
#include <vector>
#include <boost/core/ref.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/util/math.hpp>
@ -49,7 +48,7 @@ public:
typedef typename Interval::value_type time_type;
sweep_event(Interval const& interval, bool start_event = true)
: m_interval(boost::cref(interval))
: m_interval(std::cref(interval))
, m_start_event(start_event)
{}
@ -81,7 +80,7 @@ public:
}
private:
boost::reference_wrapper<Interval const> m_interval;
std::reference_wrapper<Interval const> m_interval;
bool m_start_event;
};
@ -118,15 +117,6 @@ class event_visitor
typedef typename Event::time_type event_time_type;
typedef typename Event::interval_type::difference_type difference_type;
typedef typename boost::remove_const
<
typename boost::remove_reference
<
event_time_type
>::type
>::type bare_time_type;
public:
event_visitor()
: m_overlap_count(0)
@ -162,12 +152,12 @@ public:
}
}
bare_time_type const& max_gap_left() const
event_time_type const& max_gap_left() const
{
return m_max_gap_left;
}
bare_time_type const& max_gap_right() const
event_time_type const& max_gap_right() const
{
return m_max_gap_right;
}
@ -179,7 +169,7 @@ public:
private:
std::size_t m_overlap_count;
bare_time_type m_max_gap_left, m_max_gap_right;
event_time_type m_max_gap_left, m_max_gap_right;
};
}} // namespace detail::max_interval_gap
@ -256,18 +246,9 @@ template <typename RangeOfIntervals>
inline typename boost::range_value<RangeOfIntervals>::type::difference_type
maximum_gap(RangeOfIntervals const& range_of_intervals)
{
typedef typename boost::remove_const
<
typename boost::remove_reference
<
typename boost::range_value
<
RangeOfIntervals
>::type::value_type
>::type
>::type value_type;
typedef typename boost::range_value<RangeOfIntervals>::type interval_type;
value_type left, right;
typename interval_type::value_type left, right;
return maximum_gap(range_of_intervals, left, right);
}

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2017, 2018.
// Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -14,6 +14,9 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP
#include <type_traits>
#include <boost/range.hpp>
#include <boost/static_assert.hpp>
@ -64,7 +67,7 @@ inline bool points_equal_or_close(Point1 const& point1,
geometry::recalculate(point2_rob, point2, robust_policy);
// Only if this is the case the same strategy can be used.
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
typename geometry::cs_tag<Point1>::type,
typename geometry::cs_tag<robust_point_type>::type

View File

@ -16,6 +16,7 @@
#include <boost/range.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/algorithms/envelope.hpp>
#include <boost/geometry/algorithms/expand.hpp>
#include <boost/geometry/algorithms/detail/partition.hpp>
@ -131,16 +132,18 @@ struct ring_info_helper_get_box
template <typename Box, typename InputItem>
static inline void apply(Box& total, InputItem const& item)
{
assert_coordinate_type_equal(total, item.envelope);
geometry::expand(total, item.envelope, BoxExpandStrategy());
}
};
template <typename DisjointBoxBoxStrategy>
struct ring_info_helper_ovelaps_box
struct ring_info_helper_overlaps_box
{
template <typename Box, typename InputItem>
static inline bool apply(Box const& box, InputItem const& item)
{
assert_coordinate_type_equal(box, item.envelope);
return ! geometry::detail::disjoint::disjoint_box_box(
box, item.envelope, DisjointBoxBoxStrategy());
}
@ -336,7 +339,7 @@ inline void assign_parents(Geometry1 const& geometry1,
<
typename Strategy::expand_box_strategy_type
> expand_box_type;
typedef ring_info_helper_ovelaps_box
typedef ring_info_helper_overlaps_box
<
typename Strategy::disjoint_box_box_strategy_type
> overlaps_box_type;

View File

@ -2,9 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2018.
// Modifications copyright (c) 2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2018-2020.
// Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
@ -14,15 +13,15 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP
#include <boost/mpl/assert.hpp>
#include <boost/range/algorithm/reverse.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
@ -36,11 +35,9 @@ namespace detail { namespace overlay
template<typename Tag>
struct convert_ring
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TAG
, (types<Tag>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this geometry Tag.",
Tag);
};
template<>

View File

@ -2,6 +2,10 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@ -11,19 +15,19 @@
#include <boost/array.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/signed_size_type.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/iterators/ever_circling_iterator.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
@ -165,11 +169,9 @@ template
>
struct copy_segment_point
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<GeometryIn>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this Geometry type.",
Tag, GeometryIn);
};

View File

@ -2,9 +2,8 @@
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2017, 2018.
// Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,12 +15,13 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENTS_HPP
#include <type_traits>
#include <vector>
#include <boost/array.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/geometry/algorithms/detail/assign_box_corners.hpp>
#include <boost/geometry/algorithms/detail/signed_size_type.hpp>
@ -130,7 +130,7 @@ private:
Point const& point,
SideStrategy const& strategy,
RobustPolicy const& robust_policy,
boost::true_type const&)
std::true_type const&)
{
detail::overlay::append_no_dups_or_spikes(current_output, point,
strategy,
@ -143,7 +143,7 @@ private:
Point const& point,
SideStrategy const& strategy,
RobustPolicy const&,
boost::false_type const&)
std::false_type const&)
{
detail::overlay::append_no_duplicates(current_output, point, strategy.get_equals_point_point_strategy());
}
@ -182,7 +182,7 @@ public:
for (signed_size_type i = 0; i < count; ++i, ++it)
{
append_to_output(current_output, *it, strategy, robust_policy,
boost::integral_constant<bool, RemoveSpikes>());
std::integral_constant<bool, RemoveSpikes>());
}
}
};

View File

@ -3,6 +3,10 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@ -25,16 +29,16 @@ template <order_selector Selector, bool Reverse = false>
struct do_reverse {};
template <>
struct do_reverse<clockwise, false> : boost::false_type {};
struct do_reverse<clockwise, false> : std::false_type {};
template <>
struct do_reverse<clockwise, true> : boost::true_type {};
struct do_reverse<clockwise, true> : std::true_type {};
template <>
struct do_reverse<counterclockwise, false> : boost::true_type {};
struct do_reverse<counterclockwise, false> : std::true_type {};
template <>
struct do_reverse<counterclockwise, true> : boost::false_type {};
struct do_reverse<counterclockwise, true> : std::false_type {};
}} // namespace detail::overlay

View File

@ -3,7 +3,7 @@
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2014, 2017, 2018, 2019, 2020.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,20 +16,19 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_FOLLOW_HPP
#include <cstddef>
#include <type_traits>
#include <boost/range.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/geometry/algorithms/detail/point_on_border.hpp>
#include <boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp>
#include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
#include <boost/geometry/algorithms/covered_by.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp>
#include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
#include <boost/geometry/algorithms/detail/point_on_border.hpp>
#include <boost/geometry/algorithms/detail/relate/turns.hpp>
#include <boost/geometry/algorithms/detail/tupled_output.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/util/condition.hpp>
namespace boost { namespace geometry
@ -202,8 +201,9 @@ struct add_isolated_point<PointOut, point_tag>
template <overlay_type OverlayType, bool RemoveSpikes = true>
struct action_selector
{
// If you get here the overlay type is not intersection or difference
// BOOST_MPL_ASSERT(false);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"If you get here the overlay type is not intersection or difference.",
std::integral_constant<overlay_type, OverlayType>);
};
// Specialization for intersection, containing the implementation

View File

@ -35,51 +35,27 @@ struct distance_measure
: measure(T())
{}
bool is_small() const { return false; }
bool is_zero() const { return false; }
bool is_positive() const { return false; }
bool is_negative() const { return false; }
};
template <typename T>
struct distance_measure_floating
{
T measure;
distance_measure_floating()
: measure(T())
{}
// Returns true if the distance measure is small.
// This is an arbitrary boundary, to enable some behaviour
// (for example include or exclude turns), which are checked later
// with other conditions.
bool is_small() const { return std::abs(measure) < 1.0e-3; }
bool is_small() const { return geometry::math::abs(measure) < 1.0e-3; }
// Returns true if the distance measure is absolutely zero
bool is_zero() const { return measure == 0.0; }
bool is_zero() const
{
return ! is_positive() && ! is_negative();
}
// Returns true if the distance measure is positive. Distance measure
// algorithm returns positive value if it is located on the left side.
bool is_positive() const { return measure > 0.0; }
bool is_positive() const { return measure > T(0); }
// Returns true if the distance measure is negative. Distance measure
// algorithm returns negative value if it is located on the right side.
bool is_negative() const { return measure < 0.0; }
bool is_negative() const { return measure < T(0); }
};
template <>
struct distance_measure<long double>
: public distance_measure_floating<long double> {};
template <>
struct distance_measure<double>
: public distance_measure_floating<double> {};
template <>
struct distance_measure<float>
: public distance_measure_floating<float> {};
} // detail

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2017.
// Modifications copyright (c) 2017 Oracle and/or its affiliates.
// This file was modified by Oracle on 2017-2020.
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,8 +16,8 @@
#include <cstddef>
#include <type_traits>
#include <boost/mpl/if.hpp>
#include <boost/range.hpp>
#include <boost/geometry/algorithms/convert.hpp>
@ -59,7 +59,7 @@ struct get_turn_without_info
OutputIterator out)
{
// Make sure this is only called with no rescaling
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
no_rescale_policy_tag,
typename rescale_policy_type<RobustPolicy>::type
@ -117,7 +117,7 @@ inline void get_intersection_points(Geometry1 const& geometry1,
detail::get_turns::no_interrupt_policy interrupt_policy;
boost::mpl::if_c
std::conditional_t
<
reverse_dispatch<Geometry1, Geometry2>::type::value,
dispatch::get_turns_reversed
@ -136,12 +136,11 @@ inline void get_intersection_points(Geometry1 const& geometry1,
false, false,
TurnPolicy
>
>::type::apply(
0, geometry1,
1, geometry2,
strategy,
robust_policy,
turns, interrupt_policy);
>::apply(0, geometry1,
1, geometry2,
strategy,
robust_policy,
turns, interrupt_policy);
}

View File

@ -22,10 +22,22 @@
#include <boost/array.hpp>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/range.hpp>
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
#include <boost/geometry/algorithms/detail/disjoint/point_point.hpp>
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp>
#include <boost/geometry/algorithms/detail/overlay/segment_identifier.hpp>
#include <boost/geometry/algorithms/detail/partition.hpp>
#include <boost/geometry/algorithms/detail/recalculate.hpp>
#include <boost/geometry/algorithms/detail/sections/range_by_section.hpp>
#include <boost/geometry/algorithms/detail/sections/section_box_policies.hpp>
#include <boost/geometry/algorithms/detail/sections/section_functions.hpp>
#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@ -35,14 +47,8 @@
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
#include <boost/geometry/views/detail/range_type.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/iterators/ever_circling_iterator.hpp>
@ -50,22 +56,13 @@
#include <boost/geometry/strategies/intersection_strategies.hpp>
#include <boost/geometry/strategies/intersection_result.hpp>
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
#include <boost/geometry/algorithms/detail/disjoint/point_point.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/type_traits.hpp>
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/algorithms/detail/partition.hpp>
#include <boost/geometry/algorithms/detail/recalculate.hpp>
#include <boost/geometry/algorithms/detail/sections/section_box_policies.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
#include <boost/geometry/views/detail/range_type.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp>
#include <boost/geometry/algorithms/detail/overlay/segment_identifier.hpp>
#include <boost/geometry/algorithms/detail/sections/range_by_section.hpp>
#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
#include <boost/geometry/algorithms/detail/sections/section_functions.hpp>
#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
# include <sstream>
@ -267,15 +264,7 @@ class get_turns_in_sections
boost::ignore_unused(n, index1, index2);
return boost::is_same
<
typename tag_cast
<
typename geometry::tag<Geometry>::type,
areal_tag
>::type,
areal_tag
>::value
return util::is_areal<Geometry>::value
&& index1 == 0
&& index2 >= n - 2
;
@ -296,17 +285,8 @@ public :
{
boost::ignore_unused(interrupt_policy);
static bool const areal1 = boost::is_same
<
typename tag_cast<typename tag<Geometry1>::type, areal_tag>::type,
areal_tag
>::type::value;
static bool const areal2 = boost::is_same
<
typename tag_cast<typename tag<Geometry2>::type, areal_tag>::type,
areal_tag
>::type::value;
static bool const areal1 = util::is_areal<Geometry1>::value;
static bool const areal2 = util::is_areal<Geometry2>::value;
if ((sec1.duplicate && (sec1.count + 1) < sec1.range_count)
|| (sec2.duplicate && (sec2.count + 1) < sec2.range_count))
@ -571,7 +551,7 @@ public:
typedef geometry::sections<box_type, 2> sections_type;
sections_type sec1, sec2;
typedef boost::mpl::vector_c<std::size_t, 0, 1> dimensions;
typedef std::integer_sequence<std::size_t, 0, 1> dimensions;
typename IntersectionStrategy::envelope_strategy_type const
envelope_strategy = intersection_strategy.get_envelope_strategy();
@ -1174,7 +1154,7 @@ inline void get_turns(Geometry1 const& geometry1,
typedef detail::overlay::get_turn_info<AssignPolicy> TurnPolicy;
//typedef detail::get_turns::get_turn_info_type<Geometry1, Geometry2, AssignPolicy> TurnPolicy;
boost::mpl::if_c
std::conditional_t
<
reverse_dispatch<Geometry1, Geometry2>::type::value,
dispatch::get_turns_reversed
@ -1193,11 +1173,11 @@ inline void get_turns(Geometry1 const& geometry1,
Reverse1, Reverse2,
TurnPolicy
>
>::type::apply(0, geometry1,
1, geometry2,
intersection_strategy,
robust_policy,
turns, interrupt_policy);
>::apply(0, geometry1,
1, geometry2,
intersection_strategy,
robust_policy,
turns, interrupt_policy);
}
#if defined(_MSC_VER)

View File

@ -2,7 +2,7 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2015, 2017, 2019, 2020.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -17,26 +17,34 @@
#include <cstddef>
#include <deque>
#include <type_traits>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range/metafunctions.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/geometry/core/is_areal.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
#include <boost/geometry/algorithms/detail/point_on_border.hpp>
#include <boost/geometry/algorithms/detail/overlay/clip_linestring.hpp>
#include <boost/geometry/algorithms/detail/overlay/follow.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp>
#include <boost/geometry/algorithms/detail/overlay/linear_linear.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp>
#include <boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp>
#include <boost/geometry/algorithms/detail/overlay/segment_as_subrange.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
@ -44,12 +52,6 @@
#include <boost/geometry/views/segment_view.hpp>
#include <boost/geometry/views/detail/boundary_view.hpp>
#include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
#include <boost/geometry/algorithms/detail/overlay/linear_linear.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp>
#include <boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp>
#if defined(BOOST_GEOMETRY_DEBUG_FOLLOW)
#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
@ -78,7 +80,7 @@ struct intersection_segment_segment_point
Strategy const& strategy)
{
// Make sure this is only called with no rescaling
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
no_rescale_policy_tag,
typename rescale_policy_type<RobustPolicy>::type
@ -127,7 +129,7 @@ struct intersection_linestring_linestring_point
Strategy const& strategy)
{
// Make sure this is only called with no rescaling
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
no_rescale_policy_tag,
typename rescale_policy_type<RobustPolicy>::type
@ -285,7 +287,7 @@ struct intersection_of_linestring_with_areal
Strategy const& strategy)
{
// Make sure this is only called with no rescaling
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
no_rescale_policy_tag,
typename rescale_policy_type<RobustPolicy>::type
@ -456,7 +458,7 @@ struct intersection_linear_areal_point
Strategy const& strategy)
{
// Make sure this is only called with no rescaling
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
no_rescale_policy_tag,
typename rescale_policy_type<RobustPolicy>::type
@ -555,11 +557,10 @@ template
>
struct intersection_insert
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPES_OR_ORIENTATIONS
, (types<Geometry1, Geometry2, GeometryOut>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for these Geometry types or their order.",
Geometry1, Geometry2, GeometryOut,
std::integral_constant<overlay_type, OverlayType>);
};
@ -936,12 +937,12 @@ struct intersection_insert
<
Linear1, Linear2, TupledOut,
// NOTE: points can be the result only in case of intersection.
typename boost::mpl::if_c
std::conditional_t
<
(OverlayType == overlay_intersection),
point_tag,
void
>::type,
>,
linestring_tag
>
{
@ -1428,26 +1429,26 @@ inline OutputIterator insert(Geometry1 const& geometry1,
OutputIterator out,
Strategy const& strategy)
{
return boost::mpl::if_c
<
geometry::reverse_dispatch<Geometry1, Geometry2>::type::value,
geometry::dispatch::intersection_insert_reversed
return std::conditional_t
<
Geometry1, Geometry2,
GeometryOut,
OverlayType,
overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
overlay::do_reverse<geometry::point_order<Geometry2>::value, ReverseSecond>::value
>,
geometry::dispatch::intersection_insert
<
Geometry1, Geometry2,
GeometryOut,
OverlayType,
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry2>::value, ReverseSecond>::value
>
>::type::apply(geometry1, geometry2, robust_policy, out, strategy);
geometry::reverse_dispatch<Geometry1, Geometry2>::type::value,
geometry::dispatch::intersection_insert_reversed
<
Geometry1, Geometry2,
GeometryOut,
OverlayType,
overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
overlay::do_reverse<geometry::point_order<Geometry2>::value, ReverseSecond>::value
>,
geometry::dispatch::intersection_insert
<
Geometry1, Geometry2,
GeometryOut,
OverlayType,
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry2>::value, ReverseSecond>::value
>
>::apply(geometry1, geometry2, robust_policy, out, strategy);
}

View File

@ -3,9 +3,8 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland
// This file was modified by Oracle on 2015, 2017, 2019.
// Modifications copyright (c) 2015-2019, Oracle and/or its affiliates.
// This file was modified by Oracle on 2015-2020.
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -20,9 +19,9 @@
#include <deque>
#include <map>
#include <boost/range.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/algorithms/detail/overlay/cluster_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp>

View File

@ -3,8 +3,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2017, 2018.
// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
// This file was modified by Oracle on 2017-2020.
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -18,7 +18,6 @@
#include <cstddef>
#include <boost/mpl/vector_c.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/access.hpp>
@ -152,7 +151,7 @@ struct get_turns
// all potential spikes correctly
typedef geometry::sections<box_type, 2> sections_type;
typedef boost::mpl::vector_c<std::size_t, 0, 1> dimensions;
typedef std::integer_sequence<std::size_t, 0, 1> dimensions;
sections_type sec;
geometry::sectionalize<Reverse, dimensions>(geometry, robust_policy, sec,

View File

@ -3,8 +3,8 @@
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2015, 2017, 2018, 2019.
// Modifications copyright (c) 2015-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2015-2020.
// Modifications copyright (c) 2015-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,10 +16,12 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP
#include <cstddef>
#include <type_traits>
#include <vector>
#include <boost/range.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
@ -32,7 +34,7 @@ namespace boost { namespace geometry
namespace detail { namespace partition
{
template <typename T, bool IsIntegral = boost::is_integral<T>::value>
template <typename T, bool IsIntegral = std::is_integral<T>::value>
struct divide_interval
{
static inline T apply(T const& mi, T const& ma)

View File

@ -5,6 +5,10 @@
// Copyright (c) 2013 Mateusz Loskot, London, UK.
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@ -17,13 +21,10 @@
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/size.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2019.
// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -14,10 +14,6 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_DE9IM_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_DE9IM_HPP
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/static_assert.hpp>
#include <boost/tuple/tuple.hpp>
@ -25,6 +21,7 @@
#include <boost/geometry/core/topological_dimension.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/util/sequence.hpp>
#include <boost/geometry/util/tuples.hpp>
namespace boost { namespace geometry
@ -146,7 +143,7 @@ template
class static_mask
: public detail::relate::static_mask
<
boost::mpl::vector_c
std::integer_sequence
<
char, II, IB, IE, BI, BB, BE, EI, EB, EE
>,
@ -154,36 +151,6 @@ class static_mask
>
{};
} // namespace de9im
namespace detail { namespace de9im
{
// a small helper util for ORing static masks
template
<
typename Seq,
typename T,
bool IsSeq = boost::mpl::is_sequence<Seq>::value
>
struct push_back
{
typedef typename boost::mpl::push_back
<
Seq,
T
>::type type;
};
template <typename Seq, typename T>
struct push_back<Seq, T, false>
{};
}} // namespace detail::de9im
namespace de9im
{
inline
boost::tuples::cons
@ -227,14 +194,15 @@ template
char EI2, char EB2, char EE2
>
inline
boost::mpl::vector<
static_mask<II1, IB1, IE1, BI1, BB1, BE1, EI1, EB1, EE1>,
static_mask<II2, IB2, IE2, BI2, BB2, BE2, EI2, EB2, EE2>
>
util::type_sequence
<
static_mask<II1, IB1, IE1, BI1, BB1, BE1, EI1, EB1, EE1>,
static_mask<II2, IB2, IE2, BI2, BB2, BE2, EI2, EB2, EE2>
>
operator||(static_mask<II1, IB1, IE1, BI1, BB1, BE1, EI1, EB1, EE1> const& ,
static_mask<II2, IB2, IE2, BI2, BB2, BE2, EI2, EB2, EE2> const& )
{
return boost::mpl::vector
return util::type_sequence
<
static_mask<II1, IB1, IE1, BI1, BB1, BE1, EI1, EB1, EE1>,
static_mask<II2, IB2, IE2, BI2, BB2, BE2, EI2, EB2, EE2>
@ -243,25 +211,25 @@ operator||(static_mask<II1, IB1, IE1, BI1, BB1, BE1, EI1, EB1, EE1> const& ,
template
<
typename Seq,
typename ...StaticMasks,
char II, char IB, char IE,
char BI, char BB, char BE,
char EI, char EB, char EE
>
inline
typename detail::de9im::push_back
<
Seq,
static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE>
>::type
operator||(Seq const& ,
util::type_sequence
<
StaticMasks...,
static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE>
>
operator||(util::type_sequence<StaticMasks...> const& ,
static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE> const& )
{
return typename detail::de9im::push_back
return util::type_sequence
<
Seq,
StaticMasks...,
static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE>
>::type();
>();
}
} // namespace de9im
@ -305,7 +273,7 @@ template
>
struct static_mask_touches_impl
{
typedef boost::mpl::vector
typedef util::type_sequence
<
geometry::de9im::static_mask<'F', 'T', '*', '*', '*', '*', '*', '*', '*'>,
geometry::de9im::static_mask<'F', '*', '*', 'T', '*', '*', '*', '*', '*'>,
@ -336,7 +304,7 @@ struct static_mask_within_type
template <typename Geometry1, typename Geometry2>
struct static_mask_covered_by_type
{
typedef boost::mpl::vector
typedef util::type_sequence
<
geometry::de9im::static_mask<'T', '*', 'F', '*', '*', 'F', '*', '*', '*'>,
geometry::de9im::static_mask<'*', 'T', 'F', '*', '*', 'F', '*', '*', '*'>,

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2017.
// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -15,21 +15,22 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_INTERFACE_HPP
#include <boost/type_traits/is_same.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/variant_fwd.hpp>
#include <boost/geometry/algorithms/detail/relate/de9im.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/topological_dimension.hpp>
#include <boost/geometry/algorithms/detail/relate/de9im.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/strategies/default_strategy.hpp>
#include <boost/geometry/strategies/relate.hpp>
#include <boost/geometry/util/sequence.hpp>
#include <boost/geometry/util/type_traits.hpp>
namespace boost { namespace geometry {
@ -38,50 +39,20 @@ namespace boost { namespace geometry {
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace relate {
// Those are used only to allow dispatch::relate to produce compile-time error
template <typename Geometry,
typename Tag = typename geometry::tag<Geometry>::type>
struct is_supported_by_generic
{
static const bool value
= boost::is_same<Tag, linestring_tag>::value
|| boost::is_same<Tag, multi_linestring_tag>::value
|| boost::is_same<Tag, ring_tag>::value
|| boost::is_same<Tag, polygon_tag>::value
|| boost::is_same<Tag, multi_polygon_tag>::value;
};
template <typename Geometry1,
typename Geometry2,
typename Tag1 = typename geometry::tag<Geometry1>::type,
typename Tag2 = typename geometry::tag<Geometry2>::type>
// is_generic allows dispatch::relate to generate compile-time error
template <typename Geometry1, typename Geometry2>
struct is_generic
{
static const bool value = is_supported_by_generic<Geometry1>::value
&& is_supported_by_generic<Geometry2>::value;
static const bool value = (util::is_polysegmental<Geometry1>::value
&& util::is_polysegmental<Geometry2>::value)
||
(util::is_point<Geometry1>::value
&& util::is_polysegmental<Geometry2>::value)
||
(util::is_polysegmental<Geometry1>::value
&& util::is_point<Geometry2>::value);
};
template <typename Point, typename Geometry, typename Tag>
struct is_generic<Point, Geometry, point_tag, Tag>
{
static const bool value = is_supported_by_generic<Geometry>::value;
};
template <typename Geometry, typename Point, typename Tag>
struct is_generic<Geometry, Point, Tag, point_tag>
{
static const bool value = is_supported_by_generic<Geometry>::value;
};
template <typename Point1, typename Point2>
struct is_generic<Point1, Point2, point_tag, point_tag>
{
static const bool value = false;
};
}} // namespace detail::relate
#endif // DOXYGEN_NO_DETAIL
@ -114,16 +85,13 @@ struct interruption_enabled
dispatch::relate<Geometry1, Geometry2>::interruption_enabled;
};
template <typename Geometry1,
typename Geometry2,
typename Result,
bool IsSequence = boost::mpl::is_sequence<Result>::value>
template <typename Geometry1, typename Geometry2, typename Result>
struct result_handler_type
: not_implemented<Result>
{};
template <typename Geometry1, typename Geometry2>
struct result_handler_type<Geometry1, Geometry2, geometry::de9im::mask, false>
struct result_handler_type<Geometry1, Geometry2, geometry::de9im::mask>
{
typedef mask_handler
<
@ -137,7 +105,7 @@ struct result_handler_type<Geometry1, Geometry2, geometry::de9im::mask, false>
};
template <typename Geometry1, typename Geometry2, typename Head, typename Tail>
struct result_handler_type<Geometry1, Geometry2, boost::tuples::cons<Head, Tail>, false>
struct result_handler_type<Geometry1, Geometry2, boost::tuples::cons<Head, Tail>>
{
typedef mask_handler
<
@ -158,8 +126,7 @@ struct result_handler_type
<
Geometry1,
Geometry2,
geometry::de9im::static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE>,
false
geometry::de9im::static_mask<II, IB, IE, BI, BB, BE, EI, EB, EE>
>
{
typedef static_mask_handler
@ -173,12 +140,12 @@ struct result_handler_type
> type;
};
template <typename Geometry1, typename Geometry2, typename StaticSequence>
struct result_handler_type<Geometry1, Geometry2, StaticSequence, true>
template <typename Geometry1, typename Geometry2, typename ...StaticMasks>
struct result_handler_type<Geometry1, Geometry2, util::type_sequence<StaticMasks...>>
{
typedef static_mask_handler
<
StaticSequence,
util::type_sequence<StaticMasks...>,
interruption_enabled
<
Geometry1,

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019.
// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -22,6 +22,7 @@
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/util/type_traits.hpp>
#include <boost/geometry/algorithms/num_interior_rings.hpp>
#include <boost/geometry/algorithms/detail/point_on_border.hpp>
@ -210,15 +211,6 @@ struct linear_areal
typedef typename geometry::point_type<Geometry1>::type point1_type;
typedef typename geometry::point_type<Geometry2>::type point2_type;
template <typename Geometry>
struct is_multi
: boost::is_base_of
<
multi_tag,
typename tag<Geometry>::type
>
{};
template <typename Geom1, typename Geom2, typename Strategy>
struct multi_turn_info
: turns::get_turns<Geom1, Geom2>::template turn_info_type<Strategy>::type
@ -229,9 +221,9 @@ struct linear_areal
template <typename Geom1, typename Geom2, typename Strategy>
struct turn_info_type
: boost::mpl::if_c
: std::conditional
<
is_multi<Geometry2>::value,
util::is_multi<Geometry2>::value,
multi_turn_info<Geom1, Geom2, Strategy>,
typename turns::get_turns<Geom1, Geom2>::template turn_info_type<Strategy>::type
>
@ -303,7 +295,7 @@ struct linear_areal
return;
{
sort_dispatch<cs_tag>(turns.begin(), turns.end(), is_multi<Geometry2>());
sort_dispatch<cs_tag>(turns.begin(), turns.end(), util::is_multi<Geometry2>());
turns_analyser<turn_type> analyser;
analyse_each_turn(result, analyser,
@ -531,7 +523,7 @@ struct linear_areal
};
template <typename CSTag, typename TurnIt>
static void sort_dispatch(TurnIt first, TurnIt last, boost::true_type const& /*is_multi*/)
static void sort_dispatch(TurnIt first, TurnIt last, std::true_type const& /*is_multi*/)
{
// sort turns by Linear seg_id, then by fraction, then by other multi_index
typedef turns::less<0, turns::less_other_multi_index<0>, CSTag> less;
@ -555,7 +547,7 @@ struct linear_areal
}
template <typename CSTag, typename TurnIt>
static void sort_dispatch(TurnIt first, TurnIt last, boost::false_type const& /*is_multi*/)
static void sort_dispatch(TurnIt first, TurnIt last, std::false_type const& /*is_multi*/)
{
// sort turns by Linear seg_id, then by fraction, then
// for same ring id: x, u, i, c
@ -765,7 +757,7 @@ struct linear_areal
m_exit_watcher.reset_detected_exit();
}
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
if ( BOOST_GEOMETRY_CONDITION( util::is_multi<OtherGeometry>::value )
&& m_first_from_unknown )
{
// For MultiPolygon many x/u operations may be generated as a first IP
@ -953,7 +945,7 @@ struct linear_areal
}
}
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value ) )
if ( BOOST_GEOMETRY_CONDITION( util::is_multi<OtherGeometry>::value ) )
{
m_first_from_unknown = false;
m_first_from_unknown_boundary_detected = false;
@ -1041,7 +1033,7 @@ struct linear_areal
}
else
{
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
if ( BOOST_GEOMETRY_CONDITION( util::is_multi<OtherGeometry>::value )
/*&& ( op == overlay::operation_blocked
|| op == overlay::operation_union )*/ ) // if we're here it's u or x
{
@ -1069,7 +1061,7 @@ struct linear_areal
}
else
{
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
if ( BOOST_GEOMETRY_CONDITION( util::is_multi<OtherGeometry>::value )
/*&& ( op == overlay::operation_blocked
|| op == overlay::operation_union )*/ ) // if we're here it's u or x
{
@ -1119,7 +1111,7 @@ struct linear_areal
// For MultiPolygon many x/u operations may be generated as a first IP
// if for all turns x/u was generated and any of the Polygons doesn't contain the LineString
// then we know that the LineString is outside
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
if ( BOOST_GEOMETRY_CONDITION( util::is_multi<OtherGeometry>::value )
&& m_first_from_unknown )
{
update<interior, exterior, '1', TransposeResult>(res);

View File

@ -23,19 +23,19 @@
#include <boost/geometry/algorithms/detail/within/point_in_geometry.hpp>
#include <boost/geometry/algorithms/envelope.hpp>
#include <boost/geometry/core/is_areal.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
// TEMP
#include <boost/geometry/strategies/envelope/cartesian.hpp>
#include <boost/geometry/strategies/envelope/geographic.hpp>
#include <boost/geometry/strategies/envelope/spherical.hpp>
#include <boost/geometry/util/type_traits.hpp>
namespace boost { namespace geometry
{
@ -607,14 +607,7 @@ template
<
typename MultiPoint, typename Geometry,
bool Transpose = false,
bool isMulti = boost::is_same
<
typename tag_cast
<
typename tag<Geometry>::type, multi_tag
>::type,
multi_tag
>::value
bool isMulti = util::is_multi<Geometry>::value
>
struct multi_point_geometry
: multi_point_single_geometry<MultiPoint, Geometry, Transpose>

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2019.
// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -14,9 +14,7 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_IMPL_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_IMPL_HPP
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <type_traits>
#include <boost/geometry/algorithms/detail/relate/interface.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
@ -36,9 +34,9 @@ template
typename Geometry2
>
struct relate_impl_base
: boost::mpl::if_c
: std::conditional_t
<
boost::is_base_of
std::is_base_of
<
nyi::not_implemented_tag,
dispatch::relate<Geometry1, Geometry2>
@ -49,7 +47,7 @@ struct relate_impl_base
typename geometry::tag<Geometry2>::type
>,
implemented_tag
>::type
>
{};
template

View File

@ -18,24 +18,17 @@
#include <algorithm>
#include <cstddef>
#include <cstring>
#include <type_traits>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/begin.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/size.hpp>
#include <boost/static_assert.hpp>
#include <boost/throw_exception.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/exception.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/sequence.hpp>
namespace boost { namespace geometry {
@ -167,7 +160,7 @@ public:
{
static const bool in_bounds = F1 < Matrix::static_height
&& F2 < Matrix::static_width;
typedef boost::integral_constant<bool, in_bounds> in_bounds_t;
typedef std::integral_constant<bool, in_bounds> in_bounds_t;
set_dispatch<F1, F2, V>(in_bounds_t());
}
@ -176,13 +169,13 @@ public:
{
static const bool in_bounds = F1 < Matrix::static_height
&& F2 < Matrix::static_width;
typedef boost::integral_constant<bool, in_bounds> in_bounds_t;
typedef std::integral_constant<bool, in_bounds> in_bounds_t;
update_dispatch<F1, F2, D>(in_bounds_t());
}
private:
template <field F1, field F2, char V>
inline void set_dispatch(integral_constant<bool, true>)
inline void set_dispatch(std::true_type)
{
static const std::size_t index = F1 * Matrix::static_width + F2;
BOOST_STATIC_ASSERT(index < Matrix::static_size);
@ -190,11 +183,11 @@ private:
m_matrix.template set<F1, F2, V>();
}
template <field F1, field F2, char V>
inline void set_dispatch(integral_constant<bool, false>)
inline void set_dispatch(std::false_type)
{}
template <field F1, field F2, char D>
inline void update_dispatch(integral_constant<bool, true>)
inline void update_dispatch(std::true_type)
{
static const std::size_t index = F1 * Matrix::static_width + F2;
BOOST_STATIC_ASSERT(index < Matrix::static_size);
@ -204,7 +197,7 @@ private:
m_matrix.template set<F1, F2, D>();
}
template <field F1, field F2, char D>
inline void update_dispatch(integral_constant<bool, false>)
inline void update_dispatch(std::false_type)
{}
Matrix m_matrix;
@ -662,40 +655,28 @@ struct false_mask {};
// --------------- COMPILE-TIME MASK ----------------
// static_check_characters
template
<
typename Seq,
typename First = typename boost::mpl::begin<Seq>::type,
typename Last = typename boost::mpl::end<Seq>::type
>
struct static_check_characters
: static_check_characters
<
Seq,
typename boost::mpl::next<First>::type
>
template <typename Seq>
struct static_check_characters {};
template <char C, char ...Cs>
struct static_check_characters<std::integer_sequence<char, C, Cs...>>
: static_check_characters<std::integer_sequence<char, Cs...>>
{
typedef typename boost::mpl::deref<First>::type type;
static const char value = type::value;
static const bool is_valid = (value >= '0' && value <= '9')
|| value == 'T' || value == 'F' || value == '*';
BOOST_MPL_ASSERT_MSG((is_valid),
INVALID_STATIC_MASK_CHARACTER,
(type));
typedef std::integer_sequence<char, C, Cs...> type;
static const bool is_valid = (C >= '0' && C <= '9')
|| C == 'T' || C == 'F' || C == '*';
BOOST_GEOMETRY_STATIC_ASSERT((is_valid),
"Invalid static mask character",
type);
};
template <typename Seq, typename Last>
struct static_check_characters<Seq, Last, Last>
template <char ...Cs>
struct static_check_characters<std::integral_constant<char, Cs...>>
{};
// static_mask
template
<
typename Seq,
std::size_t Height,
std::size_t Width = Height
>
template <typename Seq, std::size_t Height, std::size_t Width = Height>
struct static_mask
{
static const std::size_t static_width = Width;
@ -703,7 +684,7 @@ struct static_mask
static const std::size_t static_size = Width * Height;
BOOST_STATIC_ASSERT(
std::size_t(boost::mpl::size<Seq>::type::value) == static_size);
std::size_t(util::sequence_size<Seq>::value) == static_size);
template <detail::relate::field F1, detail::relate::field F2>
struct static_get
@ -712,7 +693,7 @@ struct static_mask
BOOST_STATIC_ASSERT(std::size_t(F2) < static_width);
static const char value
= boost::mpl::at_c<Seq, F1 * static_width + F2>::type::value;
= util::sequence_element<F1 * static_width + F2, Seq>::value;
};
private:
@ -722,7 +703,11 @@ private:
// static_should_handle_element
template <typename StaticMask, field F1, field F2, bool IsSequence>
template
<
typename StaticMask, field F1, field F2,
bool IsSequence = util::is_sequence<StaticMask>::value
>
struct static_should_handle_element_dispatch
{
static const char mask_el = StaticMask::template static_get<F1, F2>::value;
@ -731,28 +716,29 @@ struct static_should_handle_element_dispatch
|| ( mask_el >= '0' && mask_el <= '9' );
};
template <typename First, typename Last, field F1, field F2>
template
<
typename Seq, field F1, field F2,
std::size_t I = 0,
std::size_t N = util::sequence_size<Seq>::value
>
struct static_should_handle_element_sequence
{
typedef typename boost::mpl::deref<First>::type StaticMask;
typedef typename util::sequence_element<I, Seq>::type StaticMask;
static const bool value
= static_should_handle_element_dispatch
<
StaticMask,
F1, F2,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, F1, F2
>::value
|| static_should_handle_element_sequence
<
typename boost::mpl::next<First>::type,
Last,
F1, F2
Seq, F1, F2, I + 1
>::value;
};
template <typename Last, field F1, field F2>
struct static_should_handle_element_sequence<Last, Last, F1, F2>
template <typename Seq, field F1, field F2, std::size_t N>
struct static_should_handle_element_sequence<Seq, F1, F2, N, N>
{
static const bool value = false;
};
@ -763,9 +749,7 @@ struct static_should_handle_element_dispatch<StaticMask, F1, F2, true>
static const bool value
= static_should_handle_element_sequence
<
typename boost::mpl::begin<StaticMask>::type,
typename boost::mpl::end<StaticMask>::type,
F1, F2
StaticMask, F1, F2
>::value;
};
@ -775,15 +759,18 @@ struct static_should_handle_element
static const bool value
= static_should_handle_element_dispatch
<
StaticMask,
F1, F2,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, F1, F2
>::value;
};
// static_interrupt
template <typename StaticMask, char V, field F1, field F2, bool InterruptEnabled, bool IsSequence>
template
<
typename StaticMask, char V, field F1, field F2,
bool InterruptEnabled,
bool IsSequence = util::is_sequence<StaticMask>::value
>
struct static_interrupt_dispatch
{
static const bool value = false;
@ -800,29 +787,29 @@ struct static_interrupt_dispatch<StaticMask, V, F1, F2, true, IsSequence>
( ( V == 'T' ) ? mask_el == 'F' : false );
};
template <typename First, typename Last, char V, field F1, field F2>
template
<
typename Seq, char V, field F1, field F2,
std::size_t I = 0,
std::size_t N = util::sequence_size<Seq>::value
>
struct static_interrupt_sequence
{
typedef typename boost::mpl::deref<First>::type StaticMask;
typedef typename util::sequence_element<I, Seq>::type StaticMask;
static const bool value
= static_interrupt_dispatch
<
StaticMask,
V, F1, F2,
true,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, V, F1, F2, true
>::value
&& static_interrupt_sequence
<
typename boost::mpl::next<First>::type,
Last,
V, F1, F2
Seq, V, F1, F2, I + 1
>::value;
};
template <typename Last, char V, field F1, field F2>
struct static_interrupt_sequence<Last, Last, V, F1, F2>
template <typename Seq, char V, field F1, field F2, std::size_t N>
struct static_interrupt_sequence<Seq, V, F1, F2, N, N>
{
static const bool value = true;
};
@ -833,9 +820,7 @@ struct static_interrupt_dispatch<StaticMask, V, F1, F2, true, true>
static const bool value
= static_interrupt_sequence
<
typename boost::mpl::begin<StaticMask>::type,
typename boost::mpl::end<StaticMask>::type,
V, F1, F2
StaticMask, V, F1, F2
>::value;
};
@ -845,16 +830,17 @@ struct static_interrupt
static const bool value
= static_interrupt_dispatch
<
StaticMask,
V, F1, F2,
EnableInterrupt,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, V, F1, F2, EnableInterrupt
>::value;
};
// static_may_update
template <typename StaticMask, char D, field F1, field F2, bool IsSequence>
template
<
typename StaticMask, char D, field F1, field F2,
bool IsSequence = util::is_sequence<StaticMask>::value
>
struct static_may_update_dispatch
{
static const char mask_el = StaticMask::template static_get<F1, F2>::value;
@ -864,65 +850,68 @@ struct static_may_update_dispatch
: mask_el >= '0' && mask_el <= '9' ? 2
: 3;
// TODO: use std::enable_if_t instead of std::integral_constant
template <typename Matrix>
static inline bool apply(Matrix const& matrix)
{
return apply_dispatch(matrix, integral_constant<int, version>());
return apply_dispatch(matrix, std::integral_constant<int, version>());
}
// mask_el == 'F'
template <typename Matrix>
static inline bool apply_dispatch(Matrix const& , integral_constant<int, 0>)
static inline bool apply_dispatch(Matrix const& , std::integral_constant<int, 0>)
{
return true;
}
// mask_el == 'T'
template <typename Matrix>
static inline bool apply_dispatch(Matrix const& matrix, integral_constant<int, 1>)
static inline bool apply_dispatch(Matrix const& matrix, std::integral_constant<int, 1>)
{
char const c = matrix.template get<F1, F2>();
return c == 'F'; // if it's T or between 0 and 9, the result will be the same
}
// mask_el >= '0' && mask_el <= '9'
template <typename Matrix>
static inline bool apply_dispatch(Matrix const& matrix, integral_constant<int, 2>)
static inline bool apply_dispatch(Matrix const& matrix, std::integral_constant<int, 2>)
{
char const c = matrix.template get<F1, F2>();
return D > c || c > '9';
}
// else
template <typename Matrix>
static inline bool apply_dispatch(Matrix const&, integral_constant<int, 3>)
static inline bool apply_dispatch(Matrix const&, std::integral_constant<int, 3>)
{
return false;
}
};
template <typename First, typename Last, char D, field F1, field F2>
template
<
typename Seq, char D, field F1, field F2,
std::size_t I = 0,
std::size_t N = util::sequence_size<Seq>::value
>
struct static_may_update_sequence
{
typedef typename boost::mpl::deref<First>::type StaticMask;
typedef typename util::sequence_element<I, Seq>::type StaticMask;
template <typename Matrix>
static inline bool apply(Matrix const& matrix)
{
return static_may_update_dispatch
<
StaticMask,
D, F1, F2,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, D, F1, F2
>::apply(matrix)
|| static_may_update_sequence
<
typename boost::mpl::next<First>::type,
Last,
D, F1, F2
Seq, D, F1, F2, I + 1
>::apply(matrix);
}
};
template <typename Last, char D, field F1, field F2>
struct static_may_update_sequence<Last, Last, D, F1, F2>
template <typename Seq, char D, field F1, field F2, std::size_t N>
struct static_may_update_sequence<Seq, D, F1, F2, N, N>
{
template <typename Matrix>
static inline bool apply(Matrix const& /*matrix*/)
@ -939,9 +928,7 @@ struct static_may_update_dispatch<StaticMask, D, F1, F2, true>
{
return static_may_update_sequence
<
typename boost::mpl::begin<StaticMask>::type,
typename boost::mpl::end<StaticMask>::type,
D, F1, F2
StaticMask, D, F1, F2
>::apply(matrix);
}
};
@ -954,16 +941,18 @@ struct static_may_update
{
return static_may_update_dispatch
<
StaticMask,
D, F1, F2,
boost::mpl::is_sequence<StaticMask>::value
StaticMask, D, F1, F2
>::apply(matrix);
}
};
// static_check_matrix
template <typename StaticMask, bool IsSequence>
template
<
typename StaticMask,
bool IsSequence = util::is_sequence<StaticMask>::value
>
struct static_check_dispatch
{
template <typename Matrix>
@ -990,59 +979,64 @@ struct static_check_dispatch
: mask_el >= '0' && mask_el <= '9' ? 2
: 3;
// TODO: use std::enable_if_t instead of std::integral_constant
template <typename Matrix>
static inline bool apply(Matrix const& matrix)
{
const char el = matrix.template get<F1, F2>();
return apply_dispatch(el, integral_constant<int, version>());
return apply_dispatch(el, std::integral_constant<int, version>());
}
// mask_el == 'F'
static inline bool apply_dispatch(char el, integral_constant<int, 0>)
static inline bool apply_dispatch(char el, std::integral_constant<int, 0>)
{
return el == 'F';
}
// mask_el == 'T'
static inline bool apply_dispatch(char el, integral_constant<int, 1>)
static inline bool apply_dispatch(char el, std::integral_constant<int, 1>)
{
return el == 'T' || ( el >= '0' && el <= '9' );
}
// mask_el >= '0' && mask_el <= '9'
static inline bool apply_dispatch(char el, integral_constant<int, 2>)
static inline bool apply_dispatch(char el, std::integral_constant<int, 2>)
{
return el == mask_el;
}
// else
static inline bool apply_dispatch(char /*el*/, integral_constant<int, 3>)
static inline bool apply_dispatch(char /*el*/, std::integral_constant<int, 3>)
{
return true;
}
};
};
template <typename First, typename Last>
template
<
typename Seq,
std::size_t I = 0,
std::size_t N = util::sequence_size<Seq>::value
>
struct static_check_sequence
{
typedef typename boost::mpl::deref<First>::type StaticMask;
typedef typename util::sequence_element<I, Seq>::type StaticMask;
template <typename Matrix>
static inline bool apply(Matrix const& matrix)
{
return static_check_dispatch
<
StaticMask,
boost::mpl::is_sequence<StaticMask>::value
StaticMask
>::apply(matrix)
|| static_check_sequence
<
typename boost::mpl::next<First>::type,
Last
Seq, I + 1
>::apply(matrix);
}
};
template <typename Last>
struct static_check_sequence<Last, Last>
template <typename Seq, std::size_t N>
struct static_check_sequence<Seq, N, N>
{
template <typename Matrix>
static inline bool apply(Matrix const& /*matrix*/)
@ -1059,8 +1053,7 @@ struct static_check_dispatch<StaticMask, true>
{
return static_check_sequence
<
typename boost::mpl::begin<StaticMask>::type,
typename boost::mpl::end<StaticMask>::type
StaticMask
>::apply(matrix);
}
};
@ -1073,8 +1066,7 @@ struct static_check_matrix
{
return static_check_dispatch
<
StaticMask,
boost::mpl::is_sequence<StaticMask>::value
StaticMask
>::apply(matrix);
}
};

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2019.
// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -15,7 +15,7 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_TURNS_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_TURNS_HPP
#include <boost/geometry/strategies/distance.hpp>
#include <boost/geometry/algorithms/detail/overlay/do_reverse.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
@ -25,8 +25,7 @@
#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
#include <boost/geometry/strategies/spherical/point_in_point.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/geometry/strategies/distance.hpp>
namespace boost { namespace geometry {

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2015, 2017.
// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -26,7 +26,7 @@ namespace detail { namespace relate
{
template <typename Geometry1, typename Geometry2>
struct result_handler_type<Geometry1, Geometry2, geometry::de9im::matrix, false>
struct result_handler_type<Geometry1, Geometry2, geometry::de9im::matrix>
{
typedef matrix_handler<geometry::de9im::matrix> type;
};

View File

@ -7,20 +7,19 @@
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014.
// Modifications copyright (c) 2013, 2014, Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
@ -28,6 +27,7 @@
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/range.hpp>
@ -105,11 +105,9 @@ template
>
struct range_by_section
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this Geometry type.",
Tag, Geometry, Section);
};

View File

@ -14,6 +14,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
#include <boost/geometry/algorithms/expand.hpp>
@ -31,6 +32,7 @@ struct get_section_box
template <typename Box, typename Section>
static inline void apply(Box& total, Section const& section)
{
assert_coordinate_type_equal(total, section.bounding_box);
geometry::expand(total, section.bounding_box,
ExpandBoxStrategy());
}
@ -42,6 +44,7 @@ struct overlaps_section_box
template <typename Box, typename Section>
static inline bool apply(Box const& box, Section const& section)
{
assert_coordinate_type_equal(box, section.bounding_box);
return ! detail::disjoint::disjoint_box_box(box, section.bounding_box,
DisjointBoxBoxStrategy());
}

View File

@ -14,8 +14,8 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_FUNCTIONS_HPP
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/algorithms/detail/recalculate.hpp>
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
@ -122,34 +122,38 @@ template
<
std::size_t Dimension,
typename Point,
typename RobustBox,
typename Box,
typename RobustPolicy
>
static inline bool preceding(int dir,
Point const& point,
RobustBox const& point_robust_box,
RobustBox const& other_robust_box,
Box const& point_box,
Box const& other_box,
RobustPolicy const& robust_policy)
{
typename geometry::robust_point_type<Point, RobustPolicy>::type robust_point;
assert_coordinate_type_equal(robust_point, point_box);
geometry::recalculate(robust_point, point, robust_policy);
return preceding_check<Dimension, Point>::apply(dir, robust_point, point_robust_box, other_robust_box);
return preceding_check<Dimension, Box>::apply(dir, robust_point,
point_box,
other_box);
}
template
<
std::size_t Dimension,
typename Point,
typename RobustBox,
typename Box,
typename RobustPolicy
>
static inline bool exceeding(int dir,
Point const& point,
RobustBox const& point_robust_box,
RobustBox const& other_robust_box,
Box const& point_box,
Box const& other_box,
RobustPolicy const& robust_policy)
{
return preceding<Dimension>(-dir, point, point_robust_box, other_robust_box, robust_policy);
return preceding<Dimension>(-dir, point, point_box, other_box, robust_policy);
}

View File

@ -22,16 +22,15 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP
#include <cstddef>
#include <type_traits>
#include <vector>
#include <boost/concept/requires.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/range.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/config.hpp>
@ -49,6 +48,7 @@
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@ -57,6 +57,7 @@
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/normalize_spheroidal_coordinates.hpp>
#include <boost/geometry/util/sequence.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
@ -160,7 +161,7 @@ template
>
struct get_direction_loop
{
typedef typename boost::mpl::at_c<DimensionVector, Index>::type dimension;
typedef typename util::sequence_element<Index, DimensionVector>::type dimension;
template <typename Segment>
static inline void apply(Segment const& seg,
@ -192,7 +193,7 @@ template
>
struct get_direction_loop<Point, DimensionVector, 0, Count, spherical_tag>
{
typedef typename boost::mpl::at_c<DimensionVector, 0>::type dimension;
typedef typename util::sequence_element<0, DimensionVector>::type dimension;
template <typename Segment>
static inline void apply(Segment const& seg,
@ -388,7 +389,7 @@ template
struct sectionalize_part
{
static const std::size_t dimension_count
= boost::mpl::size<DimensionVector>::value;
= util::sequence_size<DimensionVector>::value;
template
<
@ -442,8 +443,8 @@ struct sectionalize_part
typedef typename boost::range_value<Sections>::type section_type;
BOOST_STATIC_ASSERT
(
(static_cast<std::size_t>(section_type::dimension_count)
== static_cast<std::size_t>(boost::mpl::size<DimensionVector>::value))
section_type::dimension_count
== util::sequence_size<DimensionVector>::value
);
typedef typename geometry::robust_point_type
@ -804,7 +805,7 @@ struct expand_by_epsilon<spherical_tag>
static inline void apply(Box & box)
{
typedef typename coordinate_type<Box>::type coord_t;
static const coord_t eps = boost::is_same<coord_t, float>::value
static const coord_t eps = std::is_same<coord_t, float>::value
? coord_t(1e-6)
: coord_t(1e-12);
detail::expand_by_epsilon(box, eps);
@ -868,11 +869,9 @@ template
>
struct sectionalize
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not or not yet implemented for this Geometry type.",
Tag, Geometry);
};
template
@ -1009,7 +1008,7 @@ inline void sectionalize(Geometry const& geometry,
int source_index = 0,
std::size_t max_count = 10)
{
BOOST_STATIC_ASSERT((! boost::is_fundamental<EnvelopeStrategy>::value));
BOOST_STATIC_ASSERT((! std::is_fundamental<EnvelopeStrategy>::value));
concepts::check<Geometry const>();
@ -1030,7 +1029,7 @@ inline void sectionalize(Geometry const& geometry,
>::type
>::type ctype2;
BOOST_MPL_ASSERT((boost::is_same<ctype1, ctype2>));
BOOST_STATIC_ASSERT((std::is_same<ctype1, ctype2>::value));
sections.clear();
@ -1074,12 +1073,12 @@ inline void sectionalize(Geometry const& geometry,
typedef typename strategy::expand::services::default_strategy
<
typename boost::mpl::if_c
std::conditional_t
<
boost::is_same<typename tag<Geometry>::type, box_tag>::value,
std::is_same<typename tag<Geometry>::type, box_tag>::value,
box_tag,
segment_tag
>::type,
>,
typename cs_tag<Geometry>::type
>::type expand_strategy_type;

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -13,14 +13,14 @@
#include <cstddef>
#include <boost/type_traits/make_signed.hpp>
#include <type_traits>
namespace boost { namespace geometry
{
typedef boost::make_signed<std::size_t>::type signed_size_type;
typedef std::make_signed<std::size_t>::type signed_size_type;
}} // namespace boost::geometry

View File

@ -2,20 +2,18 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014.
// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SINGLE_GEOMETRY_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SINGLE_GEOMETRY_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <type_traits>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/tag.hpp>
@ -28,12 +26,14 @@ namespace detail_dispatch {
// Returns single geometry by Id
// for single geometries returns the geometry itself
template <typename Geometry,
bool IsMulti = boost::is_base_of
<
multi_tag,
typename geometry::tag<Geometry>::type
>::value
template
<
typename Geometry,
bool IsMulti = std::is_base_of
<
multi_tag,
typename geometry::tag<Geometry>::type
>::value
>
struct single_geometry
{

View File

@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014, 2018.
// Modifications copyright (c) 2013-2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -14,8 +14,7 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <type_traits>
#include <boost/geometry/algorithms/not_implemented.hpp>
@ -36,7 +35,7 @@ namespace detail_dispatch {
template <typename Geometry,
typename Tag = typename geometry::tag<Geometry>::type,
bool IsMulti = boost::is_base_of<multi_tag, Tag>::value>
bool IsMulti = std::is_base_of<multi_tag, Tag>::value>
struct sub_range : not_implemented<Tag>
{};
@ -80,12 +79,12 @@ template <typename Geometry, typename Tag>
struct sub_range<Geometry, Tag, true>
{
typedef typename boost::range_value<Geometry>::type value_type;
typedef typename boost::mpl::if_c
typedef std::conditional_t
<
boost::is_const<Geometry>::value,
typename boost::add_const<value_type>::type,
std::is_const<Geometry>::value,
typename std::add_const<value_type>::type,
value_type
>::type sub_type;
> sub_type;
typedef detail_dispatch::sub_range<sub_type> sub_sub_range;

View File

@ -21,6 +21,8 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_TOUCHES_IMPLEMENTATION_HPP
#include <type_traits>
#include <boost/geometry/algorithms/detail/for_each_range.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
@ -101,7 +103,7 @@ struct box_box
template <typename Box1, typename Box2, typename Strategy>
static inline bool apply(Box1 const& b1, Box2 const& b2, Strategy const& /*strategy*/)
{
BOOST_STATIC_ASSERT((boost::is_same
BOOST_STATIC_ASSERT((std::is_same
<
typename geometry::coordinate_system<Box1>::type,
typename geometry::coordinate_system<Box2>::type

View File

@ -9,23 +9,18 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_TUPLED_OUTPUT_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_TUPLED_OUTPUT_HPP
#include <boost/range/value_type.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/core/config.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/util/tuples.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/if.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/util/type_traits.hpp>
namespace boost { namespace geometry
{
@ -35,76 +30,21 @@ namespace boost { namespace geometry
namespace detail
{
// true for any geometry
template <typename T>
struct is_geometry
: boost::integral_constant
<
bool,
(! boost::is_void<typename geometry::tag<T>::type>::value)
>
{};
// true for multi-point, multi-linestring or multi-polygon
template <typename Geometry>
struct is_multi_geometry
: boost::is_base_of
<
geometry::multi_tag,
typename geometry::tag<Geometry>::type
>
{};
// true for point, linestring or polygon
template <typename T>
struct is_multi_geometry_element
: boost::integral_constant
<
bool,
((boost::is_same<typename geometry::tag<T>::type, point_tag>::value)
|| (boost::is_same<typename geometry::tag<T>::type, linestring_tag>::value)
|| (boost::is_same<typename geometry::tag<T>::type, polygon_tag>::value))
>
{};
template <typename T>
struct is_range_impl
{
typedef boost::type_traits::yes_type yes_type;
typedef boost::type_traits::no_type no_type;
template <typename U>
static yes_type test(typename boost::range_iterator<U>::type*);
template <typename U>
static no_type test(...);
static const bool value = (sizeof(test<T>(0)) == sizeof(yes_type));
};
// true if T is range (boost::range_iterator<T>::type is defined)
template <typename T>
struct is_range
: boost::integral_constant<bool, is_range_impl<T>::value>
{};
template <typename T, bool IsRange = is_range<T>::value>
template <typename T, bool IsRange = range::detail::is_range<T>::value>
struct is_tupled_output_element_base
: boost::integral_constant<bool, false>
: util::bool_constant<false>
{};
template <typename T>
struct is_tupled_output_element_base<T, true>
: boost::integral_constant
: util::bool_constant
<
bool,
(is_multi_geometry<T>::value
(util::is_multi<T>::value
||
((! is_geometry<T>::value)
(util::is_not_geometry<T>::value
&&
is_multi_geometry_element
util::is_multi_element
<
typename boost::range_value<T>::type
>::value))
@ -125,11 +65,10 @@ struct is_tupled_output_element
// a range of points, linestrings or polygons
template <typename Output>
struct is_tupled_output_check
: boost::mpl::and_
: util::bool_constant
<
boost::is_same<typename geometry::tag<Output>::type, void>,
//geometry::tuples::exists_if<Output, is_multi_geometry>
geometry::tuples::exists_if<Output, is_tupled_output_element>
(util::is_not_geometry<Output>::value
&& geometry::tuples::exists_if<Output, is_tupled_output_element>::value)
>
{};
@ -139,10 +78,10 @@ struct is_tupled_output_check
// or polygon
template <typename T>
struct is_tupled_single_output_check
: boost::mpl::and_
: util::bool_constant
<
boost::is_same<typename geometry::tag<T>::type, void>,
geometry::tuples::exists_if<T, is_multi_geometry_element>
(util::is_not_geometry<T>::value
&& geometry::tuples::exists_if<T, util::is_multi_element>::value)
>
{};
@ -150,7 +89,7 @@ struct is_tupled_single_output_check
// true if Output is boost::tuple, boost::tuples::cons, std::pair or std::tuple
template <typename T>
struct is_tupled
: boost::integral_constant<bool, false>
: util::bool_constant<false>
{};
template
@ -159,24 +98,24 @@ template
class T5, class T6, class T7, class T8, class T9
>
struct is_tupled<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
: boost::integral_constant<bool, true>
: util::bool_constant<true>
{};
template <typename HT, typename TT>
struct is_tupled<boost::tuples::cons<HT, TT> >
: boost::integral_constant<bool, true>
: util::bool_constant<true>
{};
template <typename F, typename S>
struct is_tupled<std::pair<F, S> >
: boost::integral_constant<bool, true>
: util::bool_constant<true>
{};
#ifdef BOOST_GEOMETRY_CXX11_TUPLE
template <typename ...Ts>
struct is_tupled<std::tuple<Ts...> >
: boost::integral_constant<bool, true>
: util::bool_constant<true>
{};
#endif // BOOST_GEOMETRY_CXX11_TUPLE
@ -187,7 +126,7 @@ struct is_tupled<std::tuple<Ts...> >
// and is_tupled_output_check defiend above passes
template <typename Output, bool IsTupled = is_tupled<Output>::value>
struct is_tupled_output
: boost::integral_constant<bool, false>
: util::bool_constant<false>
{};
template <typename Output>
@ -200,7 +139,7 @@ struct is_tupled_output<Output, true>
// and is_tupled_single_output_check defiend above passes
template <typename T, bool IsTupled = is_tupled<T>::value>
struct is_tupled_single_output
: boost::integral_constant<bool, false>
: util::bool_constant<false>
{};
template <typename T>
@ -214,7 +153,7 @@ struct tupled_output_find_index_pred
{
template <typename T>
struct pred
: boost::is_same<typename geometry::tag<T>::type, Tag>
: std::is_same<typename geometry::tag<T>::type, Tag>
{};
};
@ -236,14 +175,13 @@ template
bool IsTupledOutput = is_tupled_output<Output>::value
>
struct tupled_output_has
: boost::integral_constant<bool, false>
: util::bool_constant<false>
{};
template <typename Output, typename Tag>
struct tupled_output_has<Output, Tag, true>
: boost::integral_constant
: util::bool_constant
<
bool,
((tupled_output_find_index<Output, Tag>::value)
< (geometry::tuples::size<Output>::value))
>
@ -374,13 +312,11 @@ struct tupled_back_inserters<std::pair<F, S> >
#ifdef BOOST_GEOMETRY_CXX11_TUPLE
// NOTE: In C++14 std::integer_sequence and std::make_integer_sequence could be used
template <typename Is, typename Tuple>
struct tupled_back_inserters_st;
template <int ...Is, typename ...Ts>
struct tupled_back_inserters_st<geometry::tuples::int_sequence<Is...>, std::tuple<Ts...> >
template <std::size_t ...Is, typename ...Ts>
struct tupled_back_inserters_st<std::index_sequence<Is...>, std::tuple<Ts...> >
{
typedef std::tuple<geometry::range::back_insert_iterator<Ts>...> type;
@ -394,7 +330,7 @@ template <typename ...Ts>
struct tupled_back_inserters<std::tuple<Ts...> >
: tupled_back_inserters_st
<
typename geometry::tuples::make_int_sequence<sizeof...(Ts)>::type,
std::make_index_sequence<sizeof...(Ts)>,
std::tuple<Ts...>
>
{};
@ -452,7 +388,7 @@ struct is_tag_same_as_pred
{
template <typename T>
struct pred
: boost::is_same<typename geometry::tag<T>::type, Tag>
: std::is_same<typename geometry::tag<T>::type, Tag>
{};
};
@ -569,7 +505,7 @@ struct tupled_output_tag {};
template <typename GeometryOut>
struct setop_insert_output_tag
: boost::mpl::if_c
: std::conditional
<
geometry::detail::is_tupled_single_output<GeometryOut>::value,
tupled_output_tag,
@ -584,31 +520,28 @@ struct expect_output_assert_base;
template <typename Geometry1, typename Geometry2, typename TupledOut, bool IsFound>
struct expect_output_assert_base<Geometry1, Geometry2, TupledOut, IsFound, pointlike_tag>
{
BOOST_MPL_ASSERT_MSG
(
IsFound, POINTLIKE_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
(types<Geometry1, Geometry2, TupledOut>)
);
BOOST_GEOMETRY_STATIC_ASSERT(
IsFound,
"PointLike Geometry expected in tupled output.",
Geometry1, Geometry2, TupledOut);
};
template <typename Geometry1, typename Geometry2, typename TupledOut, bool IsFound>
struct expect_output_assert_base<Geometry1, Geometry2, TupledOut, IsFound, linear_tag>
{
BOOST_MPL_ASSERT_MSG
(
IsFound, LINEAR_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
(types<Geometry1, Geometry2, TupledOut>)
);
BOOST_GEOMETRY_STATIC_ASSERT(
IsFound,
"Linear Geometry expected in tupled output.",
Geometry1, Geometry2, TupledOut);
};
template <typename Geometry1, typename Geometry2, typename TupledOut, bool IsFound>
struct expect_output_assert_base<Geometry1, Geometry2, TupledOut, IsFound, areal_tag>
{
BOOST_MPL_ASSERT_MSG
(
IsFound, AREAL_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
(types<Geometry1, Geometry2, TupledOut>)
);
BOOST_GEOMETRY_STATIC_ASSERT(
IsFound,
"Areal Geometry expected in tupled output.",
Geometry1, Geometry2, TupledOut);
};
@ -692,7 +625,7 @@ template
<
typename Geometry,
typename SingleOut,
bool IsMulti = geometry::detail::is_multi_geometry<Geometry>::value
bool IsMulti = util::is_multi<Geometry>::value
>
struct convert_to_output
{

View File

@ -1,6 +1,6 @@
// Boost.Geometry
// Copyright (c) 2017, 2019 Oracle and/or its affiliates.
// Copyright (c) 2017-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -16,7 +16,6 @@
#include <vector>
#include <boost/range.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
#include <boost/geometry/algorithms/detail/disjoint/point_box.hpp>
@ -37,6 +36,8 @@
#include <boost/geometry/strategies/covered_by.hpp>
#include <boost/geometry/strategies/disjoint.hpp>
#include <boost/geometry/util/type_traits.hpp>
namespace boost { namespace geometry {
@ -167,15 +168,7 @@ struct multi_point_multi_geometry
{
typedef typename point_type<LinearOrAreal>::type point2_type;
typedef model::box<point2_type> box2_type;
static const bool is_linear = is_same
<
typename tag_cast
<
typename tag<LinearOrAreal>::type,
linear_tag
>::type,
linear_tag
>::value;
static const bool is_linear = util::is_linear<LinearOrAreal>::value;
typename Strategy::envelope_strategy_type const
envelope_strategy = strategy.get_envelope_strategy();

View File

@ -5,8 +5,8 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019.
// Modifications copyright (c) 2013-2019, Oracle and/or its affiliates.
// This file was modified by Oracle on 2013-2020.
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -22,10 +22,10 @@
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/assert.hpp>

View File

@ -25,9 +25,6 @@
#include <algorithm>
#include <boost/range.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
@ -42,8 +39,8 @@
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
#include <boost/geometry/util/range.hpp>
#include <boost/geometry/util/type_traits.hpp>
#include <boost/geometry/views/detail/indexed_point_view.hpp>
@ -110,21 +107,21 @@ struct fe_segment_segment
template <typename Range>
struct fe_range_value
{
typedef typename add_const_if_c
typedef util::transcribe_const_t
<
boost::is_const<Range>::value,
Range,
typename boost::range_value<Range>::type
>::type type;
> type;
};
template <typename Range>
struct fe_point_type
{
typedef typename add_const_if_c
typedef util::transcribe_const_t
<
boost::is_const<Range>::value,
Range,
typename point_type<Range>::type
>::type type;
> type;
};
@ -132,8 +129,8 @@ template <typename Range>
struct fe_point_type_is_referencable
{
static const bool value =
boost::is_const<Range>::value
|| boost::is_same
std::is_const<Range>::value
|| std::is_same
<
typename boost::range_reference<Range>::type,
typename fe_point_type<Range>::type&

View File

@ -4,8 +4,8 @@
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014, 2015.
// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -24,14 +24,6 @@
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/set.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>

View File

@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2018, 2019 Oracle and/or its affiliates.
// Copyright (c) 2018-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -13,6 +13,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_LINE_INTERPOLATE_HPP
#include <iterator>
#include <type_traits>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
@ -21,6 +22,7 @@
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@ -119,7 +121,7 @@ struct interpolate_range
p,
diff_distance);
policy.apply(p, pointlike);
if (boost::is_same<PointLike, point_t>::value)
if (std::is_same<PointLike, point_t>::value)
{
return;
}
@ -173,11 +175,9 @@ template
>
struct line_interpolate
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry, Pointlike);
};

View File

@ -4,10 +4,11 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
// This file was modified by Oracle on 2015-2020.
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -21,8 +22,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_NOT_IMPLEMENTED_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
@ -30,35 +30,13 @@ namespace boost { namespace geometry
{
namespace info
{
struct UNRECOGNIZED_GEOMETRY_TYPE {};
struct POINT {};
struct LINESTRING {};
struct POLYGON {};
struct RING {};
struct BOX {};
struct SEGMENT {};
struct MULTI_POINT {};
struct MULTI_LINESTRING {};
struct MULTI_POLYGON {};
struct GEOMETRY_COLLECTION {};
template <size_t D> struct DIMENSION {};
}
namespace nyi
{
struct not_implemented_tag {};
template
<
typename Term1,
typename Term2,
typename Term3
>
template <typename ...Terms>
struct not_implemented_error
{
@ -66,62 +44,20 @@ struct not_implemented_error
# define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD false
#endif
BOOST_MPL_ASSERT_MSG
(
BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD,
THIS_OPERATION_IS_NOT_OR_NOT_YET_IMPLEMENTED,
(
types<Term1, Term2, Term3>
)
);
BOOST_GEOMETRY_STATIC_ASSERT(
BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD,
"This operation is not or not yet implemented.",
Terms...);
};
template <typename Tag>
struct tag_to_term
{
typedef Tag type;
};
template <> struct tag_to_term<geometry_not_recognized_tag> { typedef info::UNRECOGNIZED_GEOMETRY_TYPE type; };
template <> struct tag_to_term<point_tag> { typedef info::POINT type; };
template <> struct tag_to_term<linestring_tag> { typedef info::LINESTRING type; };
template <> struct tag_to_term<polygon_tag> { typedef info::POLYGON type; };
template <> struct tag_to_term<ring_tag> { typedef info::RING type; };
template <> struct tag_to_term<box_tag> { typedef info::BOX type; };
template <> struct tag_to_term<segment_tag> { typedef info::SEGMENT type; };
template <> struct tag_to_term<multi_point_tag> { typedef info::MULTI_POINT type; };
template <> struct tag_to_term<multi_linestring_tag> { typedef info::MULTI_LINESTRING type; };
template <> struct tag_to_term<multi_polygon_tag> { typedef info::MULTI_POLYGON type; };
template <> struct tag_to_term<geometry_collection_tag> { typedef info::GEOMETRY_COLLECTION type; };
template <int D> struct tag_to_term<boost::mpl::int_<D> > { typedef info::DIMENSION<D> type; };
}
template
<
typename Term1 = void,
typename Term2 = void,
typename Term3 = void
>
template <typename ...Terms>
struct not_implemented
: nyi::not_implemented_tag,
nyi::not_implemented_error
<
typename boost::mpl::identity
<
typename nyi::tag_to_term<Term1>::type
>::type,
typename boost::mpl::identity
<
typename nyi::tag_to_term<Term2>::type
>::type,
typename boost::mpl::identity
<
typename nyi::tag_to_term<Term3>::type
>::type
>
nyi::not_implemented_error<Terms...>
{};

View File

@ -5,10 +5,11 @@
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -22,8 +23,6 @@
#include <cstddef>
#include <boost/mpl/size_t.hpp>
#include <boost/range.hpp>
#include <boost/variant/apply_visitor.hpp>

View File

@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014, Oracle and/or its affiliates.
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@ -12,9 +13,6 @@
#include <cstddef>
#include <boost/mpl/size_t.hpp>
#include <boost/mpl/times.hpp>
#include <boost/range.hpp>
#include <boost/variant/apply_visitor.hpp>

View File

@ -4,10 +4,10 @@
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -19,7 +19,7 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_PERIMETER_HPP
#define BOOST_GEOMETRY_ALGORITHMS_PERIMETER_HPP
#include <boost/range/metafunctions.hpp>
#include <boost/range/value_type.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@ -5,8 +5,8 @@
// Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2017.
// Modifications copyright (c) 2017 Oracle and/or its affiliates.
// This file was modified by Oracle on 2017-2020.
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -20,7 +20,6 @@
#include <deque>
#include <boost/range.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@ -5,6 +5,10 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -18,7 +22,6 @@
#include <algorithm>
#include <boost/range.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@ -5,6 +5,10 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -17,9 +21,9 @@
#include <cmath>
#include <iterator>
#include <type_traits>
#include <boost/range.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
@ -170,7 +174,7 @@ struct transform_polygon
// Note: here a resizeable container is assumed.
traits::resize
<
typename boost::remove_reference
typename std::remove_reference
<
typename traits::interior_mutable_type<Polygon2>::type
>::type

View File

@ -2,7 +2,7 @@
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014, 2017, 2018, 2019, 2020.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@ -16,7 +16,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_UNION_HPP
#include <boost/range/metafunctions.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>

View File

@ -5,6 +5,10 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -18,7 +22,6 @@
#include <algorithm>
#include <boost/range.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/core/interior_rings.hpp>

View File

@ -17,12 +17,11 @@
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/size_t.hpp>
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
@ -41,9 +40,9 @@ struct cross_product
// In Math, it is also well-defined for 7-dimension.
// Generalisation of cross product to n-dimension is defined as
// wedge product but it is not direct analogue to binary cross product.
BOOST_MPL_ASSERT_MSG((false),
NOT_IMPLEMENTED_FOR_THIS_DIMENSION,
(mpl::size_t<Dimension>));
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Dimension.",
std::integral_constant<std::size_t, Dimension>);
};
template <>

View File

@ -21,14 +21,11 @@
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
@ -57,10 +54,9 @@ namespace traits
template <typename Geometry, std::size_t Dimension, typename Enable = void>
struct access
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
@ -118,11 +114,11 @@ struct indexed_access_pointer
{
static constexpr CoordinateType get(Geometry const* geometry)
{
return traits::indexed_access<typename boost::remove_pointer<Geometry>::type, Index, Dimension>::get(*geometry);
return traits::indexed_access<typename std::remove_pointer<Geometry>::type, Index, Dimension>::get(*geometry);
}
static void set(Geometry* geometry, CoordinateType const& value)
{
traits::indexed_access<typename boost::remove_pointer<Geometry>::type, Index, Dimension>::set(*geometry, value);
traits::indexed_access<typename std::remove_pointer<Geometry>::type, Index, Dimension>::set(*geometry, value);
}
};
@ -166,7 +162,7 @@ struct indexed_access
};
template <typename Point, typename CoordinateType, std::size_t Dimension>
struct access<point_tag, Point, CoordinateType, Dimension, boost::false_type>
struct access<point_tag, Point, CoordinateType, Dimension, std::false_type>
{
static constexpr CoordinateType get(Point const& point)
{
@ -179,15 +175,15 @@ struct access<point_tag, Point, CoordinateType, Dimension, boost::false_type>
};
template <typename Point, typename CoordinateType, std::size_t Dimension>
struct access<point_tag, Point, CoordinateType, Dimension, boost::true_type>
struct access<point_tag, Point, CoordinateType, Dimension, std::true_type>
{
static constexpr CoordinateType get(Point const* point)
{
return traits::access<typename boost::remove_pointer<Point>::type, Dimension>::get(*point);
return traits::access<typename std::remove_pointer<Point>::type, Dimension>::get(*point);
}
static void set(Point* p, CoordinateType const& value)
{
traits::access<typename boost::remove_pointer<Point>::type, Dimension>::set(*p, value);
traits::access<typename std::remove_pointer<Point>::type, Dimension>::set(*p, value);
}
};
@ -199,7 +195,7 @@ template
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, boost::false_type>
struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, std::false_type>
: detail::indexed_access_non_pointer<Box, CoordinateType, Index, Dimension>
{};
@ -210,7 +206,7 @@ template
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, boost::true_type>
struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, std::true_type>
: detail::indexed_access_pointer<Box, CoordinateType, Index, Dimension>
{};
@ -222,7 +218,7 @@ template
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, boost::false_type>
struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, std::false_type>
: detail::indexed_access_non_pointer<Segment, CoordinateType, Index, Dimension>
{};
@ -234,7 +230,7 @@ template
std::size_t Index,
std::size_t Dimension
>
struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, boost::true_type>
struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, std::true_type>
: detail::indexed_access_pointer<Segment, CoordinateType, Index, Dimension>
{};
@ -278,10 +274,10 @@ constexpr inline typename coordinate_type<Geometry>::type get(Geometry const& ge
typedef core_dispatch::access
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type,
typename util::remove_cptrref<Geometry>::type,
typename coordinate_type<Geometry>::type,
Dimension,
typename boost::is_pointer<Geometry>::type
typename std::is_pointer<Geometry>::type
> coord_access_type;
return coord_access_type::get(geometry);
@ -311,10 +307,10 @@ inline void set(Geometry& geometry
typedef core_dispatch::access
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type,
typename util::remove_cptrref<Geometry>::type,
typename coordinate_type<Geometry>::type,
Dimension,
typename boost::is_pointer<Geometry>::type
typename std::is_pointer<Geometry>::type
> coord_access_type;
coord_access_type::set(geometry, value);
@ -344,11 +340,11 @@ constexpr inline typename coordinate_type<Geometry>::type get(Geometry const& ge
typedef core_dispatch::indexed_access
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type,
typename util::remove_cptrref<Geometry>::type,
typename coordinate_type<Geometry>::type,
Index,
Dimension,
typename boost::is_pointer<Geometry>::type
typename std::is_pointer<Geometry>::type
> coord_access_type;
return coord_access_type::get(geometry);
@ -379,11 +375,11 @@ inline void set(Geometry& geometry
typedef core_dispatch::indexed_access
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type,
typename util::remove_cptrref<Geometry>::type,
typename coordinate_type<Geometry>::type,
Index,
Dimension,
typename boost::is_pointer<Geometry>::type
typename std::is_pointer<Geometry>::type
> coord_access_type;
coord_access_type::set(geometry, value);

View File

@ -4,8 +4,8 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -19,14 +19,13 @@
#ifndef BOOST_GEOMETRY_CORE_CLOSURE_HPP
#define BOOST_GEOMETRY_CORE_CLOSURE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/size_t.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
{
@ -97,10 +96,14 @@ template <closure_selector Closure>
struct minimum_ring_size {};
template <>
struct minimum_ring_size<geometry::closed> : boost::mpl::size_t<4> {};
struct minimum_ring_size<geometry::closed>
: std::integral_constant<std::size_t, 4>
{};
template <>
struct minimum_ring_size<geometry::open> : boost::mpl::size_t<3> {};
struct minimum_ring_size<geometry::open>
: std::integral_constant<std::size_t, 3>
{};
}} // namespace detail::point_order
@ -115,11 +118,9 @@ namespace core_dispatch
template <typename Tag, typename Geometry>
struct closure
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
template <typename Box>
@ -191,7 +192,7 @@ struct closure
static const closure_selector value = core_dispatch::closure
<
typename tag<Geometry>::type,
typename util::bare_type<Geometry>::type
typename util::remove_cptrref<Geometry>::type
>::value;
};

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -17,11 +21,9 @@
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
{
@ -34,16 +36,15 @@ namespace traits
\par Geometries:
- point
\par Specializations should provide:
- value (should be derived from boost::mpl::int_<D>
- value (e.g. derived from std::integral_constant<std::size_t, D>)
\ingroup traits
*/
template <typename Point, typename Enable = void>
struct dimension
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Point type.",
Point);
};
} // namespace traits
@ -54,16 +55,22 @@ namespace core_dispatch
// Base class derive from its own specialization of point-tag
template <typename T, typename G>
struct dimension : dimension<point_tag, typename point_type<T, G>::type> {};
struct dimension
: dimension<point_tag, typename point_type<T, G>::type>::type
{};
template <typename P>
struct dimension<point_tag, P>
: traits::dimension<typename geometry::util::bare_type<P>::type>
: std::integral_constant
<
std::size_t,
traits::dimension<util::remove_cptrref_t<P>>::value
>
{
BOOST_MPL_ASSERT_MSG(
(traits::dimension<typename geometry::util::bare_type<P>::type>::value > 0),
INVALID_DIMENSION_VALUE,
(traits::dimension<typename geometry::util::bare_type<P>::type>)
BOOST_GEOMETRY_STATIC_ASSERT(
(traits::dimension<util::remove_cptrref_t<P>>::value > 0),
"Dimension has to be greater than 0.",
traits::dimension<util::remove_cptrref_t<P>>
);
};
@ -82,7 +89,7 @@ struct dimension
: core_dispatch::dimension
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type
typename util::remove_cptrref<Geometry>::type
>
{};
@ -90,26 +97,26 @@ struct dimension
\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
\ingroup utility
*/
template <typename Geometry, int Dimensions>
template <typename Geometry, std::size_t Dimensions>
constexpr inline void assert_dimension()
{
BOOST_STATIC_ASSERT(( static_cast<int>(dimension<Geometry>::value) == Dimensions ));
BOOST_STATIC_ASSERT(( dimension<Geometry>::value == Dimensions ));
}
/*!
\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
\ingroup utility
*/
template <typename Geometry, int Dimensions>
template <typename Geometry, std::size_t Dimensions>
constexpr inline void assert_dimension_less_equal()
{
BOOST_STATIC_ASSERT(( static_cast<int>(dimension<Geometry>::type::value) <= Dimensions ));
BOOST_STATIC_ASSERT(( dimension<Geometry>::value <= Dimensions ));
}
template <typename Geometry, int Dimensions>
template <typename Geometry, std::size_t Dimensions>
constexpr inline void assert_dimension_greater_equal()
{
BOOST_STATIC_ASSERT(( static_cast<int>(dimension<Geometry>::type::value) >= Dimensions ));
BOOST_STATIC_ASSERT(( dimension<Geometry>::value >= Dimensions ));
}
/*!
@ -119,7 +126,7 @@ constexpr inline void assert_dimension_greater_equal()
template <typename G1, typename G2>
constexpr inline void assert_dimension_equal()
{
BOOST_STATIC_ASSERT(( static_cast<size_t>(dimension<G1>::type::value) == static_cast<size_t>(dimension<G2>::type::value) ));
BOOST_STATIC_ASSERT(( dimension<G1>::value == dimension<G2>::value ));
}
}} // namespace boost::geometry

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -15,10 +19,9 @@
#define BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
#include <boost/mpl/assert.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
@ -39,10 +42,9 @@ namespace traits
template <typename Point, typename Enable = void>
struct coordinate_system
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Point type.",
Point);
};
} // namespace traits
@ -67,7 +69,7 @@ namespace core_dispatch
{
typedef typename traits::coordinate_system
<
typename geometry::util::bare_type<Point>::type
typename util::remove_cptrref<Point>::type
>::type type;
};
@ -89,7 +91,7 @@ struct coordinate_system
typedef typename core_dispatch::coordinate_system
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type
typename util::remove_cptrref<Geometry>::type
>::type type;
};

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -15,12 +19,11 @@
#define BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP
#include <boost/mpl/assert.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/promote_floating_point.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
@ -40,10 +43,9 @@ namespace traits
template <typename Point, typename Enable = void>
struct coordinate_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Point type.",
Point);
};
} // namespace traits
@ -66,7 +68,7 @@ struct coordinate_type<point_tag, Point>
{
typedef typename traits::coordinate_type
<
typename geometry::util::bare_type<Point>::type
typename util::remove_cptrref<Point>::type
>::type type;
};
@ -86,10 +88,10 @@ template <typename Geometry>
struct coordinate_type
{
typedef typename core_dispatch::coordinate_type
<
typename tag<Geometry>::type,
typename geometry::util::bare_type<Geometry>::type
>::type type;
<
typename tag<Geometry>::type,
typename util::remove_cptrref<Geometry>::type
>::type type;
};
template <typename Geometry>
@ -101,6 +103,19 @@ struct fp_coordinate_type
>::type type;
};
/*!
\brief assert_coordinate_type_equal, a compile-time check for equality of two coordinate types
\ingroup utility
*/
template <typename Geometry1, typename Geometry2>
constexpr inline void assert_coordinate_type_equal(Geometry1 const& , Geometry2 const& )
{
static_assert(std::is_same
<
typename coordinate_type<Geometry1>::type,
typename coordinate_type<Geometry2>::type
>::value, "Coordinate types in geometries should be the same");
}
}} // namespace boost::geometry

View File

@ -4,8 +4,8 @@
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014, 2018.
// Modifications copyright (c) 2014-2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -20,11 +20,11 @@
#ifndef BOOST_GEOMETRY_CORE_CS_HPP
#define BOOST_GEOMETRY_CORE_CS_HPP
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
@ -58,10 +58,9 @@ namespace core_detail
template <typename DegreeOrRadian>
struct define_angular_units
{
BOOST_MPL_ASSERT_MSG
((false),
COORDINATE_SYSTEM_UNITS_MUST_BE_DEGREES_OR_RADIANS,
(types<DegreeOrRadian>));
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Coordinate system unit must be degree or radian.",
DegreeOrRadian);
};
template <>
@ -298,9 +297,9 @@ struct cs_angular_units
template <typename Units, typename CsTag>
struct cs_tag_to_coordinate_system
{
BOOST_MPL_ASSERT_MSG((false),
NOT_IMPLEMENTED_FOR_THIS_COORDINATE_SYSTEM,
(types<CsTag>));
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this coordinate system.",
Units, CsTag);
};
template <typename Units>

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -16,15 +20,12 @@
#define BOOST_GEOMETRY_CORE_EXTERIOR_RING_HPP
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <type_traits>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
namespace boost { namespace geometry
@ -48,11 +49,9 @@ namespace traits
template <typename Polygon>
struct exterior_ring
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_POLYGON_TYPE
, (types<Polygon>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Polygon type.",
Polygon);
};
@ -67,11 +66,9 @@ namespace core_dispatch
template <typename Tag, typename Geometry>
struct exterior_ring
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Tag, Geometry);
};
@ -80,15 +77,11 @@ struct exterior_ring<polygon_tag, Polygon>
{
static
typename geometry::ring_return_type<Polygon>::type
apply(typename add_const_if_c
<
boost::is_const<Polygon>::type::value,
Polygon
>::type& polygon)
apply(Polygon& polygon)
{
return traits::exterior_ring
<
typename boost::remove_const<Polygon>::type
typename std::remove_const<Polygon>::type
>::get(polygon);
}
};

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -16,9 +20,9 @@
#define BOOST_GEOMETRY_CORE_GEOMETRY_ID_HPP
#include <boost/mpl/assert.hpp>
#include <boost/mpl/int.hpp>
#include <type_traits>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
@ -34,48 +38,46 @@ namespace core_dispatch
template <typename GeometryTag>
struct geometry_id
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<GeometryTag>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
GeometryTag);
};
template <>
struct geometry_id<point_tag> : boost::mpl::int_<1> {};
struct geometry_id<point_tag> : std::integral_constant<int, 1> {};
template <>
struct geometry_id<linestring_tag> : boost::mpl::int_<2> {};
struct geometry_id<linestring_tag> : std::integral_constant<int, 2> {};
template <>
struct geometry_id<polygon_tag> : boost::mpl::int_<3> {};
struct geometry_id<polygon_tag> : std::integral_constant<int, 3> {};
template <>
struct geometry_id<multi_point_tag> : boost::mpl::int_<4> {};
struct geometry_id<multi_point_tag> : std::integral_constant<int, 4> {};
template <>
struct geometry_id<multi_linestring_tag> : boost::mpl::int_<5> {};
struct geometry_id<multi_linestring_tag> : std::integral_constant<int, 5> {};
template <>
struct geometry_id<multi_polygon_tag> : boost::mpl::int_<6> {};
struct geometry_id<multi_polygon_tag> : std::integral_constant<int, 6> {};
template <>
struct geometry_id<segment_tag> : boost::mpl::int_<92> {};
struct geometry_id<segment_tag> : std::integral_constant<int, 92> {};
template <>
struct geometry_id<ring_tag> : boost::mpl::int_<93> {};
struct geometry_id<ring_tag> : std::integral_constant<int, 93> {};
template <>
struct geometry_id<box_tag> : boost::mpl::int_<94> {};
struct geometry_id<box_tag> : std::integral_constant<int, 94> {};
} // namespace core_dispatch
@ -86,7 +88,7 @@ struct geometry_id<box_tag> : boost::mpl::int_<94> {};
/*!
\brief Meta-function returning the id of a geometry type
\details The meta-function geometry_id defines a numerical ID (based on
boost::mpl::int_<...> ) for each geometry concept. A numerical ID is
std::integral_constant<int, ...> ) for each geometry concept. A numerical ID is
sometimes useful, and within Boost.Geometry it is used for the
reverse_dispatch metafuntion.
\note Used for e.g. reverse meta-function

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -15,14 +19,14 @@
#define BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP
#include <cstddef>
#include <type_traits>
#include <boost/mpl/assert.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/interior_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/interior_type.hpp>
namespace boost { namespace geometry
{
@ -45,11 +49,9 @@ namespace traits
template <typename Geometry>
struct interior_rings
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
@ -79,7 +81,7 @@ struct interior_rings<polygon_tag, Polygon>
{
return traits::interior_rings
<
typename boost::remove_const<Polygon>::type
typename std::remove_const<Polygon>::type
>::get(polygon);
}
};

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -15,13 +19,9 @@
#ifndef BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
#define BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
#include <type_traits>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
@ -45,21 +45,17 @@ namespace traits
template <typename Geometry>
struct interior_const_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
template <typename Geometry>
struct interior_mutable_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
@ -76,25 +72,23 @@ namespace core_dispatch
template <typename GeometryTag, typename Geometry>
struct interior_return_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
template <typename Polygon>
struct interior_return_type<polygon_tag, Polygon>
{
typedef typename boost::remove_const<Polygon>::type nc_polygon_type;
typedef typename std::remove_const<Polygon>::type nc_polygon_type;
typedef typename boost::mpl::if_
typedef std::conditional_t
<
boost::is_const<Polygon>,
std::is_const<Polygon>::value,
typename traits::interior_const_type<nc_polygon_type>::type,
typename traits::interior_mutable_type<nc_polygon_type>::type
>::type type;
> type;
};
@ -103,18 +97,16 @@ struct interior_return_type<polygon_tag, Polygon>
template <typename GeometryTag, typename Geometry>
struct interior_type
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
template <typename Polygon>
struct interior_type<polygon_tag, Polygon>
{
typedef typename boost::remove_reference
typedef typename std::remove_reference
<
typename interior_return_type<polygon_tag, Polygon>::type
>::type type;

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -16,44 +20,10 @@
#define BOOST_GEOMETRY_CORE_IS_AREAL_HPP
#include <boost/type_traits/integral_constant.hpp>
#include <boost/config/header_deprecated.hpp>
BOOST_HEADER_DEPRECATED("<boost/geometry/util/type_traits.hpp>")
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
template <typename GeometryTag> struct is_areal : boost::false_type {};
template <> struct is_areal<ring_tag> : boost::true_type {};
template <> struct is_areal<box_tag> : boost::true_type {};
template <> struct is_areal<polygon_tag> : boost::true_type {};
template <> struct is_areal<multi_polygon_tag> : boost::true_type {};
} // namespace core_dispatch
#endif
/*!
\brief Meta-function defining "true" for areal types (box, (multi)polygon, ring),
\note Used for tag dispatching and meta-function finetuning
\note Also a "ring" has areal properties within Boost.Geometry
\ingroup core
*/
template <typename Geometry>
struct is_areal : core_dispatch::is_areal<typename tag<Geometry>::type>
{};
}} // namespace boost::geometry
#include <boost/geometry/util/type_traits.hpp>
#endif // BOOST_GEOMETRY_CORE_IS_AREAL_HPP

View File

@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@ -16,9 +20,9 @@
#include <cstddef>
#include <type_traits>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace geometry
@ -36,7 +40,7 @@ namespace traits
template <typename Range>
struct rvalue_type
{
typedef typename boost::remove_reference<Range>::type& type;
typedef typename std::remove_reference<Range>::type& type;
};
@ -63,7 +67,7 @@ struct push_back
{
typedef typename boost::range_value
<
typename boost::remove_reference<Range>::type
typename std::remove_reference<Range>::type
>::type item_type;
static inline void apply(typename rvalue_type<Range>::type range,

View File

@ -4,8 +4,8 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// This file was modified by Oracle on 2014-2020.
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@ -20,13 +20,13 @@
#define BOOST_GEOMETRY_CORE_POINT_ORDER_HPP
#include <boost/mpl/assert.hpp>
#include <boost/range/value_type.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
{
@ -97,11 +97,9 @@ namespace core_dispatch
template <typename Tag, typename Geometry>
struct point_order
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
"Not implemented for this Geometry type.",
Geometry);
};
template <typename Point>
@ -178,7 +176,7 @@ struct point_order
static const order_selector value = core_dispatch::point_order
<
typename tag<Geometry>::type,
typename util::bare_type<Geometry>::type
typename util::remove_cptrref<Geometry>::type
>::value;
};

Some files were not shown because too many files have changed in this diff Show More