File indexing completed on 2025-09-18 08:43:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef BOOST_GEOMETRY_CORE_TOPOLOGICAL_DIMENSION_HPP
0021 #define BOOST_GEOMETRY_CORE_TOPOLOGICAL_DIMENSION_HPP
0022
0023
0024 #include <type_traits>
0025
0026 #include <boost/geometry/core/tag.hpp>
0027 #include <boost/geometry/core/tags.hpp>
0028
0029
0030 namespace boost { namespace geometry
0031 {
0032
0033
0034 #ifndef DOXYGEN_NO_DISPATCH
0035 namespace core_dispatch
0036 {
0037
0038
0039 template <typename GeometryTag>
0040 struct top_dim {};
0041
0042
0043 template <>
0044 struct top_dim<point_tag> : std::integral_constant<int, 0> {};
0045
0046
0047 template <>
0048 struct top_dim<linestring_tag> : std::integral_constant<int, 1> {};
0049
0050
0051 template <>
0052 struct top_dim<segment_tag> : std::integral_constant<int, 1> {};
0053
0054
0055
0056
0057 template <>
0058 struct top_dim<ring_tag> : std::integral_constant<int, 2> {};
0059
0060
0061
0062 template <>
0063 struct top_dim<box_tag> : std::integral_constant<int, 2> {};
0064
0065
0066 template <>
0067 struct top_dim<polygon_tag> : std::integral_constant<int, 2> {};
0068
0069
0070 template <>
0071 struct top_dim<multi_point_tag> : std::integral_constant<int, 0> {};
0072
0073
0074 template <>
0075 struct top_dim<multi_linestring_tag> : std::integral_constant<int, 1> {};
0076
0077
0078 template <>
0079 struct top_dim<multi_polygon_tag> : std::integral_constant<int, 2> {};
0080
0081
0082 template <>
0083 struct top_dim<geometry_collection_tag> : std::integral_constant<int, -1> {};
0084
0085
0086 }
0087 #endif
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 template <typename Geometry>
0102 struct topological_dimension
0103 : core_dispatch::top_dim<tag_t<Geometry>> {};
0104
0105
0106 #ifndef BOOST_NO_CXX17_INLINE_VARIABLES
0107 template <typename Geometry>
0108 inline constexpr int topological_dimension_v = topological_dimension<Geometry>::value;
0109 #endif
0110
0111
0112 }}
0113
0114
0115 #endif