// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. // 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 #include #include #include #include BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template void test_all() { typedef bg::model::referring_segment

S; P p1; P p2; S s(p1, p2); BOOST_CHECK_EQUAL(&s.first, &p1); BOOST_CHECK_EQUAL(&s.second, &p2); // Compilation tests, all things should compile. BOOST_CONCEPT_ASSERT( (bg::concepts::ConstSegment) ); BOOST_CONCEPT_ASSERT( (bg::concepts::Segment) ); typedef typename bg::coordinate_type::type T; typedef typename bg::point_type::type SP; boost::ignore_unused(); //std::cout << sizeof(typename coordinate_type::type) << std::endl; typedef bg::model::referring_segment

refseg_t; //BOOST_CONCEPT_ASSERT( (concepts::ConstSegment) ); refseg_t seg(p1, p2); typedef typename bg::coordinate_type::type CT; typedef typename bg::point_type::type CSP; boost::ignore_unused(); } template void test_custom() { S seg; bg::set<0,0>(seg, 1); bg::set<0,1>(seg, 2); bg::set<1,0>(seg, 3); bg::set<1,1>(seg, 4); std::ostringstream out; out << bg::dsv(seg); BOOST_CHECK_EQUAL(out.str(), "((1, 2), (3, 4))"); } int test_main(int, char* []) { test_all(); test_all(); test_all(); //test_all(); test_all >(); test_all >(); test_all >(); test_custom(); test_custom > >(); test_custom >(); test_custom(); return 0; }