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

/Src/Dependencies/Boost/libs/geometry/test/multi/algorithms/overlay/multi_overlay_common.hpp

http://hadesmem.googlecode.com/
C++ Header | 40 lines | 19 code | 13 blank | 8 comment | 1 complexity | a8b90f3ec172e7e66fdebfd3f50fae5a MD5 | raw file
 1// Boost.Geometry (aka GGL, Generic Geometry Library) 
 2// Unit Test
 3
 4// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
 5// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
 6// Use, modification and distribution is subject to the Boost Software License,
 7// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 8// http://www.boost.org/LICENSE_1_0.txt)
 9
10
11#ifndef GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
12#define GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
13
14
15#include <boost/geometry/multi/geometries/multi_linestring.hpp>
16#include <boost/geometry/multi/geometries/multi_polygon.hpp>
17
18#include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp>
19//#include <boost/geometry/multi/io/svg/write_svg.hpp>
20
21
22
23template <typename P, typename Functor, typename T>
24void test_all(std::vector<T> const& expected, double precision = 0.01)
25{
26    typename boost::range_const_iterator<std::vector<T> >::type iterator
27        = boost::begin(expected);
28
29    typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
30    typedef bg::model::box<P> box;
31
32    BOOST_ASSERT(iterator != boost::end(expected));
33    test_overlay<mp, mp, Functor>("1", *iterator,
34            "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))",
35            "MULTIPOLYGON(((3 0,0 3,4 5,3 0)))", precision);
36    iterator++;
37}
38
39
40#endif // GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP