PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/geometry/test/multi/algorithms/multi_simplify.cpp

http://hadesmem.googlecode.com/
C++ | 58 lines | 38 code | 14 blank | 6 comment | 0 complexity | f65674d7866eea07f8c556a88b24748c MD5 | raw file
 1// Boost.Geometry (aka GGL, Generic Geometry Library)
 2//
 3// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
 4// Use, modification and distribution is subject to the Boost Software License,
 5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 6// http://www.boost.org/LICENSE_1_0.txt)
 7
 8#include <geometry_test_common.hpp>
 9
10#include <boost/geometry/multi/algorithms/simplify.hpp>
11
12#include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
13
14#include <boost/geometry/geometries/box.hpp>
15#include <boost/geometry/geometries/ring.hpp>
16#include <boost/geometry/geometries/linestring.hpp>
17#include <boost/geometry/geometries/point.hpp>
18#include <boost/geometry/geometries/polygon.hpp>
19
20#include <boost/geometry/geometries/point_xy.hpp>
21
22#include <boost/geometry/multi/geometries/multi_point.hpp>
23#include <boost/geometry/multi/geometries/multi_linestring.hpp>
24#include <boost/geometry/multi/geometries/multi_polygon.hpp>
25
26#include <algorithms/test_simplify.hpp>
27
28
29template <typename P>
30void test_all()
31{
32    test_geometry<bg::model::multi_point<P> >(
33        "MULTIPOINT((0 0),(1 1))",
34        "MULTIPOINT((0 0),(1 1))", 1.0);
35
36    test_geometry<bg::model::multi_linestring<bg::model::linestring<P> > >(
37        "MULTILINESTRING((0 0,5 5,10 10))",
38        "MULTILINESTRING((0 0,10 10))", 1.0);
39
40    typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
41    test_geometry<mp>(
42        "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))",
43        "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0)))", 1.0);
44    test_geometry<mp>(
45        "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3)))",
46        "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0),(7 3,7 6,1 6,1 3,7 3)))", 1.0);
47}
48
49int test_main( int , char* [] )
50{
51    test_all<bg::model::d2::point_xy<double> >();
52
53#ifdef HAVE_TTMATH
54    test_all<bg::model::d2::point_xy<ttmath_big> >();
55#endif
56
57    return 0;
58}