Merge branch 'develop' into fix/read_wkt

This commit is contained in:
Adam Wulkiewicz
2014-10-16 16:44:53 +02:00
5 changed files with 66 additions and 2 deletions

View File

@@ -4,6 +4,11 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -186,7 +191,7 @@ struct closure
static const closure_selector value = core_dispatch::closure
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
typename util::bare_type<Geometry>::type
>::value;
};

View File

@@ -4,6 +4,11 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -173,7 +178,7 @@ struct point_order
static const order_selector value = core_dispatch::point_order
<
typename tag<Geometry>::type,
typename boost::remove_const<Geometry>::type
typename util::bare_type<Geometry>::type
>::value;
};

View File

@@ -3,6 +3,11 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -10,6 +15,7 @@
#include <geometry_test_common.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/tag.hpp>
@@ -38,6 +44,9 @@ void test_geometry()
{
BOOST_CHECK_EQUAL(typeid(typename bg::point_type<G>::type).name(),
typeid(Expected).name());
static const bool is_same = boost::is_same<typename bg::point_type<G>::type, Expected>::value;
BOOST_CHECK(is_same);
}
template <typename P>
@@ -45,7 +54,12 @@ void test_all()
{
test_geometry<P, P>();
test_geometry<P const, P>();
test_geometry<P*, P>();
test_geometry<P&, P>();
test_geometry<P*&, P>();
test_geometry<const P *, P>();
test_geometry<bg::model::linestring<P> , P>();
test_geometry<bg::model::linestring<P> *&, P>();
test_geometry<bg::model::ring<P> , P>();
test_geometry<bg::model::polygon<P> , P>();
test_geometry<bg::model::box<P> , P>();

View File

@@ -5,6 +5,11 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -30,6 +35,15 @@
#include <boost/geometry/io/wkt/read.hpp>
template <typename Poly>
void test_order_closure(bg::order_selector expected_order, bg::closure_selector exptected_closure)
{
bg::order_selector order = bg::point_order<Poly>::value;
bg::closure_selector closure = bg::closure<Poly>::value;
BOOST_CHECK_EQUAL(order, expected_order);
BOOST_CHECK_EQUAL(closure, exptected_closure);
}
template <typename P>
@@ -64,6 +78,17 @@ void test_all()
test_ring<P>("POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))", 5, 1, 5);
test_ring<P>("POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,2 2,2 1,1 1),(1 1,1 2,2 2,1 1))", 5, 2, 4);
test_ring<P>("POLYGON((0 0,0 3,3 3,3 0,0 0))", 5, 0, 0);
test_order_closure< bg::model::polygon<P, true, true> >(bg::clockwise, bg::closed);
test_order_closure< bg::model::polygon<P, true, false> >(bg::clockwise, bg::open);
test_order_closure< bg::model::polygon<P, false, true> >(bg::counterclockwise, bg::closed);
test_order_closure< bg::model::polygon<P, false, false> >(bg::counterclockwise, bg::open);
test_order_closure< bg::model::polygon<P> *>(bg::clockwise, bg::closed);
test_order_closure< bg::model::polygon<P> &>(bg::clockwise, bg::closed);
test_order_closure< bg::model::polygon<P> const>(bg::clockwise, bg::closed);
test_order_closure< bg::model::polygon<P> *&>(bg::clockwise, bg::closed);
test_order_closure< const bg::model::polygon<P> *>(bg::clockwise, bg::closed);
}

View File

@@ -3,6 +3,11 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014.
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -10,6 +15,8 @@
#include <geometry_test_common.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/geometries/geometries.hpp>
@@ -34,6 +41,9 @@ void test_geometry()
{
BOOST_CHECK_EQUAL(typeid(typename bg::tag<G>::type).name(),
typeid(Expected).name());
static const bool is_same = boost::is_same<typename bg::tag<G>::type, Expected>::value;
BOOST_CHECK(is_same);
}
template <typename P, size_t D>
@@ -41,7 +51,12 @@ void test_all()
{
test_geometry<P, bg::point_tag>();
test_geometry<P const, bg::point_tag>();
test_geometry<P*, bg::point_tag>();
test_geometry<P&, bg::point_tag>();
test_geometry<P*&, bg::point_tag>();
test_geometry<const P *, bg::point_tag>();
test_geometry<bg::model::linestring<P> , bg::linestring_tag>();
test_geometry<bg::model::linestring<P> *&, bg::linestring_tag>();
test_geometry<bg::model::ring<P> , bg::ring_tag>();
test_geometry<bg::model::polygon<P> , bg::polygon_tag>();
test_geometry<bg::model::box<P> , bg::box_tag>();