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

/Src/Dependencies/Boost/libs/geometry/test/algorithms/test_overlaps.hpp

http://hadesmem.googlecode.com/
C++ Header | 44 lines | 25 code | 13 blank | 6 comment | 1 complexity | 7e5fca7e3c686b6558ca88e109d56ef7 MD5 | raw file
 1// Generic Geometry2 Library 
 2// Unit Test
 3
 4// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
 5// Use, modification and distribution is subject to the Boost Software License,
 6// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 7// http://www.boost.org/LICENSE_1_0.txt)
 8
 9#ifndef BOOST_GEOMETRY_TEST_OVERLAPS_HPP
10#define BOOST_GEOMETRY_TEST_OVERLAPS_HPP
11
12
13#include <geometry_test_common.hpp>
14
15#include <boost/geometry/core/ring_type.hpp>
16#include <boost/geometry/algorithms/overlaps.hpp>
17#include <boost/geometry/strategies/strategies.hpp>
18#include <boost/geometry/geometries/ring.hpp>
19#include <boost/geometry/geometries/polygon.hpp>
20
21#include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>
22
23
24template <typename Geometry1, typename Geometry2>
25void test_geometry(std::string const& wkt1,
26        std::string const& wkt2, bool expected)
27{
28    Geometry1 geometry1;
29    Geometry2 geometry2;
30
31    bg::read_wkt(wkt1, geometry1);
32    bg::read_wkt(wkt2, geometry2);
33
34    bool detected = bg::overlaps(geometry1, geometry2);
35
36    BOOST_CHECK_MESSAGE(detected == expected,
37        "overlaps: " << wkt1
38        << " with " << wkt2
39        << " -> Expected: " << expected
40        << " detected: " << detected);
41}
42
43
44#endif