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