X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fgeometry%2Ftest%2Falgorithms%2Fenvelope_expand%2Fexpand_on_spheroid.cpp;h=1c535aa872b02fe2f627f03a193eb770c97af3de;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=40426469d4652e4aa8b75b078e6bc11c7e9df9d0;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp b/ceph/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp index 40426469d..1c535aa87 100644 --- a/ceph/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp +++ b/ceph/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp @@ -1,9 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2015, Oracle and/or its affiliates. +// Copyright (c) 2015-2017, 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 +// 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 @@ -624,7 +626,7 @@ BOOST_AUTO_TEST_CASE( expand_point_with_height ) } -BOOST_AUTO_TEST_CASE( expand_segment ) +BOOST_AUTO_TEST_CASE( expand_segment_sphere ) { typedef bg::cs::spherical_equatorial coordinate_system_type; typedef bg::model::point point_type; @@ -703,8 +705,106 @@ BOOST_AUTO_TEST_CASE( expand_segment ) 10, -90, 100, 45); } +BOOST_AUTO_TEST_CASE( expand_segment_spherical_polar ) +{ + typedef bg::cs::spherical coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; -BOOST_AUTO_TEST_CASE( expand_segment_with_height ) + tester::apply("s02", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 20)"), + 10, 10, 50, 50); + + // segment ending at the north pole + tester::apply("s04", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(40 45,80 0)"), + 5, 0, 50, 50); +} + +BOOST_AUTO_TEST_CASE( expand_segment_spheroid ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("s01", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 50, 50); + + tester::apply("s02", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 50, 50); + + tester::apply("s03", + from_wkt("BOX(5 5,50 10)"), + from_wkt("SEGMENT(40 10,10 10)"), + 5, 5, 50, 10.347587099602029, + 4.0 * std::numeric_limits::epsilon()); + + // segment ending at the north pole + tester::apply("s04", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 50, 90); + + // segment ending at the north pole + tester::apply("s04a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 40, 90); + + // segment starting at the north pole + tester::apply("s05", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 50, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 40, 90); + + // segment passing through the south pole + tester::apply("s06", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 30, 40); + + // segment degenerating to the north pole + tester::apply("s07", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 90,20 90)"), + 5, 15, 30, 90); + + // segment degenerating to the south pole + tester::apply("s08", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 -90,20 -90)"), + 5, -90, 30, 40); + + // box degenerating to the south pole + tester::apply("s09", + from_wkt("BOX(10 -90,30 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); + + // box degenerating to the south pole + tester::apply("s09a", + from_wkt("BOX(10 -90,130 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); +} + +BOOST_AUTO_TEST_CASE( expand_segment_sphere_with_height ) { typedef bg::cs::spherical_equatorial coordinate_system_type; typedef bg::model::point point_type; @@ -733,6 +833,35 @@ BOOST_AUTO_TEST_CASE( expand_segment_with_height ) 10, 10, 60, 50, 50, 1000); } +BOOST_AUTO_TEST_CASE( expand_segment_spheroid_with_height ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("sh01", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 500)"), + 10, 10, 100, 50, 50, 1000); + + tester::apply("sh02", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 1500)"), + 10, 10, 60, 50, 50, 1500); + + tester::apply("sh03", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 1500)"), + 10, 10, 100, 50, 50, 1500); + + tester::apply("sh04", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 800)"), + 10, 10, 60, 50, 50, 1000); +} + template void test_expand_box()