diff options
Diffstat (limited to 'libs/geometry/test/strategies/spherical_side.cpp')
-rw-r--r-- | libs/geometry/test/strategies/spherical_side.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/libs/geometry/test/strategies/spherical_side.cpp b/libs/geometry/test/strategies/spherical_side.cpp index a183a141b..6965692ea 100644 --- a/libs/geometry/test/strategies/spherical_side.cpp +++ b/libs/geometry/test/strategies/spherical_side.cpp @@ -3,6 +3,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, 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, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -19,6 +24,9 @@ #include <boost/geometry/strategies/spherical/ssf.hpp> #include <boost/geometry/strategies/cartesian/side_by_triangle.hpp> +#include <boost/geometry/strategies/agnostic/side_by_azimuth.hpp> +#include <boost/geometry/strategies/geographic/mapping_ssf.hpp> + #include <boost/geometry/core/cs.hpp> #include <boost/geometry/geometries/point.hpp> @@ -47,22 +55,37 @@ inline char side_char(int side) } template <typename Point> -void test_side1(std::string const& case_id, Point const& p1, Point const& p2, Point const& p3, +void test_side1(std::string const& /*case_id*/, Point const& p1, Point const& p2, Point const& p3, int expected, int expected_cartesian) { - // std::cout << case_id << ": "; - //int s = bg::strategy::side::side_via_plane<>::apply(p1, p2, p3); - int side_ssf = bg::strategy::side::spherical_side_formula<>::apply(p1, p2, p3); - //int side2 = bg::strategy::side::side_via_plane<>::apply(p1, p2, p3); - int side_ct = bg::strategy::side::side_by_cross_track<>::apply(p1, p2, p3); + namespace bgss = bg::strategy::side; + // std::cout << case_id << ": "; + //int s = bgss::side_via_plane<>::apply(p1, p2, p3); + int side_ssf = bgss::spherical_side_formula<>::apply(p1, p2, p3); + //int side2 = bgss::side_via_plane<>::apply(p1, p2, p3); + int side_ct = bgss::side_by_cross_track<>::apply(p1, p2, p3); + + // non-official + typedef bg::srs::spheroid<double> spheroid; + spheroid const sph(1.0, 1.0); + int side_azi = bgss::side_by_azimuth<spheroid>(sph).apply(p1, p2, p3); + int side_mssf1 = bgss::mapping_spherical_side_formula<spheroid>(sph).apply(p1, p2, p3); + int side_mssf2 = bgss::mapping_spherical_side_formula<spheroid, bgss::mapping_reduced>(sph).apply(p1, p2, p3); + int side_mssf3 = bgss::mapping_spherical_side_formula<spheroid, bgss::mapping_geocentric>(sph).apply(p1, p2, p3); + + // cartesian typedef bg::strategy::side::services::default_strategy<bg::cartesian_tag>::type cartesian_strategy; int side_cart = cartesian_strategy::apply(p1, p2, p3); - BOOST_CHECK_EQUAL(side_ssf, expected); BOOST_CHECK_EQUAL(side_ct, expected); + BOOST_CHECK_EQUAL(side_azi, expected); + BOOST_CHECK_EQUAL(side_mssf1, expected); + BOOST_CHECK_EQUAL(side_mssf2, expected); + BOOST_CHECK_EQUAL(side_mssf3, expected); BOOST_CHECK_EQUAL(side_cart, expected_cartesian); + /* std::cout << "exp: " << side_char(expected) |