// Boost.Geometry (aka GGL, Generic Geometry Library) test file // // Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands // Copyright Bruno Lalande 2008, 2009 // 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 #include #include #include #include #include #include template void test_point_2d() { P p = bg::make

((T) 123, (T) 456); BOOST_CHECK_CLOSE(bg::get<0>(p), 123.0, 1.0e-6); BOOST_CHECK_CLOSE(bg::get<1>(p), 456.0, 1.0e-6); } template void test_point_3d() { P p = bg::make

((T) 123, (T) 456, (T) 789); BOOST_CHECK_CLOSE( bg::get<0>(p), 123.0, 1.0e-6); BOOST_CHECK_CLOSE( bg::get<1>(p), 456.0, 1.0e-6); BOOST_CHECK_CLOSE( bg::get<2>(p), 789.0, 1.0e-6); } template void test_box_2d() { typedef bg::model::box

B; B b = bg::make((T) 123, (T) 456, (T) 789, (T) 1011); BOOST_CHECK_CLOSE( (bg::get(b)), 123.0, 1.0e-6); BOOST_CHECK_CLOSE( (bg::get(b)), 456.0, 1.0e-6); BOOST_CHECK_CLOSE( (bg::get(b)), 789.0, 1.0e-6); BOOST_CHECK_CLOSE( (bg::get(b)), 1011.0, 1.0e-6); b = bg::make_inverse(); } template void test_linestring_2d() { typedef bg::model::linestring

L; T coors[][2] = {{1,2}, {3,4}}; L line = bg::make(coors); BOOST_CHECK_EQUAL(line.size(), 2u); } template void test_linestring_3d() { typedef bg::model::linestring

L; T coors[][3] = {{1,2,3}, {4,5,6}}; L line = bg::make(coors); BOOST_CHECK_EQUAL(line.size(), 2u); //std::cout << dsv(line) << std::endl; } template void test_2d_t() { test_point_2d(); test_box_2d(); test_linestring_2d(); } template void test_2d() { test_2d_t(); test_2d_t(); test_2d_t(); } template void test_3d_t() { test_linestring_3d(); // test_point_3d(); } template void test_3d() { test_3d_t(); test_3d_t(); test_3d_t(); } int test_main(int, char* []) { //test_2d(); //test_2d(); //test_2d(); test_2d >(); test_2d >(); test_2d >(); test_3d >(); #if defined(HAVE_TTMATH) test_2d >(); test_3d >(); #endif return 0; }