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_EXTERIOR_RING_HPP
0020 #define BOOST_GEOMETRY_CORE_EXTERIOR_RING_HPP
0021
0022
0023 #include <type_traits>
0024
0025 #include <boost/geometry/core/ring_type.hpp>
0026 #include <boost/geometry/core/static_assert.hpp>
0027 #include <boost/geometry/core/tag.hpp>
0028 #include <boost/geometry/core/tags.hpp>
0029
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 Polygon>
0050 struct exterior_ring
0051 {
0052 BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0053 "Not implemented for this Polygon type.",
0054 Polygon);
0055 };
0056
0057
0058 }
0059
0060
0061 #ifndef DOXYGEN_NO_DISPATCH
0062 namespace core_dispatch
0063 {
0064
0065
0066 template <typename Tag, typename Geometry>
0067 struct exterior_ring
0068 {
0069 BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0070 "Not implemented for this Geometry type.",
0071 Tag, Geometry);
0072 };
0073
0074
0075 template <typename Polygon>
0076 struct exterior_ring<polygon_tag, Polygon>
0077 {
0078 static geometry::ring_return_type_t<Polygon> apply(Polygon& polygon)
0079 {
0080 return traits::exterior_ring<std::remove_const_t<Polygon>>::get(polygon);
0081 }
0082 };
0083
0084
0085 }
0086 #endif
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 template <typename Polygon>
0098 inline ring_return_type_t<Polygon> exterior_ring(Polygon& polygon)
0099 {
0100 return core_dispatch::exterior_ring
0101 <
0102 tag_t<Polygon>,
0103 Polygon
0104 >::apply(polygon);
0105 }
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 template <typename Polygon>
0119 inline ring_return_type_t<Polygon const> exterior_ring(Polygon const& polygon)
0120 {
0121 return core_dispatch::exterior_ring
0122 <
0123 tag_t<Polygon>,
0124 Polygon const
0125 >::apply(polygon);
0126 }
0127
0128
0129 }}
0130
0131
0132 #endif