• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3 
4 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
7 
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10 
11 // Use, modification and distribution is subject to the Boost Software License,
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
14 
15 
16 #include "test_envelope.hpp"
17 
18 #include <boost/geometry/geometries/geometries.hpp>
19 #include <boost/geometry/geometries/point_xy.hpp>
20 #include <boost/geometry/geometries/adapted/c_array.hpp>
21 #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
22 #include <test_common/test_point.hpp>
23 
24 BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)25 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
26 
27 
28 template <typename P>
29 void test_2d()
30 {
31     /*test_envelope<bg::model::multi_point<P> >(
32             "MULTIPOINT((1 1),(1 0),(1 2))", 1, 1, 0, 2);
33     test_envelope<bg::model::multi_linestring<bg::model::linestring<P> > >(
34             "MULTILINESTRING((0 0,1 1),(1 1,2 2),(2 2,3 3))", 0, 3, 0, 3);
35 */
36     test_envelope<bg::model::multi_polygon<bg::model::polygon<P> > >(
37             "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 4,4 6,6 6,6 4,4 4)))", 1, 6, 1, 6);
38 }
39 
40 
41 template <typename P>
test_3d()42 void test_3d()
43 {
44     //typedef bg::model::multi_point<P> mp;
45 }
46 
47 
test_main(int,char * [])48 int test_main( int , char* [] )
49 {
50     test_2d<boost::tuple<float, float> >();
51     test_2d<bg::model::d2::point_xy<float> >();
52     test_2d<bg::model::d2::point_xy<double> >();
53 
54     test_3d<boost::tuple<float, float, float> >();
55     test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
56 
57 #ifdef HAVE_TTMATH
58     test_2d<bg::model::d2::point_xy<ttmath_big> >();
59     test_2d<bg::model::point<ttmath_big, 3, bg::cs::cartesian> >();
60 #endif
61 
62     return 0;
63 }
64