1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2011 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/type_traits/remove_const.hpp>
22 #include <boost/geometry/core/tag.hpp>
23 #include <boost/geometry/core/tags.hpp>
25 namespace boost { namespace geometry
32 \brief Traits class indicating interior container type of a polygon
33 \details defines inner container type, so the container containing
38 \par Specializations should provide:
39 - typedef X type ( e.g. std::vector<myring<P>> )
40 \tparam Geometry geometry
42 template <typename Geometry>
43 struct interior_const_type
47 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
52 template <typename Geometry>
53 struct interior_mutable_type
57 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
68 #ifndef DOXYGEN_NO_DISPATCH
69 namespace core_dispatch
73 template <typename GeometryTag, typename Geometry>
74 struct interior_return_type
78 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
84 template <typename Polygon>
85 struct interior_return_type<polygon_tag, Polygon>
87 typedef typename boost::remove_const<Polygon>::type nc_polygon_type;
89 typedef typename mpl::if_
91 boost::is_const<Polygon>,
92 typename traits::interior_const_type<nc_polygon_type>::type,
93 typename traits::interior_mutable_type<nc_polygon_type>::type
100 template <typename GeometryTag, typename Geometry>
105 false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
111 template <typename Polygon>
112 struct interior_type<polygon_tag, Polygon>
114 typedef typename boost::remove_reference
116 typename interior_return_type<polygon_tag, Polygon>::type
121 } // namespace core_dispatch
126 \brief \brief_meta{type, interior_type (container type
127 of inner rings), \meta_geometry_type}
128 \details Interior rings should be organized as a container
129 (std::vector, std::deque, boost::array) with
130 Boost.Range support. This metafunction defines the type
132 \tparam Geometry A type fullfilling the Polygon or MultiPolygon concept.
135 \qbk{[include reference/core/interior_type.qbk]}
137 template <typename Geometry>
140 typedef typename core_dispatch::interior_type
142 typename tag<Geometry>::type,
147 template <typename Geometry>
148 struct interior_return_type
150 typedef typename core_dispatch::interior_return_type
152 typename tag<Geometry>::type,
158 }} // namespace boost::geometry
161 #endif // BOOST_GEOMETRY_CORE_INTERIOR_TYPE_HPP