diff --git a/include/boost/geometry/algorithms/is_convex.hpp b/include/boost/geometry/algorithms/is_convex.hpp index 1df778d1b..8a3056113 100644 --- a/include/boost/geometry/algorithms/is_convex.hpp +++ b/include/boost/geometry/algorithms/is_convex.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. -// 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-2021. +// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -31,6 +31,11 @@ #include #include +// TEMP +#include +#include +#include + namespace boost { namespace geometry { @@ -45,8 +50,13 @@ struct ring_is_convex template static inline bool apply(Ring const& ring, SideStrategy const& strategy) { - typename SideStrategy::equals_point_point_strategy_type - eq_pp_strategy = strategy.get_equals_point_point_strategy(); + // TEMP + std::conditional_t + < + std::is_same::value, + strategy::within::cartesian_point_point, + strategy::within::spherical_point_point + > eq_pp_strategy; std::size_t n = boost::size(ring); if (boost::size(ring) < core_detail::closure::minimum_ring_size diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index fd8938efc..4cb263dd3 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021, 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 @@ -75,29 +75,7 @@ template > class projected_point { -public : - typedef within::cartesian_point_point equals_point_point_strategy_type; - - typedef intersection::cartesian_segments - < - CalculationType - > relate_segment_segment_strategy_type; - - static inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy() - { - return relate_segment_segment_strategy_type(); - } - - typedef within::cartesian_winding - < - void, void, CalculationType - > point_in_geometry_strategy_type; - - static inline point_in_geometry_strategy_type get_point_in_geometry_strategy() - { - return point_in_geometry_strategy_type(); - } - +public: // The three typedefs below are necessary to calculate distances // from segments defined in integer coordinates. diff --git a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp index 72406b7ef..c00e426a4 100644 --- a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp @@ -48,51 +48,6 @@ struct cartesian_segment_box typedef cartesian_tag cs_tag; - // point-point strategy getters - struct distance_pp_strategy - { - typedef Strategy type; - }; - - inline typename distance_pp_strategy::type get_distance_pp_strategy() const - { - return typename distance_pp_strategy::type(); - } - // point-segment strategy getters - struct distance_ps_strategy - { - typedef projected_point type; - }; - - inline typename distance_ps_strategy::type get_distance_ps_strategy() const - { - return typename distance_ps_strategy::type(); - } - - struct distance_pb_strategy - { - typedef pythagoras_point_box type; - }; - - inline typename distance_pb_strategy::type get_distance_pb_strategy() const - { - return typename distance_pb_strategy::type(); - } - - typedef side::side_by_triangle side_strategy_type; - - static inline side_strategy_type get_side_strategy() - { - return side_strategy_type(); - } - - typedef within::cartesian_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - template < typename LessEqual, typename ReturnType, diff --git a/include/boost/geometry/strategies/cartesian/intersection.hpp b/include/boost/geometry/strategies/cartesian/intersection.hpp index a3ac28f95..be7b92e59 100644 --- a/include/boost/geometry/strategies/cartesian/intersection.hpp +++ b/include/boost/geometry/strategies/cartesian/intersection.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021, 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 @@ -80,115 +80,6 @@ struct cartesian_segments { typedef cartesian_tag cs_tag; - typedef side::side_by_triangle side_strategy_type; - - static inline side_strategy_type get_side_strategy() - { - return side_strategy_type(); - } - - template - struct point_in_geometry_strategy - { - typedef strategy::within::cartesian_winding - < - typename point_type::type, - typename point_type::type, - CalculationType - > type; - }; - - template - static inline typename point_in_geometry_strategy::type - get_point_in_geometry_strategy() - { - typedef typename point_in_geometry_strategy - < - Geometry1, Geometry2 - >::type strategy_type; - return strategy_type(); - } - - template - struct area_strategy - { - typedef area::cartesian - < - CalculationType - > type; - }; - - template - static inline typename area_strategy::type get_area_strategy() - { - typedef typename area_strategy::type strategy_type; - return strategy_type(); - } - - template - struct distance_strategy - { - typedef distance::pythagoras - < - CalculationType - > type; - }; - - template - static inline typename distance_strategy::type get_distance_strategy() - { - typedef typename distance_strategy::type strategy_type; - return strategy_type(); - } - - typedef envelope::cartesian envelope_strategy_type; - - static inline envelope_strategy_type get_envelope_strategy() - { - return envelope_strategy_type(); - } - - typedef expand::cartesian_segment expand_strategy_type; - - static inline expand_strategy_type get_expand_strategy() - { - return expand_strategy_type(); - } - - typedef within::cartesian_point_point point_in_point_strategy_type; - - static inline point_in_point_strategy_type get_point_in_point_strategy() - { - return point_in_point_strategy_type(); - } - - typedef within::cartesian_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - - typedef disjoint::cartesian_box_box disjoint_box_box_strategy_type; - - static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy() - { - return disjoint_box_box_strategy_type(); - } - - typedef disjoint::segment_box disjoint_segment_box_strategy_type; - - static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() - { - return disjoint_segment_box_strategy_type(); - } - - typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type; - typedef covered_by::cartesian_point_box covered_by_point_box_strategy_type; - typedef within::cartesian_point_box within_point_box_strategy_type; - typedef envelope::cartesian_box envelope_box_strategy_type; - typedef expand::cartesian_box expand_box_strategy_type; - template struct segment_intersection_info { @@ -511,6 +402,7 @@ struct cartesian_segments return Policy::disjoint(); } + typedef side::side_by_triangle side_strategy_type; side_info sides; sides.set<0>(side_strategy_type::apply(q1, q2, p1), side_strategy_type::apply(q1, q2, p2)); diff --git a/include/boost/geometry/strategies/cartesian/line_interpolate.hpp b/include/boost/geometry/strategies/cartesian/line_interpolate.hpp index f80dd65c0..bc55da8fa 100644 --- a/include/boost/geometry/strategies/cartesian/line_interpolate.hpp +++ b/include/boost/geometry/strategies/cartesian/line_interpolate.hpp @@ -47,19 +47,6 @@ template class cartesian { public: - - // point-point strategy getters - struct distance_pp_strategy - { - typedef DistanceStrategy type; - }; - - inline typename distance_pp_strategy::type get_distance_pp_strategy() const - { - typedef typename distance_pp_strategy::type distance_type; - return distance_type(); - } - template inline void apply(Point const& p0, Point const& p1, diff --git a/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp b/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp index 9052b5fc4..b3556741c 100644 --- a/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp +++ b/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2020. -// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 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 @@ -94,43 +94,6 @@ class cartesian_winding public: typedef cartesian_tag cs_tag; - typedef side::side_by_triangle side_strategy_type; - - static inline side_strategy_type get_side_strategy() - { - return side_strategy_type(); - } - - typedef expand::cartesian_point expand_point_strategy_type; - - typedef typename side_strategy_type::envelope_strategy_type envelope_strategy_type; - - static inline envelope_strategy_type get_envelope_strategy() - { - return side_strategy_type::get_envelope_strategy(); - } - - typedef typename side_strategy_type::disjoint_strategy_type disjoint_strategy_type; - - static inline disjoint_strategy_type get_disjoint_strategy() - { - return side_strategy_type::get_disjoint_strategy(); - } - - typedef typename side_strategy_type::equals_point_point_strategy_type equals_point_point_strategy_type; - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return side_strategy_type::get_equals_point_point_strategy(); - } - - typedef disjoint::cartesian_box_box disjoint_box_box_strategy_type; - static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy() - { - return disjoint_box_box_strategy_type(); - } - - typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type; - // Typedefs and static methods to fulfill the concept typedef counter state_type; @@ -153,6 +116,7 @@ public: else // count == 2 || count == -2 { // 1 left, -1 right + typedef side::side_by_triangle side_strategy_type; side = side_strategy_type::apply(s1, s2, point); } diff --git a/include/boost/geometry/strategies/cartesian/side_by_triangle.hpp b/include/boost/geometry/strategies/cartesian/side_by_triangle.hpp index ea58e78e7..989f3fbb1 100644 --- a/include/boost/geometry/strategies/cartesian/side_by_triangle.hpp +++ b/include/boost/geometry/strategies/cartesian/side_by_triangle.hpp @@ -73,26 +73,6 @@ class side_by_triangle public : typedef cartesian_tag cs_tag; - typedef strategy::envelope::cartesian envelope_strategy_type; - - static inline envelope_strategy_type get_envelope_strategy() - { - return envelope_strategy_type(); - } - - typedef strategy::disjoint::segment_box disjoint_strategy_type; - - static inline disjoint_strategy_type get_disjoint_strategy() - { - return disjoint_strategy_type(); - } - - typedef strategy::within::cartesian_point_point equals_point_point_strategy_type; - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - // Template member function, because it is not always trivial // or convenient to explicitly mention the typenames in the // strategy-struct itself. diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp index a31f68c2e..e269703ef 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp @@ -89,32 +89,7 @@ template > class geographic_cross_track { -public : - typedef within::spherical_point_point equals_point_point_strategy_type; - - typedef intersection::geographic_segments - < - FormulaPolicy, - strategy::default_order::value, - Spheroid, - CalculationType - > relate_segment_segment_strategy_type; - - inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy() const - { - return relate_segment_segment_strategy_type(m_spheroid); - } - - typedef within::geographic_winding - < - void, void, FormulaPolicy, Spheroid, CalculationType - > point_in_geometry_strategy_type; - - inline point_in_geometry_strategy_type get_point_in_geometry_strategy() const - { - return point_in_geometry_strategy_type(m_spheroid); - } - +public: template struct return_type : promote_floating_point @@ -128,7 +103,9 @@ public : > {}; - explicit geographic_cross_track(Spheroid const& spheroid = Spheroid()) + geographic_cross_track() = default; + + explicit geographic_cross_track(Spheroid const& spheroid) : m_spheroid(spheroid) {} diff --git a/include/boost/geometry/strategies/geographic/distance_segment_box.hpp b/include/boost/geometry/strategies/geographic/distance_segment_box.hpp index 706ae1c3b..3b076b72d 100644 --- a/include/boost/geometry/strategies/geographic/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_segment_box.hpp @@ -59,68 +59,6 @@ struct geographic_segment_box typedef geographic_tag cs_tag; - // point-point strategy getters - struct distance_pp_strategy - { - typedef geographic type; - }; - - inline typename distance_pp_strategy::type get_distance_pp_strategy() const - { - typedef typename distance_pp_strategy::type distance_type; - return distance_type(m_spheroid); - } - // point-segment strategy getters - struct distance_ps_strategy - { - typedef geographic_cross_track - < - FormulaPolicy, - Spheroid, - CalculationType - > type; - }; - - inline typename distance_ps_strategy::type get_distance_ps_strategy() const - { - typedef typename distance_ps_strategy::type distance_type; - return distance_type(m_spheroid); - } - - struct distance_pb_strategy - { - typedef geographic_cross_track_point_box - < - FormulaPolicy, - Spheroid, - CalculationType - > type; - }; - - inline typename distance_pb_strategy::type get_distance_pb_strategy() const - { - return typename distance_pb_strategy::type(m_spheroid); - } - - typedef side::geographic - < - FormulaPolicy, - Spheroid, - CalculationType - > side_strategy_type; - - inline side_strategy_type get_side_strategy() const - { - return side_strategy_type(m_spheroid); - } - - typedef within::spherical_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - //constructor explicit geographic_segment_box(Spheroid const& spheroid = Spheroid()) diff --git a/include/boost/geometry/strategies/geographic/intersection.hpp b/include/boost/geometry/strategies/geographic/intersection.hpp index f157d7542..179ac6636 100644 --- a/include/boost/geometry/strategies/geographic/intersection.hpp +++ b/include/boost/geometry/strategies/geographic/intersection.hpp @@ -2,7 +2,7 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2016-2020, Oracle and/or its affiliates. +// Copyright (c) 2016-2021, 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, @@ -80,130 +80,6 @@ struct geographic_segments { typedef geographic_tag cs_tag; - typedef side::geographic - < - FormulaPolicy, Spheroid, CalculationType - > side_strategy_type; - - inline side_strategy_type get_side_strategy() const - { - return side_strategy_type(m_spheroid); - } - - template - struct point_in_geometry_strategy - { - typedef strategy::within::geographic_winding - < - typename point_type::type, - typename point_type::type, - FormulaPolicy, - Spheroid, - CalculationType - > type; - }; - - template - inline typename point_in_geometry_strategy::type - get_point_in_geometry_strategy() const - { - typedef typename point_in_geometry_strategy - < - Geometry1, Geometry2 - >::type strategy_type; - return strategy_type(m_spheroid); - } - - template - struct area_strategy - { - typedef area::geographic - < - FormulaPolicy, - Order, - Spheroid, - CalculationType - > type; - }; - - template - inline typename area_strategy::type get_area_strategy() const - { - typedef typename area_strategy::type strategy_type; - return strategy_type(m_spheroid); - } - - template - struct distance_strategy - { - typedef distance::geographic - < - FormulaPolicy, - Spheroid, - CalculationType - > type; - }; - - template - inline typename distance_strategy::type get_distance_strategy() const - { - typedef typename distance_strategy::type strategy_type; - return strategy_type(m_spheroid); - } - - typedef envelope::geographic - envelope_strategy_type; - - inline envelope_strategy_type get_envelope_strategy() const - { - return envelope_strategy_type(m_spheroid); - } - - typedef expand::geographic_segment - expand_strategy_type; - - inline expand_strategy_type get_expand_strategy() const - { - return expand_strategy_type(m_spheroid); - } - - typedef within::spherical_point_point point_in_point_strategy_type; - - static inline point_in_point_strategy_type get_point_in_point_strategy() - { - return point_in_point_strategy_type(); - } - - typedef within::spherical_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - - typedef disjoint::spherical_box_box disjoint_box_box_strategy_type; - - static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy() - { - return disjoint_box_box_strategy_type(); - } - - typedef disjoint::segment_box_geographic - < - FormulaPolicy, Spheroid, CalculationType - > disjoint_segment_box_strategy_type; - - inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() const - { - return disjoint_segment_box_strategy_type(m_spheroid); - } - - typedef covered_by::spherical_point_box disjoint_point_box_strategy_type; - typedef covered_by::spherical_point_box covered_by_point_box_strategy_type; - typedef within::spherical_point_box within_point_box_strategy_type; - typedef envelope::spherical_box envelope_box_strategy_type; - typedef expand::spherical_box expand_box_strategy_type; - enum intersection_point_flag { ipi_inters = 0, ipi_at_a1, ipi_at_a2, ipi_at_b1, ipi_at_b2 }; template diff --git a/include/boost/geometry/strategies/geographic/line_interpolate.hpp b/include/boost/geometry/strategies/geographic/line_interpolate.hpp index 5f1604714..53ed8e2b5 100644 --- a/include/boost/geometry/strategies/geographic/line_interpolate.hpp +++ b/include/boost/geometry/strategies/geographic/line_interpolate.hpp @@ -1,8 +1,9 @@ // Boost.Geometry -// Copyright (c) 2018, Oracle and/or its affiliates. +// Copyright (c) 2018-2021, 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -49,26 +50,12 @@ template class geographic { public: - geographic() - : m_spheroid() - {} + geographic() = default; explicit geographic(Spheroid const& spheroid) : m_spheroid(spheroid) {} - // point-point strategy getters - struct distance_pp_strategy - { - typedef distance::geographic type; - }; - - inline typename distance_pp_strategy::type get_distance_pp_strategy() const - { - typedef typename distance_pp_strategy::type distance_type; - return distance_type(m_spheroid); - } - template inline void apply(Point const& p0, Point const& p1, diff --git a/include/boost/geometry/strategies/geographic/point_in_poly_winding.hpp b/include/boost/geometry/strategies/geographic/point_in_poly_winding.hpp index fe45f8db7..a8f4c0e8c 100644 --- a/include/boost/geometry/strategies/geographic/point_in_poly_winding.hpp +++ b/include/boost/geometry/strategies/geographic/point_in_poly_winding.hpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2017, 2019 Oracle and/or its affiliates. +// Copyright (c) 2017-2021 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, diff --git a/include/boost/geometry/strategies/geographic/side.hpp b/include/boost/geometry/strategies/geographic/side.hpp index 901d4eba1..f9a6b23ab 100644 --- a/include/boost/geometry/strategies/geographic/side.hpp +++ b/include/boost/geometry/strategies/geographic/side.hpp @@ -67,38 +67,7 @@ class geographic public: typedef geographic_tag cs_tag; - typedef strategy::envelope::geographic - < - FormulaPolicy, - Spheroid, - CalculationType - > envelope_strategy_type; - - inline envelope_strategy_type get_envelope_strategy() const - { - return envelope_strategy_type(m_model); - } - - typedef strategy::disjoint::segment_box_geographic - < - FormulaPolicy, - Spheroid, - CalculationType - > disjoint_strategy_type; - - inline disjoint_strategy_type get_disjoint_strategy() const - { - return disjoint_strategy_type(m_model); - } - - typedef strategy::within::spherical_point_point equals_point_point_strategy_type; - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - - geographic() - {} + geographic() = default; explicit geographic(Spheroid const& model) : m_model(model) @@ -107,6 +76,7 @@ public: template inline int apply(P1 const& p1, P2 const& p2, P const& p) const { + typedef strategy::within::spherical_point_point equals_point_point_strategy_type; if (equals_point_point_strategy_type::apply(p, p1) || equals_point_point_strategy_type::apply(p, p2) || equals_point_point_strategy_type::apply(p1, p2)) diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp index ce7cf391d..f543a01c5 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021, 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 @@ -329,29 +329,7 @@ template > class cross_track { -public : - typedef within::spherical_point_point equals_point_point_strategy_type; - - typedef intersection::spherical_segments - < - CalculationType - > relate_segment_segment_strategy_type; - - static inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy() - { - return relate_segment_segment_strategy_type(); - } - - typedef within::spherical_winding - < - void, void, CalculationType - > point_in_geometry_strategy_type; - - static inline point_in_geometry_strategy_type get_point_in_geometry_strategy() - { - return point_in_geometry_strategy_type(); - } - +public: template struct return_type : promote_floating_point @@ -367,8 +345,7 @@ public : typedef typename Strategy::radius_type radius_type; - inline cross_track() - {} + cross_track() = default; explicit inline cross_track(typename Strategy::radius_type const& r) : m_strategy(r) diff --git a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp index 4677c1125..48e4fec21 100644 --- a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp @@ -214,55 +214,6 @@ struct spherical_segment_box typedef spherical_tag cs_tag; - // strategy getters - - // point-point strategy getters - struct distance_pp_strategy - { - typedef Strategy type; - }; - - inline Strategy get_distance_pp_strategy() const - { - return m_strategy; - } - // point-segment strategy getters - struct distance_ps_strategy - { - typedef cross_track type; - }; - - inline typename distance_ps_strategy::type get_distance_ps_strategy() const - { - return typename distance_ps_strategy::type(m_strategy.radius()); - } - - struct distance_pb_strategy - { - typedef cross_track_point_box type; - }; - - inline typename distance_pb_strategy::type get_distance_pb_strategy() const - { - return typename distance_pb_strategy::type(m_strategy.radius()); - } - - // TODO: why is the Radius not propagated above? - - typedef side::spherical_side_formula side_strategy_type; - - static inline side_strategy_type get_side_strategy() - { - return side_strategy_type(); - } - - typedef within::spherical_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - // constructors inline spherical_segment_box() diff --git a/include/boost/geometry/strategies/spherical/intersection.hpp b/include/boost/geometry/strategies/spherical/intersection.hpp index fdf7a1823..12995b828 100644 --- a/include/boost/geometry/strategies/spherical/intersection.hpp +++ b/include/boost/geometry/strategies/spherical/intersection.hpp @@ -96,119 +96,6 @@ struct ecef_segments { typedef spherical_tag cs_tag; - typedef side::spherical_side_formula side_strategy_type; - - static inline side_strategy_type get_side_strategy() - { - return side_strategy_type(); - } - - template - struct point_in_geometry_strategy - { - typedef strategy::within::spherical_winding - < - typename point_type::type, - typename point_type::type, - CalculationType - > type; - }; - - template - static inline typename point_in_geometry_strategy::type - get_point_in_geometry_strategy() - { - typedef typename point_in_geometry_strategy - < - Geometry1, Geometry2 - >::type strategy_type; - return strategy_type(); - } - - template - struct area_strategy - { - typedef area::spherical - < - typename coordinate_type::type, - CalculationType - > type; - }; - - template - static inline typename area_strategy::type get_area_strategy() - { - typedef typename area_strategy::type strategy_type; - return strategy_type(); - } - - template - struct distance_strategy - { - typedef distance::haversine - < - typename coordinate_type::type, - CalculationType - > type; - }; - - template - static inline typename distance_strategy::type get_distance_strategy() - { - typedef typename distance_strategy::type strategy_type; - return strategy_type(); - } - - typedef envelope::spherical - envelope_strategy_type; - - static inline envelope_strategy_type get_envelope_strategy() - { - return envelope_strategy_type(); - } - - typedef expand::spherical_segment - expand_strategy_type; - - static inline expand_strategy_type get_expand_strategy() - { - return expand_strategy_type(); - } - - typedef within::spherical_point_point point_in_point_strategy_type; - - static inline point_in_point_strategy_type get_point_in_point_strategy() - { - return point_in_point_strategy_type(); - } - - typedef within::spherical_point_point equals_point_point_strategy_type; - - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - - typedef disjoint::spherical_box_box disjoint_box_box_strategy_type; - - static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy() - { - return disjoint_box_box_strategy_type(); - } - - typedef disjoint::segment_box_spherical disjoint_segment_box_strategy_type; - - static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() - { - return disjoint_segment_box_strategy_type(); - } - - typedef covered_by::spherical_point_box disjoint_point_box_strategy_type; - typedef covered_by::spherical_point_box covered_by_point_box_strategy_type; - typedef within::spherical_point_box within_point_box_strategy_type; - typedef envelope::spherical_box envelope_box_strategy_type; - typedef expand::spherical_box expand_box_strategy_type; - enum intersection_point_flag { ipi_inters = 0, ipi_at_a1, ipi_at_a2, ipi_at_b1, ipi_at_b2 }; // segment_intersection_info cannot outlive relate_ecef_segments diff --git a/include/boost/geometry/strategies/spherical/line_interpolate.hpp b/include/boost/geometry/strategies/spherical/line_interpolate.hpp index 1951787be..0d2fcd486 100644 --- a/include/boost/geometry/strategies/spherical/line_interpolate.hpp +++ b/include/boost/geometry/strategies/spherical/line_interpolate.hpp @@ -52,8 +52,7 @@ public: typedef typename DistanceStrategy::radius_type radius_type; - inline spherical() - {} + spherical() = default; explicit inline spherical(typename DistanceStrategy::radius_type const& r) : m_strategy(r) @@ -63,17 +62,6 @@ public: : m_strategy(s) {} - // point-point strategy getters - struct distance_pp_strategy - { - typedef DistanceStrategy type; - }; - - inline typename distance_pp_strategy::type get_distance_pp_strategy() const - { - return m_strategy; - } - template inline void apply(Point const& p0, Point const& p1, diff --git a/include/boost/geometry/strategies/spherical/point_in_poly_winding.hpp b/include/boost/geometry/strategies/spherical/point_in_poly_winding.hpp index b94a97ca5..c475105d7 100644 --- a/include/boost/geometry/strategies/spherical/point_in_poly_winding.hpp +++ b/include/boost/geometry/strategies/spherical/point_in_poly_winding.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2020. -// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 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 @@ -123,45 +123,7 @@ class spherical_winding_base public: typedef typename SideStrategy::cs_tag cs_tag; - typedef SideStrategy side_strategy_type; - - inline side_strategy_type get_side_strategy() const - { - return m_side_strategy; - } - - typedef expand::spherical_point expand_point_strategy_type; - - typedef typename SideStrategy::envelope_strategy_type envelope_strategy_type; - - inline envelope_strategy_type get_envelope_strategy() const - { - return m_side_strategy.get_envelope_strategy(); - } - - typedef typename SideStrategy::disjoint_strategy_type disjoint_strategy_type; - - inline disjoint_strategy_type get_disjoint_strategy() const - { - return m_side_strategy.get_disjoint_strategy(); - } - - typedef typename SideStrategy::equals_point_point_strategy_type equals_point_point_strategy_type; - inline equals_point_point_strategy_type get_equals_point_point_strategy() const - { - return m_side_strategy.get_equals_point_point_strategy(); - } - - typedef disjoint::spherical_box_box disjoint_box_box_strategy_type; - static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy() - { - return disjoint_box_box_strategy_type(); - } - - typedef covered_by::spherical_point_box disjoint_point_box_strategy_type; - - spherical_winding_base() - {} + spherical_winding_base() = default; template explicit spherical_winding_base(Model const& model) diff --git a/include/boost/geometry/strategies/spherical/ssf.hpp b/include/boost/geometry/strategies/spherical/ssf.hpp index c787c074e..d1e0e1352 100644 --- a/include/boost/geometry/strategies/spherical/ssf.hpp +++ b/include/boost/geometry/strategies/spherical/ssf.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016-2020. -// Modifications copyright (c) 2016-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, 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, @@ -88,26 +88,6 @@ class spherical_side_formula public : typedef spherical_tag cs_tag; - typedef strategy::envelope::spherical envelope_strategy_type; - - static inline envelope_strategy_type get_envelope_strategy() - { - return envelope_strategy_type(); - } - - typedef strategy::disjoint::segment_box_spherical disjoint_strategy_type; - - static inline disjoint_strategy_type get_disjoint_strategy() - { - return disjoint_strategy_type(); - } - - typedef strategy::within::spherical_point_point equals_point_point_strategy_type; - static inline equals_point_point_strategy_type get_equals_point_point_strategy() - { - return equals_point_point_strategy_type(); - } - template static inline int apply(P1 const& p1, P2 const& p2, P const& p) {