From 81cc9d635fe13e7f61bf105a86273b8ad6679a8c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 20 Aug 2024 08:24:33 +0200 Subject: [PATCH] feat: deprecate duplicate unused strategy distance_projected_point_ax --- .../cartesian/distance_projected_point_ax.hpp | 3 +- .../boost/geometry/strategies/strategies.hpp | 1 - test/algorithms/simplify.cpp | 60 -------------- test/algorithms/test_simplify.hpp | 45 ----------- test/strategies/CMakeLists.txt | 1 - test/strategies/Jamfile | 1 - test/strategies/projected_point_ax.cpp | 78 ------------------- test/strategies/test_projected_point.hpp | 10 --- 8 files changed, 2 insertions(+), 197 deletions(-) delete mode 100644 test/strategies/projected_point_ax.cpp diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp index d6ad0e0d6b..0128669f19 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp @@ -20,6 +20,8 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP +#include +BOOST_PRAGMA_MESSAGE("This include file is deprecated and will be removed in Boost 1.88") #include @@ -311,5 +313,4 @@ public : }} // namespace boost::geometry - #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP diff --git a/include/boost/geometry/strategies/strategies.hpp b/include/boost/geometry/strategies/strategies.hpp index d219d0053d..3c1e3984c8 100644 --- a/include/boost/geometry/strategies/strategies.hpp +++ b/include/boost/geometry/strategies/strategies.hpp @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include diff --git a/test/algorithms/simplify.cpp b/test/algorithms/simplify.cpp index b9237cd1d5..c06e6b8cad 100644 --- a/test/algorithms/simplify.cpp +++ b/test/algorithms/simplify.cpp @@ -27,49 +27,6 @@ #include #include -// #define TEST_PULL89 -#ifdef TEST_PULL89 -#include -#endif - - -#ifdef TEST_PULL89 -template -void test_with_ax(std::string const& wkt, - std::string const& expected, - T const& adt, - T const& xdt) -{ - typedef typename bg::point_type::type point_type; - typedef bg::strategy::distance::detail::projected_point_ax<> ax_type; - typedef typename bg::strategy::distance::services::return_type - < - bg::strategy::distance::detail::projected_point_ax<>, - point_type, - point_type - >::type return_type; - - typedef bg::strategy::distance::detail::projected_point_ax_less - < - return_type - > comparator_type; - - typedef bg::strategy::simplify::detail::douglas_peucker - < - point_type, - bg::strategy::distance::detail::projected_point_ax<>, - comparator_type - > dp_ax; - - return_type max_distance(adt, xdt); - comparator_type comparator(max_distance); - dp_ax strategy(comparator); - - test_geometry(wkt, expected, max_distance, strategy); -} -#endif - - template void test_all() { @@ -253,13 +210,6 @@ void test_all() test_geometry >( "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); - - -#ifdef TEST_PULL89 - test_with_ax >( - "LINESTRING(0 0,120 6,80 10,200 0)", - "LINESTRING(0 0,80 10,200 0)", 10, 7); -#endif } template @@ -275,16 +225,6 @@ void test_zigzag() test_geometry >(zigzag, expected150, 1.5001); test_geometry >(zigzag, expected200, 2.0001); test_geometry >(zigzag, expected225, 2.25); // should be larger than sqrt(5)=2.236 - -#ifdef TEST_PULL89 - // This should work (results might vary but should have LESS points then expected above - // Small xtd, larger adt, - test_with_ax >(zigzag, expected100, 1.0001, 1.0001); - test_with_ax >(zigzag, expected150, 1.5001, 1.0001); - test_with_ax >(zigzag, expected200, 2.0001, 1.0001); - test_with_ax >(zigzag, expected225, 2.25, 1.0001); -#endif - } diff --git a/test/algorithms/test_simplify.hpp b/test/algorithms/test_simplify.hpp index 0439a4313c..650b704d60 100644 --- a/test/algorithms/test_simplify.hpp +++ b/test/algorithms/test_simplify.hpp @@ -107,30 +107,6 @@ struct test_inserter test_equality::apply(simplified, expected); } - -#ifdef TEST_PULL89 - { - typedef typename bg::point_type::type point_type; - typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type::type distance_type; - typedef bg::strategy::distance::detail::projected_point_ax_less less_comparator; - - distance_type max_distance(distance); - less_comparator less(max_distance); - - bg::strategy::simplify::detail::douglas_peucker - < - point_type, - bg::strategy::distance::detail::projected_point_ax<>, - less_comparator - > strategy(less); - - Geometry simplified; - bg::detail::simplify::simplify_insert(geometry, - std::back_inserter(simplified), max_distance, strategy); - - test_equality::apply(simplified, expected); - } -#endif } }; @@ -214,27 +190,6 @@ void test_geometry(std::string const& wkt, < typename bg::tag::type >::apply(geometry, expected, distance); - -#ifdef TEST_PULL89 - // Check using non-default less comparator in douglass_peucker - typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type::type distance_type; - typedef bg::strategy::distance::detail::projected_point_ax_less less_comparator; - - distance_type const max_distance(distance); - less_comparator const less(max_distance); - - typedef bg::strategy::simplify::detail::douglas_peucker - < - point_type, - bg::strategy::distance::detail::projected_point_ax<>, - less_comparator - > douglass_peucker_with_less; - - BOOST_CONCEPT_ASSERT( (bg::concepts::SimplifyStrategy) ); - - check_geometry(geometry, expected, distance, douglass_peucker_with_less(less)); - check_geometry(v, expected, distance, douglass_peucker_with_less(less)); -#endif } template diff --git a/test/strategies/CMakeLists.txt b/test/strategies/CMakeLists.txt index 0286fbbc83..bebbb59b17 100644 --- a/test/strategies/CMakeLists.txt +++ b/test/strategies/CMakeLists.txt @@ -19,7 +19,6 @@ foreach(item IN ITEMS haversine point_in_box projected_point - projected_point_ax pythagoras pythagoras_point_box segment_intersection diff --git a/test/strategies/Jamfile b/test/strategies/Jamfile index 5daaf13342..6ed8fa14a5 100644 --- a/test/strategies/Jamfile +++ b/test/strategies/Jamfile @@ -31,7 +31,6 @@ test-suite boost-geometry-strategies [ run haversine.cpp : : : : strategies_haversine ] [ run point_in_box.cpp : : : : strategies_point_in_box ] [ run projected_point.cpp : : : : strategies_projected_point ] - [ run projected_point_ax.cpp : : : : strategies_projected_point_ax ] [ run pythagoras.cpp : : : : strategies_pythagoras ] [ run pythagoras_point_box.cpp : : : : strategies_pythagoras_point_box ] [ run segment_intersection.cpp : : : : strategies_segment_intersection ] diff --git a/test/strategies/projected_point_ax.cpp b/test/strategies/projected_point_ax.cpp deleted file mode 100644 index 71b71f7b42..0000000000 --- a/test/strategies/projected_point_ax.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// Unit Test - -// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// 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. - -// 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. - -// 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) - - -#include - - -template -void test_all_2d_ax() -{ - typedef bg::strategy::distance::detail::projected_point_ax<> strategy_type; - typedef bg::strategy::distance::detail::projected_point_ax - < - void, - bg::strategy::distance::comparable::pythagoras<> - > comparable_strategy_type; - - typedef typename strategy_type::result_type::type result_type; - - strategy_type strategy; - comparable_strategy_type comparable_strategy; - boost::ignore_unused(strategy, comparable_strategy); - - test_2d("POINT(1 1)", "POINT(0 0)", "POINT(2 3)", - result_type(0, 0.27735203958327), - result_type(0, 0.27735203958327 * 0.27735203958327), - strategy, comparable_strategy); - - test_2d("POINT(2 2)", "POINT(1 4)", "POINT(4 1)", - result_type(0, 0.5 * sqrt(2.0)), - result_type(0, 0.5), - strategy, comparable_strategy); - - test_2d("POINT(6 1)", "POINT(1 4)", "POINT(4 1)", - result_type(sqrt(2.0), sqrt(2.0)), - result_type(2.0, 2.0), - strategy, comparable_strategy); - - test_2d("POINT(1 6)", "POINT(1 4)", "POINT(4 1)", - result_type(sqrt(2.0), sqrt(2.0)), - result_type(2.0, 2.0), - strategy, comparable_strategy); -} - -template -void test_all_2d_ax() -{ - test_all_2d_ax >(); - test_all_2d_ax >(); - test_all_2d_ax >(); - test_all_2d_ax >(); -} - -int test_main(int, char* []) -{ - test_all_2d_ax >(); - test_all_2d_ax >(); - test_all_2d_ax >(); - - return 0; -} diff --git a/test/strategies/test_projected_point.hpp b/test/strategies/test_projected_point.hpp index b40bc12013..758f6d784a 100644 --- a/test/strategies/test_projected_point.hpp +++ b/test/strategies/test_projected_point.hpp @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -110,15 +109,6 @@ void test_check_close(T1 const& v1, T2 const& v2, double f) BOOST_CHECK_CLOSE(v1, v2, f); } -template -void test_check_close(bg::strategy::distance::detail::projected_point_ax_result const& v1, - bg::strategy::distance::detail::projected_point_ax_result const& v2, - double f) -{ - BOOST_CHECK_CLOSE(v1.atd, v2.atd, f); - BOOST_CHECK_CLOSE(v1.xtd, v2.xtd, f); -} - template void test_2d(std::string const& wkt_p, std::string const& wkt_sp1,