diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 59e6b2986b..dcde8ff81d 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -64,7 +64,7 @@ int main(void) #endif // Calculate intersection points (turn points) - using segment_ratio = bg::detail::segment_ratio_type::type; + using segment_ratio = bg::detail::segment_ratio_type::type; using turn_info = bg::detail::overlay::turn_info; std::vector turns; bg::detail::get_turns::no_interrupt_policy policy; diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index f5bbe2c401..f58bac90a7 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -134,13 +134,13 @@ struct buffered_piece_collection typedef buffer_turn_info < point_type, - typename segment_ratio_type::type + typename segment_ratio_type::type > buffer_turn_info_type; typedef buffer_turn_operation < point_type, - typename segment_ratio_type::type + typename segment_ratio_type::type > buffer_turn_operation_type; typedef std::vector turn_vector_type; diff --git a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp index dccaf7c5ae..babf0e989b 100644 --- a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp +++ b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -26,7 +26,6 @@ #include #include -#include #ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS # include @@ -74,7 +73,7 @@ inline bool has_self_intersections(Geometry const& geometry, typedef turn_info < point_type, - typename segment_ratio_type::type + typename segment_ratio_type::type > turn_info; std::deque turns; detail::disjoint::disjoint_interrupt_policy policy; diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp index 07c2076ecb..7444fb6a7a 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp @@ -26,7 +26,6 @@ #include #include -#include namespace boost { namespace geometry { @@ -51,11 +50,7 @@ class has_valid_self_turns typedef detail::overlay::turn_info < point_type, - typename segment_ratio_type - < - point_type, - no_rescale_policy - >::type + typename segment_ratio_type::type > turn_type; // returns true if all turns are valid diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 767601cf0f..2821512576 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -46,7 +46,6 @@ #include #include -#include #include #include @@ -397,7 +396,7 @@ struct intersection_areal_areal_point typedef detail::overlay::turn_info < PointOut, - typename segment_ratio_type::type + typename segment_ratio_type::type > turn_info; std::vector turns; diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index c139f7f7af..59526b44e4 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -44,8 +44,6 @@ #include #include -#include - #include #ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE @@ -257,7 +255,7 @@ struct overlay typedef detail::overlay::traversal_turn_info < point_type, - typename segment_ratio_type::type + typename segment_ratio_type::type > turn_info; typedef std::deque turn_container_type; diff --git a/include/boost/geometry/algorithms/detail/relate/turns.hpp b/include/boost/geometry/algorithms/detail/relate/turns.hpp index 1dd947f3e2..dab0e50932 100644 --- a/include/boost/geometry/algorithms/detail/relate/turns.hpp +++ b/include/boost/geometry/algorithms/detail/relate/turns.hpp @@ -22,8 +22,6 @@ #include -#include - #include #include #include @@ -65,7 +63,7 @@ struct get_turns > struct turn_info_type { - using ratio_type = typename segment_ratio_type::type; + using ratio_type = typename segment_ratio_type::type; using type = overlay::turn_info < turn_point_type, diff --git a/include/boost/geometry/policies/robustness/segment_ratio.hpp b/include/boost/geometry/policies/robustness/segment_ratio.hpp index 5b09f6c4e5..e10aaec51e 100644 --- a/include/boost/geometry/policies/robustness/segment_ratio.hpp +++ b/include/boost/geometry/policies/robustness/segment_ratio.hpp @@ -347,6 +347,11 @@ private : } }; +template +struct segment_ratio_type +{ + using type = segment_ratio::type>; +}; }} // namespace boost::geometry diff --git a/include/boost/geometry/policies/robustness/segment_ratio_type.hpp b/include/boost/geometry/policies/robustness/segment_ratio_type.hpp deleted file mode 100644 index 8f4d0096c4..0000000000 --- a/include/boost/geometry/policies/robustness/segment_ratio_type.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Bruno Lalande, Paris, France. -// 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) - -#ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP -#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP - -#include - -#include - -#include -#include - -namespace boost { namespace geometry { namespace detail -{ - -// Temporary meta-function to access segment-ratio for a policy -template -struct segment_ratio_type -{ - // Type in segment ratio is either the coordinate type, or for - // deprecated robust point types it is a long_long type - typedef std::conditional_t - < - std::is_same - < - typename rescale_policy_type::type, - no_rescale_policy_tag - >::value, - typename geometry::coordinate_type::type, - boost::long_long_type - > coordinate_type; - - // Define segment ratio based on the coordinate type - typedef geometry::segment_ratio type; -}; - - -}}} // namespace boost::geometry::deatil - - -#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP diff --git a/include/boost/geometry/strategies/intersection_strategies.hpp b/include/boost/geometry/strategies/intersection_strategies.hpp index e9a17305af..07aa756cb2 100644 --- a/include/boost/geometry/strategies/intersection_strategies.hpp +++ b/include/boost/geometry/strategies/intersection_strategies.hpp @@ -17,7 +17,6 @@ //#include #include -#include #include #include @@ -47,15 +46,10 @@ template struct intersection_strategies { private : - // for development BOOST_STATIC_ASSERT((! std::is_same::type::value)); - typedef segment_intersection_points < IntersectionPoint, - typename detail::segment_ratio_type - < - IntersectionPoint, RobustPolicy - >::type + typename segment_ratio_type::type > ip_type; public: