From 07dd079033ed4956eb10e7ef45fe88249e86ee4b Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 2 Mar 2019 13:39:50 +0100 Subject: [PATCH] [CONFIG] Use a positive define (USE_RESCALING) instead of an unclear negative one (NO_ROBUSTNESS). Precedes removing of the rescaling. --- .../detail/buffer/turn_in_piece_visitor.hpp | 9 +++++---- include/boost/geometry/core/config.hpp | 6 ++++++ .../robustness/get_rescale_policy.hpp | 7 ++++--- test/algorithms/buffer/buffer_countries.cpp | 2 +- .../buffer/buffer_multi_linestring.cpp | 6 +++--- test/algorithms/buffer/buffer_multi_point.cpp | 4 ++-- .../buffer/buffer_multi_polygon.cpp | 16 +++++++-------- test/algorithms/buffer/buffer_polygon.cpp | 6 +++--- test/algorithms/overlay/overlay.cpp | 4 ++-- .../set_operations/difference/difference.cpp | 16 +++++++-------- .../difference/difference_areal_linear.cpp | 4 ---- .../difference/difference_multi.cpp | 14 ++++++------- .../difference_multi_areal_linear.cpp | 4 ---- .../difference/test_difference.hpp | 4 ++-- .../intersection/intersection.cpp | 12 +++++------ .../intersection/intersection_multi.cpp | 6 +++--- .../intersection/test_intersection.hpp | 7 ++++--- .../set_operations/union/test_union.hpp | 7 ++++--- .../algorithms/set_operations/union/union.cpp | 20 +++++++++---------- .../set_operations/union/union_multi.cpp | 8 ++++---- 20 files changed, 82 insertions(+), 80 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp b/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp index 97407c320..5e2258dfc 100644 --- a/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -127,13 +128,13 @@ inline bool in_box(Point const& previous, template struct use_side_of_intersection {}; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) -template <> -struct use_side_of_intersection { static bool const value = false; }; -#else +#if defined(BOOST_GEOMETRY_USE_RESCALING) // With rescaling, let Cartesian use side-of-intersection template <> struct use_side_of_intersection { static bool const value = true; }; +#else +template <> +struct use_side_of_intersection { static bool const value = false; }; #endif template <> diff --git a/include/boost/geometry/core/config.hpp b/include/boost/geometry/core/config.hpp index b2f27501b..c068e98cc 100644 --- a/include/boost/geometry/core/config.hpp +++ b/include/boost/geometry/core/config.hpp @@ -17,4 +17,10 @@ #define BOOST_GEOMETRY_CXX11_ARRAY_UNIFIED_INITIALIZATION #endif +// Rescaling is turned on, unless NO_ROBUSTNESS is defined +// In future versions of Boost.Geometry, it will be turned off by default +#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#define BOOST_GEOMETRY_USE_RESCALING +#endif + #endif // BOOST_GEOMETRY_CORE_CONFIG_HPP diff --git a/include/boost/geometry/policies/robustness/get_rescale_policy.hpp b/include/boost/geometry/policies/robustness/get_rescale_policy.hpp index daf32d305..9bb3f885a 100644 --- a/include/boost/geometry/policies/robustness/get_rescale_policy.hpp +++ b/include/boost/geometry/policies/robustness/get_rescale_policy.hpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -249,9 +250,7 @@ struct rescale_policy_type : public detail::get_rescale_policy::rescale_policy_type < Point, -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - false -#else +#if defined(BOOST_GEOMETRY_USE_RESCALING) boost::is_floating_point < typename geometry::coordinate_type::type @@ -262,6 +261,8 @@ struct rescale_policy_type typename geometry::coordinate_system::type, geometry::cs::cartesian >::value +#else + false #endif > { diff --git a/test/algorithms/buffer/buffer_countries.cpp b/test/algorithms/buffer/buffer_countries.cpp index daaa579e7..ccddbfe20 100644 --- a/test/algorithms/buffer/buffer_countries.cpp +++ b/test/algorithms/buffer/buffer_countries.cpp @@ -134,7 +134,7 @@ void test_one(std::string const& caseid, std::string const& wkt, double expected settings.tolerance = 10000.0; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) // in case robustness policies are changed, areas should be adapted settings.tolerance = boost::starts_with(caseid, "no") ? 200000.0 : 100000.0; #endif diff --git a/test/algorithms/buffer/buffer_multi_linestring.cpp b/test/algorithms/buffer/buffer_multi_linestring.cpp index 41747f537..69703ba2f 100644 --- a/test/algorithms/buffer/buffer_multi_linestring.cpp +++ b/test/algorithms/buffer/buffer_multi_linestring.cpp @@ -141,7 +141,7 @@ void test_all() } { -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) // Coordinates in one linestring vary so much that // length = geometry::math::sqrt(dx * dx + dy * dy); returns a value of inf for length // That geometry is skipped for the buffer @@ -173,7 +173,7 @@ void test_all() mysql_23023665_1, join_round32, end_round32, 1, 1, 186.5504, 1.0); test_one("touching1_1", touching1, join_round32, end_round32, 2, 0, 78.70773, 1.0 -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) , ut_settings::ignore_validity() // false positive, due to rescaling. As we remove it, it is gone #endif ); @@ -199,7 +199,7 @@ void test_all() test_one("mysql_23023665_1_20", mysql_23023665_1, join_round32, end_flat, 1, 1, 350.1135, 2.0); -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) { ut_settings settings(10.0); test_one("ticket_13444_1", diff --git a/test/algorithms/buffer/buffer_multi_point.cpp b/test/algorithms/buffer/buffer_multi_point.cpp index bca1f6240..ee7793997 100644 --- a/test/algorithms/buffer/buffer_multi_point.cpp +++ b/test/algorithms/buffer/buffer_multi_point.cpp @@ -47,7 +47,7 @@ void test_all() test_one("simplex3", simplex, join, end_flat, 44.5692, 3.0); test_one("three1", three, join, end_flat, 3.0 * pi, 1.0); -#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) // For no-rescaling, fails in CCW mode test_one("three2", three, join, end_flat, 36.7592, 2.0); #endif @@ -122,7 +122,7 @@ void test_many_points_per_circle() using bg::strategy::buffer::point_circle; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) double const tolerance = 1000.0; #else double const tolerance = 1.0; diff --git a/test/algorithms/buffer/buffer_multi_polygon.cpp b/test/algorithms/buffer/buffer_multi_polygon.cpp index b94a3b77e..73c8c32bf 100644 --- a/test/algorithms/buffer/buffer_multi_polygon.cpp +++ b/test/algorithms/buffer/buffer_multi_polygon.cpp @@ -371,7 +371,7 @@ void test_all() test_one("rt_g1", rt_g1, join_round, end_flat, 24.719, 1.0); test_one("rt_g3", rt_g3, join_miter, end_flat, 16.5711, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_d", rt_d, join_miter, end_flat, 19.8823, 0.3); test_one("rt_e", rt_e, join_miter, end_flat, 15.1198, 0.3); test_one("rt_f", rt_f, join_miter, end_flat, 4.60853, 0.3); @@ -388,7 +388,7 @@ void test_all() test_one("rt_k", rt_k, join_round, end_flat, 42.0092, 1.0); test_one("rt_k", rt_k, join_miter, end_flat, 48.0563, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_l", rt_l, join_miter, end_flat, 19.3995, 1.0); #endif @@ -400,7 +400,7 @@ void test_all() test_one("rt_o1", rt_o1, join_round, end_flat, 17.536, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_o1", rt_o1, join_miter, end_flat, 20.9142, 1.0); test_one("rt_o2", rt_o2, join_miter, end_flat, 25.7426, 1.0); test_one("rt_o3", rt_o3, join_miter, end_flat, 28.8247, 1.0); @@ -412,7 +412,7 @@ void test_all() test_one("rt_p3", rt_p3, join_miter, end_flat, 22.3995, 1.0); test_one("rt_p4", rt_p4, join_miter, end_flat, 33.0563, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_p5", rt_p5, join_miter, end_flat, 17.0, 1.0); #endif @@ -429,7 +429,7 @@ void test_all() test_one("rt_p15", rt_p15, join_miter, end_flat, 23.6569, 1.0); test_one("rt_p16", rt_p16, join_miter, end_flat, 23.4853, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_p17", rt_p17, join_miter, end_flat, 25.3137, 1.0); #endif @@ -437,7 +437,7 @@ void test_all() test_one("rt_p19", rt_p19, join_miter, end_flat, 25.5637, 1.0); test_one("rt_p20", rt_p20, join_miter, end_flat, 25.4853, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_p21", rt_p21, join_miter, end_flat, 17.1716, 1.0); #endif @@ -447,14 +447,14 @@ void test_all() test_one("rt_q2", rt_q2, join_miter, end_flat, 26.4853, 1.0); test_one("rt_q2", rt_q2, join_miter, end_flat, 0.9697, -0.25); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_r", rt_r, join_miter, end_flat, 21.0761, 1.0); #endif test_one("rt_s1", rt_s1, join_miter, end_flat, 20.4853, 1.0); test_one("rt_s2", rt_s2, join_miter, end_flat, 24.6495, 1.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("rt_t1", rt_t, join_miter, end_flat, 15.6569, 1.0); #endif diff --git a/test/algorithms/buffer/buffer_polygon.cpp b/test/algorithms/buffer/buffer_polygon.cpp index f36454139..a04b5a6cc 100644 --- a/test/algorithms/buffer/buffer_polygon.cpp +++ b/test/algorithms/buffer/buffer_polygon.cpp @@ -368,7 +368,7 @@ void test_all() test_one("snake4", snake, join_miter, end_flat, 64.44, 0.4); test_one("snake5", snake, join_miter, end_flat, 72, 0.5); test_one("snake6", snake, join_miter, end_flat, 75.44, 0.6); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("snake16", snake, join_miter, end_flat, 114.24, 1.6); #endif @@ -508,7 +508,7 @@ void test_all() test_one("parcel1_20", parcel1, join_round, end_flat, 209.3579, -20.0); test_one("parcel1_20", parcel1, join_miter, end_flat, 188.4224, -20.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("nl_part1_2", nl_part1, join_round, end_flat, 1848737356.991, -0.2 * 1000.0); test_one("nl_part1_5", nl_part1, join_round, end_flat, 1775953811.679, -0.5 * 1000.0); #else @@ -516,7 +516,7 @@ void test_all() test_one("nl_part1_5", nl_part1, join_round, end_flat, 1775953824.799, -0.5 * 1000.0); #endif -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("italy_part1_30", italy_part1, join_round, end_flat, 5015638814.956, 30.0 * 1000.0); test_one("italy_part1_50", italy_part1, join_round, end_flat, 11363180044.822, 50.0 * 1000.0); #else diff --git a/test/algorithms/overlay/overlay.cpp b/test/algorithms/overlay/overlay.cpp index 52e5c3c56..ea9786b12 100644 --- a/test/algorithms/overlay/overlay.cpp +++ b/test/algorithms/overlay/overlay.cpp @@ -373,8 +373,8 @@ void test_overlay(std::string const& caseid, << "_" << string_from_type::type>::name() << (ccw ? "_ccw" : "") << (open ? "_open" : "") -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - << "_no_rob" +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" #endif << ".svg"; diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index 958c644ce..a8cb6a454 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -51,7 +51,7 @@ void test_all() typedef typename bg::coordinate_type

::type ct; ut_settings sym_settings; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) sym_settings.sym_difference = false; #endif @@ -263,7 +263,7 @@ void test_all() 1, 61, 10.2717, 1, 61, 10.2717); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) { test_one("buffer_mp2", @@ -287,7 +287,7 @@ void test_all() { ut_settings settings; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) settings.percentage = 0.1; settings.test_validity = false; #else @@ -371,7 +371,7 @@ void test_all() 1, -1, 35723.8506317139 + 58456.4964294434); } -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) { // symmetric difference is not valid due to robustness issue, it has // two turns (touch_only) and a midpoint is located in other polygon @@ -392,7 +392,7 @@ void test_all() 1, 5, 384.2295081964694, tolerance(0.01)); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) // 2011-07-02 / 2014-06-19 // Interesting FP-precision case. // sql server gives: 6.62295817619452E-05 @@ -423,7 +423,7 @@ void test_all() 1, 10, 10.03103292, 0, 0, 0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ticket_9081_15", ticket_9081_15[0], ticket_9081_15[1], 2, 10, 0.0334529710902111, @@ -435,7 +435,7 @@ void test_all() 2, 12, 0.0451236449624935, 0, 0, 0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ticket_9563", ticket_9563[0], ticket_9563[1], 0, 0, 0, @@ -448,7 +448,7 @@ void test_all() 1, 4, 0.029019232, sym_settings); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ticket_10108_b", ticket_10108_b[0], ticket_10108_b[1], 1, 5, 1081.68697, diff --git a/test/algorithms/set_operations/difference/difference_areal_linear.cpp b/test/algorithms/set_operations/difference/difference_areal_linear.cpp index f29d78054..a44193e6e 100644 --- a/test/algorithms/set_operations/difference/difference_areal_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_areal_linear.cpp @@ -18,10 +18,6 @@ #include #include -// If defined, tests are run without rescaling-to-integer or robustness policy -// Test which would fail then are disabled automatically -// #define BOOST_GEOMETRY_NO_ROBUSTNESS - #include #include diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index c6fb62e26..b91192e88 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -109,7 +109,7 @@ void test_areal() { ut_settings settings; -#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) settings.sym_difference = false; #endif @@ -154,7 +154,7 @@ void test_areal() TEST_DIFFERENCE_WITH(0, 1, ggl_list_20120221_volker, 2, 7962.66, 2, 2775258.93, 4); } -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) { ut_settings settings; settings.sym_difference = false; // Validity problem in sym difference @@ -166,7 +166,7 @@ void test_areal() // With no-robustness this one misses one of the outputs ut_settings settings; settings.percentage = 0.001; // tolerance -#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) settings.test_validity = false; #endif test_one("ticket_9081", @@ -343,7 +343,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_78, 11, 5.5, 8, 4.5, 14); TEST_DIFFERENCE(case_recursive_boxes_79, 2, 1.25, 6, 4.5, 8); -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) TEST_DIFFERENCE(case_recursive_boxes_80, 1, 0.5, 2, 0.75, 2); #else // one polygon is divided into two, for same reason as union creates a small @@ -355,7 +355,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_82, 5, 7.25, 7, 4.5, 8); TEST_DIFFERENCE(case_recursive_boxes_83, 9, 5.25, 8, 5.25, 12); TEST_DIFFERENCE(case_recursive_boxes_84, 4, 8.0, 7, 9.0, 4); -#ifdef BOOST_GEOMETRY_NO_ROBUSTNESS +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) TEST_DIFFERENCE(case_recursive_boxes_85, 4, 4.0, 7, 3.75, 9); #endif @@ -370,7 +370,7 @@ void test_areal() { ut_settings sym_settings; - #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) + #if ! defined(BOOST_GEOMETRY_USE_RESCALING) sym_settings.sym_difference = false; #endif test_one("mysql_21965285_b", @@ -381,7 +381,7 @@ void test_areal() sym_settings); } -#ifdef BOOST_GEOMETRY_NO_ROBUSTNESS +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) TEST_DIFFERENCE(mysql_regression_1_65_2017_08_31, 0, 0.0, 3, 152.0642, 3); #else TEST_DIFFERENCE(mysql_regression_1_65_2017_08_31, 1, 4.30697514e-7, 3, 152.0642, 4); diff --git a/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp b/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp index d42fcd042..2a15e555c 100644 --- a/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp @@ -10,10 +10,6 @@ #include #include -// If defined, tests are run without rescaling-to-integer or robustness policy -// This multi_difference currently contains no tests for double which then fail -// #define BOOST_GEOMETRY_NO_ROBUSTNESS - //#define HAVE_TTMATH //#define BOOST_GEOMETRY_DEBUG_ASSEMBLE //#define BOOST_GEOMETRY_CHECK_WITH_SQLSERVER diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index f8e5fcc62..fab6d60b5 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -105,8 +105,8 @@ void difference_output(std::string const& caseid, G1 const& g1, G2 const& g2, Ou << string_from_type::name() << (ccw ? "_ccw" : "") << (open ? "_open" : "") -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - << "_no_rob" +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" #endif << ".svg"; diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index 850b40cc1..af3459494 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -179,7 +179,7 @@ void test_areal() { ut_settings settings(if_typed_tt(0.01, 0.1)); -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) settings.test_validity = false; #endif @@ -203,7 +203,7 @@ void test_areal() test_one("geos_2", geos_2[0], geos_2[1], 0, 0, 6.0e-5, ut_settings(-1.0)); // -1 denotes: compare with <= -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("geos_3", geos_3[0], geos_3[1], 0, 0, 0.0); @@ -233,14 +233,14 @@ void test_areal() test_one("ggl_list_20110307_javier", ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], 1, 4, - #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) + #if ! defined(BOOST_GEOMETRY_USE_RESCALING) 0.40 #else 0.397162651, ut_settings(0.01) #endif ); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ggl_list_20110627_phillip", ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], 1, if_typed_tt(6, 5), 11151.6618); @@ -263,7 +263,7 @@ void test_areal() ggl_list_20140321_7415963[0], ggl_list_20140321_7415963[1], 0, 0, 0, ut_settings(0.1)); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], 1, 4, 0.00029437899183903937, ut_settings(0.01)); @@ -293,7 +293,7 @@ void test_areal() ticket_10108_a[0], ticket_10108_a[1], 0, 0, 0.0); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) // msvc 5.6023011e-5 // mingw 5.6022954e-5 test_one("ticket_10108_b", diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index a14f46ced..8bd3b9a70 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -326,14 +326,14 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_82, 5, -1, 8.5); TEST_INTERSECTION(case_recursive_boxes_83, 5, -1, 10.25); TEST_INTERSECTION(case_recursive_boxes_84, 1, -1, 0.5); -#ifdef BOOST_GEOMETRY_NO_ROBUSTNESS +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) TEST_INTERSECTION(case_recursive_boxes_85, 1, -1, 0.25); #endif TEST_INTERSECTION(case_recursive_boxes_86, 0, -1, 0.0); TEST_INTERSECTION(case_recursive_boxes_87, 0, -1, 0.0); TEST_INTERSECTION(case_recursive_boxes_88, 4, -1, 3.5); -#ifndef BOOST_GEOMETRY_NO_ROBUSTNESS +#if defined(BOOST_GEOMETRY_USE_RESCALING) TEST_INTERSECTION(case_precision_m1, 1, -1, 14.0); TEST_INTERSECTION(case_precision_m2, 2, -1, 15.25); TEST_INTERSECTION_REV(case_precision_m1, 1, -1, 14.0); @@ -364,7 +364,7 @@ void test_areal() test_one("ticket_11018", ticket_11018[0], ticket_11018[1], 1, 4, -#ifdef BOOST_GEOMETRY_NO_ROBUSTNESS +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) 9.896437631745599e-09 #else 1.7791170511070893e-14, ut_settings(0.001) diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 9e06b72b7..8a261d855 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -115,7 +115,8 @@ check_result( } #if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) + // Without rescaling, point count might easily differ (which is no problem) if (expected_point_count > 0) { BOOST_CHECK_MESSAGE(bg::math::abs(n - expected_point_count) < 3, @@ -256,8 +257,8 @@ typename bg::default_area_result::type test_intersection(std::string const& << string_from_type::name() << (ccw ? "_ccw" : "") << (open ? "_open" : "") -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - << "_no_rob" +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" #endif << ".svg"; diff --git a/test/algorithms/set_operations/union/test_union.hpp b/test/algorithms/set_operations/union/test_union.hpp index 84540fc15..52dadb563 100644 --- a/test/algorithms/set_operations/union/test_union.hpp +++ b/test/algorithms/set_operations/union/test_union.hpp @@ -197,7 +197,8 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, << " type: " << (type_for_assert_message()) ); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) + // Without rescaling, point count might easily differ (which is no problem) BOOST_CHECK_MESSAGE(expected_point_count < 0 || std::abs(int(n) - expected_point_count) < 3, "union: " << caseid << " #points expected: " << expected_point_count @@ -223,8 +224,8 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, << string_from_type::name() << (ccw ? "_ccw" : "") << (open ? "_open" : "") -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - << "_no_rob" +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" #endif << ".svg"; diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index d2dee0662..97c372480 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -324,7 +324,7 @@ void test_areal() ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], 1, 1, 13, 20016.4); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ggl_list_20110627_phillip", ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], 1, 0, 8, 14729.07145); @@ -334,7 +334,7 @@ void test_areal() ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1], 1, 1, 15, 129904.197692871); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ggl_list_20110820_christophe", ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1], -1, // Either 1 or 2, depending if the intersection/turn point (eps.region) is missed @@ -346,7 +346,7 @@ void test_areal() { ut_settings settings; settings.percentage = 0.1; -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) settings.test_validity = false; #endif @@ -396,7 +396,7 @@ void test_areal() test_one("ticket_9756", ticket_9756[0], ticket_9756[1], 1, 0, 10, if_typed(1291.5469, 1289.08374)); -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ticket_10108_a", ticket_10108_a[0], ticket_10108_a[1], 1, 0, 8, 0.0435229); #else @@ -404,7 +404,7 @@ void test_areal() 2, 0, 8, 0.0435229); #endif -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("ticket_10108_b", ticket_10108_b[0], ticket_10108_b[1], 1, 0, 10, 2424.3449); #endif @@ -433,7 +433,7 @@ void test_areal() 1, 0, 265, 19.280667); // Robustness issues, followed out buffer-robustness-tests, test them also reverse -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], 1, 0, -1, 4.60853); test_one("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0], @@ -453,7 +453,7 @@ void test_areal() test_one("buffer_rt_j_rev", buffer_rt_j[1], buffer_rt_j[0], 1, 0, -1, 16.5711); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("buffer_rt_l", buffer_rt_l[0], buffer_rt_l[1], 1, 0, -1, 19.3995); test_one("buffer_rt_l_rev", buffer_rt_l[1], buffer_rt_l[0], @@ -470,7 +470,7 @@ void test_areal() test_one("buffer_rt_m2_rev", buffer_rt_m2[1], buffer_rt_m2[0], 1, 0, 15, 21.4853); -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_one("buffer_rt_q", buffer_rt_q[0], buffer_rt_q[1], 1, 0, -1, 18.5710); test_one("buffer_rt_q_rev", buffer_rt_q[1], buffer_rt_q[0], @@ -489,7 +489,7 @@ void test_areal() 1, 0, if_typed_tt(93, 91), 22.815); test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) 1, 0, 217, 36.752837); #else 1, 1, 217, 36.752837); @@ -580,7 +580,7 @@ int test_main(int, char* []) #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) -#if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) test_all >(); test_all >(); #endif diff --git a/test/algorithms/set_operations/union/union_multi.cpp b/test/algorithms/set_operations/union/union_multi.cpp index 5b547e7b4..6d57086c6 100644 --- a/test/algorithms/set_operations/union/union_multi.cpp +++ b/test/algorithms/set_operations/union/union_multi.cpp @@ -363,7 +363,7 @@ void test_areal() TEST_UNION(case_recursive_boxes_78, 2, 5, -1, 18.0); TEST_UNION(case_recursive_boxes_79, 1, 2, -1, 14.75); -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) // This is correct: no holes generated TEST_UNION(case_recursive_boxes_80, 2, 0, -1, 1.5); #else @@ -393,13 +393,13 @@ void test_areal() { ut_settings settings; -#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) +#if defined(BOOST_GEOMETRY_USE_RESCALING) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) settings.test_validity = false; #endif test_one("ticket_9081", ticket_9081[0], ticket_9081[1], -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) 3, #else 4, @@ -419,7 +419,7 @@ void test_areal() ticket_12118[0], ticket_12118[1], 1, 1, 27, 2221.38713); -#if defined(BOOST_GEOMETRY_ENABLE_FAILING_TESTS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_ENABLE_FAILING_TESTS) || ! defined(BOOST_GEOMETRY_USE_RESCALING) // No output if rescaling is done test_one("ticket_12125", ticket_12125[0], ticket_12125[1],