File indexing completed on 2025-12-16 09:50:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP
0020 #define BOOST_GEOMETRY_CORE_INTERIOR_RINGS_HPP
0021
0022 #include <type_traits>
0023
0024 #include <boost/range/value_type.hpp>
0025
0026 #include <boost/geometry/core/interior_type.hpp>
0027 #include <boost/geometry/core/static_assert.hpp>
0028 #include <boost/geometry/core/tag.hpp>
0029 #include <boost/geometry/core/tags.hpp>
0030
0031 namespace boost { namespace geometry
0032 {
0033
0034 namespace traits
0035 {
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 template <typename Geometry>
0050 struct interior_rings
0051 {
0052 BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0053 "Not implemented for this Geometry type.",
0054 Geometry);
0055 };
0056
0057
0058 }
0059
0060
0061
0062
0063 #ifndef DOXYGEN_NO_DISPATCH
0064 namespace core_dispatch
0065 {
0066
0067 template
0068 <
0069 typename GeometryTag,
0070 typename Geometry
0071 >
0072 struct interior_rings {};
0073
0074
0075 template <typename Polygon>
0076 struct interior_rings<polygon_tag, Polygon>
0077 {
0078 static inline
0079 typename geometry::interior_return_type<Polygon>::type
0080 apply(Polygon& polygon)
0081 {
0082 return traits::interior_rings
0083 <
0084 typename std::remove_const<Polygon>::type
0085 >::get(polygon);
0086 }
0087 };
0088
0089
0090 template <typename MultiPolygon>
0091 struct interior_type<multi_polygon_tag, MultiPolygon>
0092 {
0093 using type = typename core_dispatch::interior_type
0094 <
0095 polygon_tag,
0096 typename boost::range_value<MultiPolygon>::type
0097 >::type;
0098 };
0099
0100
0101 }
0102 #endif
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115 template <typename Polygon>
0116 inline interior_return_type_t<Polygon> interior_rings(Polygon& polygon)
0117 {
0118 return core_dispatch::interior_rings
0119 <
0120 tag_t<Polygon>,
0121 Polygon
0122 >::apply(polygon);
0123 }
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136 template <typename Polygon>
0137 inline interior_return_type_t<Polygon const> interior_rings(Polygon const& polygon)
0138 {
0139 return core_dispatch::interior_rings
0140 <
0141 tag_t<Polygon>,
0142 Polygon const
0143 >::apply(polygon);
0144 }
0145
0146
0147
0148 }}
0149
0150
0151 #endif