1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
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)
11 //`Shows how to use the ring_type metafunction, as well as interior_type
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/polygon.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
22 typedef boost::geometry::model::d2::point_xy<double> point;
23 typedef boost::geometry::model::polygon<point> polygon;
25 typedef boost::geometry::ring_type<polygon>::type ring_type;
26 typedef boost::geometry::interior_type<polygon>::type int_type;
28 std::cout << typeid(ring_type).name() << std::endl;
29 std::cout << typeid(int_type).name() << std::endl;
31 // So int_type defines a collection of rings,
32 // which is a Boost.Range compatible range
33 // The type of an element of the collection is the very same ring type again.
35 typedef boost::range_value<int_type>::type int_ring_type;
39 << boost::is_same<ring_type, int_ring_type>::value
51 N5boost8geometry5model4ringINS1_2d28point_xyIdNS0_2cs9cartesianEEELb1ELb1ESt6vectorSaEE
52 St6vectorIN5boost8geometry5model4ringINS2_2d28point_xyIdNS1_2cs9cartesianEEELb1ELb1ES_SaEESaIS9_EE