From f704579ed021e46ea3d2872c0885d4a327bd6fac Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 29 Dec 2017 13:17:42 +0100 Subject: [PATCH] [overlay] by default use self-turns. This reverses definition of define SELF to NO_SELF. Including all unit tests. --- .../algorithms/detail/overlay/overlay.hpp | 2 +- test/algorithms/overlay/overlay.cpp | 4 +- .../set_operations/difference/difference.cpp | 11 ++-- .../difference/difference_multi.cpp | 53 +++++++++---------- .../difference/test_difference.hpp | 4 +- .../intersection/intersection.cpp | 6 +-- .../intersection/intersection_multi.cpp | 18 +++---- .../intersection/test_intersection.hpp | 4 +- .../set_operations/union/test_union.hpp | 4 +- .../set_operations/union/union_multi.cpp | 29 +++++----- .../areal_areal/recursive_polygons.cpp | 2 - 11 files changed, 64 insertions(+), 73 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index c6ea4f13d..f32ff4720 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -306,7 +306,7 @@ std::cout << "get turns" << std::endl; visitor.visit_turns(1, turns); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#if ! defined(BOOST_GEOMETRY_NO_SELF_TURNS) if (needs_self_turns::apply(geometry1)) { self_get_turn_points::self_turns(geometry1, diff --git a/test/algorithms/overlay/overlay.cpp b/test/algorithms/overlay/overlay.cpp index aebfa45f8..2f64d4d7d 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" : "") -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS - << "_self" +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) + << "_no_self" #endif #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) << "_no_rob" diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index e1a811676..e29392f4e 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -41,7 +41,7 @@ ( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \ clips3, -1, area1 + area2) -#if !defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS) +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) #define TEST_DIFFERENCE_IGNORE(caseid, clips1, area1, clips2, area2, clips3) \ { ut_settings ignore_validity; ignore_validity.test_validity = false; \ (test_one) \ @@ -536,8 +536,7 @@ void test_all() 5, 27, 1.6701714); ***/ - // Should have 2 outputs -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(mysql_21977775, 2, 160.856568913, 2, 92.3565689126, 4); #else @@ -550,7 +549,7 @@ void test_all() TEST_DIFFERENCE(mysql_23023665_1, 1, 92.0, 1, 142.5, 2); TEST_DIFFERENCE(mysql_23023665_2, 1, 96.0, 1, 16.0, 2); TEST_DIFFERENCE(mysql_23023665_3, 1, 225.0, 1, 66.0, 2); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(mysql_23023665_5, 2, 165.23735, 2, 105.73735, 4); #else TEST_DIFFERENCE_IGNORE(mysql_23023665_5, 1, 165.23735, 2, 105.73735, 3); @@ -558,7 +557,7 @@ void test_all() TEST_DIFFERENCE(mysql_23023665_6, 2, 105.68756, 3, 10.18756, 5); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(mysql_23023665_13, 3, 99.74526, 3, 37.74526, 6); #else TEST_DIFFERENCE_IGNORE(mysql_23023665_13, 2, 99.74526, 3, 37.74526, 5); @@ -589,7 +588,7 @@ void test_specific() 1, 4, 6731652.0); // Generates spikes, both a-b and b-a -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(ticket_11676, 2, 2537992.5, 2, 294963.5, 3); #else TEST_DIFFERENCE_IGNORE(ticket_11676, 1, 2537992.5, 2, 294963.5, 2); diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index c56448073..65a677659 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -104,7 +104,7 @@ void test_areal() TEST_DIFFERENCE(case_125_multi, 1, 0.25, 2, 0.400, 3); // A should have 3 clips, B should have 5 clips -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_126_multi, 4, 16.0, 5, 27.0, 9); #else TEST_DIFFERENCE_IGNORE(case_126_multi, 3, 16.0, 4, 27.0, 7); @@ -156,11 +156,11 @@ void test_areal() settings.percentage = 0.001; // This testcase is actually different for all combinations -#if (!defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS)) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS) settings.test_validity = false; #endif -#if defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS) +#if ! defined(BOOST_GEOMETRY_NO_SELF_TURNS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS) TEST_DIFFERENCE_WITH(0, 1, ggl_list_20120221_volker, 2, 7962.66, 2, 2775258.93, 4); #else TEST_DIFFERENCE_WITH(0, 1, ggl_list_20120221_volker, 2, 7962.66, 1, 2775258.93, 3); @@ -178,7 +178,7 @@ void test_areal() TEST_DIFFERENCE_IGNORE(bug_21155501, 1, 3.758937, 0, 0.0, 1); #endif -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS // The result is valid but wrong, version b includes nearly all area // which was original between all the self-touching polygons // TEST_DIFFERENCE(ticket_12503, 46, 920.625, 41, 497.125, 10); @@ -219,7 +219,7 @@ void test_areal() // Areas correspond with POSTGIS, // #clips in PostGIS is 11,11,5 but should most probably be be 12,12,6 -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_1, 12, 26.0, 12, 24.0, 6); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_1, 11, 26.0, 12, 24.0, 5); @@ -241,14 +241,13 @@ void test_areal() // 4, input is not valid - // Should have 16,12 clips in a,b -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_5, 16, 22.0, 12, 27.0, 10); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_5, 15, 22.0, 11, 27.0, 8); #endif -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_6, 7, 3.5, 3, 1.5, 9); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_6, 6, 3.5, 3, 1.5, 8); @@ -288,7 +287,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_13, 4, 4.75, 3, 5.5, 3); TEST_DIFFERENCE(case_recursive_boxes_14, 3, 2.0, 4, 2.5, 5); TEST_DIFFERENCE(case_recursive_boxes_15, 3, 3.0, 2, 2.5, 3); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_16, 8, 6.5, 3, 5.5, 9); TEST_DIFFERENCE(case_recursive_boxes_17, 10, 7.75, 7, 5.5, 13); #else @@ -313,7 +312,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_31, 2, 2.0, 1, 0.5, 2); TEST_DIFFERENCE(case_recursive_boxes_32, 2, 2.75, 2, 1.25, 2); TEST_DIFFERENCE(case_recursive_boxes_33, 4, 3.0, 3, 6.0, 4); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_34, 7, 7.25, 1, 0.5, 8); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_34, 5, 7.25, 1, 0.5, 6); @@ -326,7 +325,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_40, 11, 14.0, 9, 13.0, 11); TEST_DIFFERENCE(case_recursive_boxes_41, 1, 0.5, 1, 0.5, 2); -#ifndef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifdef BOOST_GEOMETRY_NO_SELF_TURNS // 42.a Fails with self-turns TEST_DIFFERENCE(case_recursive_boxes_42, 1, 1.0, 4, 4.0, 5); #endif @@ -336,7 +335,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_46, 4, 14.0, 5, 12.0, 5); TEST_DIFFERENCE(case_recursive_boxes_47, 4, 10.0, 7, 11.0, 1); TEST_DIFFERENCE(case_recursive_boxes_48, 0, 0.0, 1, 9.0, 1); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_49, 10, 22.0, 10, 17.0, 11); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_49, 9, 22.0, 10, 17.0, 10); @@ -344,7 +343,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_50, 14, 21.0, 16, 21.0, 14); TEST_DIFFERENCE(case_recursive_boxes_51, 14, 25.0, 12, 31.0, 7); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_52, 13, 30.0, 15, 25.0, 8); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_52, 13, 30.0, 15, 25.0, 8); @@ -352,20 +351,20 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_53, 6, 3.5, 4, 1.5, 9); TEST_DIFFERENCE(case_recursive_boxes_54, 6, 6.5, 8, 6.0, 7); TEST_DIFFERENCE(case_recursive_boxes_55, 4, 5.5, 6, 7.75, 4); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_56, 4, 4.5, 5, 2.75, 6); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_56, 4, 4.5, 5, 2.75, 6); #endif TEST_DIFFERENCE(case_recursive_boxes_57, 5, 3.75, 9, 6.5, 10); TEST_DIFFERENCE(case_recursive_boxes_58, 4, 2.25, 6, 3.75, 7); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_59, 8, 6.5, 7, 7.0, 12); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_59, 8, 6.5, 6, 7.0, 11); #endif -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_60, 6, 5.25, 7, 5.25, 11); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_60, 5, 5.25, 5, 5.25, 8); @@ -376,7 +375,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_62, 5, 5.0, 11, 5.75, 12); #endif -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_63, 9, 10.5, 5, 27.75, 4); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_63, 6, 10.5, 5, 27.75, 2); @@ -384,7 +383,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_64, 6, 2.75, 7, 4.5, 11); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_65, 6, 4.25, 7, 3.0, 13); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_65, 4, 4.25, 7, 3.0, 11); @@ -394,13 +393,13 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_67, 7, 6.25, 9, 6.0, 10); TEST_DIFFERENCE(case_recursive_boxes_68, 10, 6.5, 9, 6.5, 7); TEST_DIFFERENCE(case_recursive_boxes_69, 5, 6.25, 5, 6.75, 8); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_70, 5, 2.0, 8, 4.5, 11); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_70, 5, 2.0, 6, 4.5, 9); #endif -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_71, 7, 8.25, 7, 5.75, 8); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_71, 6, 8.25, 7, 5.75, 7); @@ -410,7 +409,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_73, 4, 1.75, 5, 4.0, 8); TEST_DIFFERENCE(case_recursive_boxes_74, 3, 3.00, 3, 1.5, 5); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_75, 7, 4.5, 4, 2.0, 11); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_75, 5, 4.5, 4, 2.0, 9); @@ -419,7 +418,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_76, 7, 3.75, 4, 2.5, 9); TEST_DIFFERENCE(case_recursive_boxes_77, 4, 3.75, 7, 6.25, 8); TEST_DIFFERENCE(case_recursive_boxes_78, 11, 5.5, 8, 4.5, 14); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_79, 2, 1.25, 6, 4.5, 8); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_79, 2, 1.25, 5, 4.5, 7); @@ -435,7 +434,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_81, 3, 5.0, 6, 6.75, 6); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE(case_recursive_boxes_82, 5, 7.25, 7, 4.5, 8); #else TEST_DIFFERENCE_IGNORE(case_recursive_boxes_82, 5, 7.25, 6, 4.5, 7); @@ -498,7 +497,7 @@ void test_specific_areal() ut_settings settings; settings.remove_spikes = true; -#if ! defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS) +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) settings.sym_difference = false; settings.test_validity = false; #endif @@ -506,7 +505,7 @@ void test_specific_areal() std::string a_min_b = TEST_DIFFERENCE_WITH(0, 1, ticket_12751, 1, 2781965.0, 1, 597.0, 2); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE_WITH(2, 3, ticket_12751, 2, 2537992.5, 2, 294963.5, 3); #else @@ -525,7 +524,7 @@ void test_specific_areal() ut_settings settings; settings.remove_spikes = true; settings.sym_difference = false; -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_DIFFERENCE_WITH(0, 1, ticket_12752, 3, 2776692.0, 3, 7893.0, 2); #else // If self-intersections are not tested, result is not valid @@ -548,7 +547,7 @@ void test_specific_areal() { ut_settings settings; settings.sym_difference = false; -#ifndef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifdef BOOST_GEOMETRY_NO_SELF_TURNS settings.test_validity = false; TEST_DIFFERENCE_WITH(0, 1, ticket_9942, 3, 7427491.5, 4, 131506, 4); #else diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index cc7179db1..7bb2706e2 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -104,8 +104,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_INCLUDE_SELF_TURNS) - << "_self" +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) + << "_no_self" #endif #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) << "_no_rob" diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index b9c55de93..f0934cb98 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -46,7 +46,7 @@ BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) (test_one) \ ( #caseid, caseid[0], caseid[1], clips, points, area) -#if ! defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS) +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) #define TEST_INTERSECTION_IGNORE(caseid, clips, points, area) \ { ut_settings ignore_validity; ignore_validity.test_validity = false; \ (test_one) \ @@ -355,7 +355,7 @@ void test_areal() TEST_INTERSECTION(case_105, 1, 34, 76.0); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_106, 2, -1, 3.5); TEST_INTERSECTION(case_107, 3, -1, 3.0); #else @@ -378,7 +378,7 @@ void test_areal() 2, -1, 183.71376870369406); // Needs self-intersections to solve validity -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(mysql_23023665_6, 2, 0, 11.812440191387557); #else TEST_INTERSECTION_IGNORE(mysql_23023665_6, 1, -1, 11.812440191387557); diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index 407de47f9..2c706ccc0 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -146,7 +146,7 @@ void test_areal() TEST_INTERSECTION(case_123_multi, 3, 13, 1.875); TEST_INTERSECTION(case_124_multi, 2, 13, 2.0625); TEST_INTERSECTION(case_125_multi, 3, 17, 2.1); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_126_multi, 5, 27, 9.0); #else TEST_INTERSECTION_IGNORE(case_126_multi, 3, 23, 9.0); @@ -170,7 +170,7 @@ void test_areal() // differently TEST_INTERSECTION_IGNORE(case_141_multi, 3, -1, 74.5); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_1, 10, 97, 47.0); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_1, 8, 97, 47.0); @@ -183,7 +183,7 @@ void test_areal() case_recursive_boxes_3[0], case_recursive_boxes_3[1], 19, 87, 12.5); // Area from SQL Server -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION_IGNORE(case_recursive_boxes_4, 13, 169, 67.0); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_4, 8, 178, 67.0); @@ -317,14 +317,14 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_62, 9, -1, 10.5); TEST_INTERSECTION(case_recursive_boxes_63, 11, -1, 5.75); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_64, 5, -1, 17.25); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_64, 4, -1, 17.25); #endif TEST_INTERSECTION(case_recursive_boxes_65, 3, -1, 17.25); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_66, 4, -1, 16.0); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_66, 2, -1, 16.0); @@ -333,7 +333,7 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_67, 5, -1, 2.5); TEST_INTERSECTION(case_recursive_boxes_68, 8, -1, 9.5); TEST_INTERSECTION(case_recursive_boxes_69, 6, -1, 3.25); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_70, 6, -1, 18.5); #else // Misses a necessary self-turn and therefore a ring @@ -343,7 +343,7 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_71, 3, -1, 1.75); TEST_INTERSECTION(case_recursive_boxes_72, 8, -1, 4.5); TEST_INTERSECTION(case_recursive_boxes_73, 3, -1, 18.5); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_74, 3, -1, 20.25); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_74, 2, -1, 20.25); @@ -356,7 +356,7 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_79, 5, -1, 9.0); TEST_INTERSECTION(case_recursive_boxes_80, 1, -1, 0.25); TEST_INTERSECTION(case_recursive_boxes_81, 5, -1, 3.75); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_recursive_boxes_82, 5, -1, 8.5); #else TEST_INTERSECTION_IGNORE(case_recursive_boxes_82, 3, -1, 8.5); @@ -399,7 +399,7 @@ void test_areal() mysql_23023665_7[0], mysql_23023665_7[1], 2, 11, 9.80505786783); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(mysql_23023665_12, 2, 0, 11.812440191387557); #else TEST_INTERSECTION_IGNORE(mysql_23023665_12, 1, -1, 11.812440191387557); diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 4afe42f5b..8a9d6ac88 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -248,8 +248,8 @@ typename bg::default_area_result::type test_intersection(std::string const& << string_from_type::name() << (ccw ? "_ccw" : "") << (open ? "_open" : "") -#if defined(BOOST_GEOMETRY_INCLUDE_SELF_TURNS) - << "_self" +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) + << "_no_self" #endif #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) << "_no_rob" diff --git a/test/algorithms/set_operations/union/test_union.hpp b/test/algorithms/set_operations/union/test_union.hpp index 352521eb2..6fea30496 100644 --- a/test/algorithms/set_operations/union/test_union.hpp +++ b/test/algorithms/set_operations/union/test_union.hpp @@ -223,8 +223,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_INCLUDE_SELF_TURNS) - << "_self" +#if defined(BOOST_GEOMETRY_NO_SELF_TURNS) + << "_no_self" #endif #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) << "_no_rob" diff --git a/test/algorithms/set_operations/union/union_multi.cpp b/test/algorithms/set_operations/union/union_multi.cpp index 07e5560f6..286fdb26a 100644 --- a/test/algorithms/set_operations/union/union_multi.cpp +++ b/test/algorithms/set_operations/union/union_multi.cpp @@ -130,8 +130,7 @@ void test_areal() case_108_multi[0], case_108_multi[1], 1, 1, 20, 22.75); - // Should have 2 holes. Needs self turns -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_109_multi, 1, 2, 14, 1400); #else TEST_UNION_IGNORE(case_109_multi, 1, 1, 14, 1400); @@ -184,8 +183,7 @@ void test_areal() TEST_UNION(case_125_multi, 1, 0, 9, 2.75); TEST_UNION(case_126_multi, 1, 2, 27, 52.0); - // Should have 2 holes. Needs self turns -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_131_multi, 1, 2, 15, 14.0); #else TEST_UNION_IGNORE(case_131_multi, 1, 1, 15, 14.0); @@ -223,8 +221,7 @@ void test_areal() case_recursive_boxes_4[0], case_recursive_boxes_4[1], 1, 2, 42, 96.75); - // Should have 10 holes. Needs self turns -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_recursive_boxes_5, 3, 10, 118, 70.0); #else TEST_UNION_IGNORE(case_recursive_boxes_5, 3, 9, 115, 70.0); @@ -267,8 +264,8 @@ void test_areal() // to break regions at self-intersection points (postponed) TEST_UNION_IGNORE(case_recursive_boxes_12_invalid, 5, 0, -1, 6.0); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS - // Without self-turns, a whole part is missed +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS + // Only apply it with self-turns. Without them a whole part is missed TEST_UNION_IGNORE(case_recursive_boxes_13_invalid, 2, 0, -1, 10.25); #endif TEST_UNION_IGNORE(case_recursive_boxes_14_invalid, 4, 0, -1, 4.5); @@ -349,7 +346,7 @@ void test_areal() TEST_UNION(case_recursive_boxes_46, 1, 4, 51, 33.0); TEST_UNION(case_recursive_boxes_47, 1, 0, -1, 22.0); TEST_UNION(case_recursive_boxes_48, 1, 1, -1, 10.0); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_recursive_boxes_49, 1, 3, -1, 59.0); #else TEST_UNION_IGNORE(case_recursive_boxes_49, 1, 2, -1, 59.0); @@ -357,7 +354,7 @@ void test_areal() TEST_UNION(case_recursive_boxes_50, 7, 4, -1, 68.0); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_recursive_boxes_51, 2, 6, -1, 75.0); #else TEST_UNION_IGNORE(case_recursive_boxes_51, 2, 5, -1, 75.0); @@ -365,14 +362,14 @@ void test_areal() TEST_UNION(case_recursive_boxes_52, 2, 6, -1, 77.0); TEST_UNION(case_recursive_boxes_53, 1, 1, -1, 24.75); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_recursive_boxes_54, 1, 2, -1, 22.5); #else TEST_UNION_IGNORE(case_recursive_boxes_54, 1, 1, -1, 22.5); #endif TEST_UNION(case_recursive_boxes_55, 3, 1, -1, 15.5); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(case_recursive_boxes_56, 5, 1, -1, 7.75); #else TEST_UNION_IGNORE(case_recursive_boxes_56, 5, 0, -1, 7.75); @@ -380,7 +377,7 @@ void test_areal() TEST_UNION(case_recursive_boxes_57, 3, 4, -1, 19.75); TEST_UNION(case_recursive_boxes_58, 6, 1, -1, 6.25); -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS // If there are no self-turns, an interior ring is missed TEST_UNION(case_recursive_boxes_59, 1, 3, -1, 21.75); #endif @@ -462,15 +459,13 @@ void test_areal() TEST_UNION(ticket_12503, 42, 1, -1, 945.625); - // Should have 1 hole. Needs self turns. -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(mysql_23023665_7, 1, 1, -1, 99.19494); #else TEST_UNION_IGNORE(mysql_23023665_7, 1, 0, -1, 99.19494); #endif - // Should have 2 holes. Needs self turns. -#ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS +#ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(mysql_23023665_8, 1, 2, -1, 1400.0); #else TEST_UNION_IGNORE(mysql_23023665_8, 1, 1, -1, 1400.0); diff --git a/test/robustness/overlay/areal_areal/recursive_polygons.cpp b/test/robustness/overlay/areal_areal/recursive_polygons.cpp index 7ed18923d..9baf4248b 100644 --- a/test/robustness/overlay/areal_areal/recursive_polygons.cpp +++ b/test/robustness/overlay/areal_areal/recursive_polygons.cpp @@ -7,8 +7,6 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_GEOMETRY_INCLUDE_SELF_TURNS - #define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR #define BOOST_GEOMETRY_NO_BOOST_TEST