1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
15 #ifndef BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
16 #define BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP
19 #include <boost/mpl/assert.hpp>
20 #include <boost/mpl/if.hpp>
21 #include <boost/type_traits/is_const.hpp>
22 #include <boost/type_traits/remove_const.hpp>
23 #include <boost/type_traits/remove_reference.hpp>
25 #include <boost/geometry/core/tag.hpp>
26 #include <boost/geometry/core/tags.hpp>
28 namespace boost { namespace geometry
35 \brief Traits class indicating interior container type of a polygon
36 \details defines inner container type, so the container containing
41 \par Specializations should provide:
42 - typedef X type ( e.g. std::vector<myring<P>> )
43 \tparam Geometry geometry
45 template <typename Geometry>
46 struct interior_const_type
50 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
55 template <typename Geometry>
56 struct interior_mutable_type
60 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
71 #ifndef DOXYGEN_NO_DISPATCH
72 namespace core_dispatch
76 template <typename GeometryTag, typename Geometry>
77 struct interior_return_type
81 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
87 template <typename Polygon>
88 struct interior_return_type<polygon_tag, Polygon>
90 typedef typename boost::remove_const<Polygon>::type nc_polygon_type;
92 typedef typename boost::mpl::if_
94 boost::is_const<Polygon>,
95 typename traits::interior_const_type<nc_polygon_type>::type,
96 typename traits::interior_mutable_type<nc_polygon_type>::type
103 template <typename GeometryTag, typename Geometry>
108 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
114 template <typename Polygon>
115 struct interior_type<polygon_tag, Polygon>
117 typedef typename boost::remove_reference
119 typename interior_return_type<polygon_tag, Polygon>::type
124 } // namespace core_dispatch
129 \brief \brief_meta{type, interior_type (container type
130 of inner rings), \meta_geometry_type}
131 \details Interior rings should be organized as a container
132 (std::vector, std::deque, boost::array) with
133 Boost.Range support. This metafunction defines the type
135 \tparam Geometry A type fullfilling the Polygon or MultiPolygon concept.
138 \qbk{[include reference/core/interior_type.qbk]}
140 template <typename Geometry>
143 typedef typename core_dispatch::interior_type
145 typename tag<Geometry>::type,
150 template <typename Geometry>
151 struct interior_return_type
153 typedef typename core_dispatch::interior_return_type
155 typename tag<Geometry>::type,
161 }} // namespace boost::geometry
164 #endif // BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP