PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://hadesmem.googlecode.com/
C++ Header | 45 lines | 25 code | 12 blank | 8 comment | 1 complexity | 0a9b7a52f2c9d282f58236946cf2447b 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// 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_EQUALS_HPP
10#define BOOST_GEOMETRY_TEST_EQUALS_HPP
11
12
13#include <geometry_test_common.hpp>
14
15#include <boost/geometry/core/ring_type.hpp>
16#include <boost/geometry/algorithms/equals.hpp>
17#include <boost/geometry/strategies/strategies.hpp>
18
19#include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>
20
21
22template <typename Geometry1, typename Geometry2>
23void test_geometry(std::string const& caseid,
24            std::string const& wkt1,
25            std::string const& wkt2, bool expected)
26{
27    //std::cout << caseid << " expected: " << int(expected) << std::endl;
28    //std::cout << wkt1 << std::endl;
29    Geometry1 geometry1;
30    Geometry2 geometry2;
31
32    bg::read_wkt(wkt1, geometry1);
33    bg::read_wkt(wkt2, geometry2);
34
35    bool detected = bg::equals(geometry1, geometry2);
36
37    BOOST_CHECK_MESSAGE(detected == expected,
38        "case: " << caseid
39        << " equals: " << wkt1
40        << " to " << wkt2
41        << " -> Expected: " << expected
42        << " detected: " << detected);
43}
44
45#endif