File indexing completed on 2025-12-15 09:50:24
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_GC_TOPOLOGICAL_DIMENSION_HPP
0010 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_GC_TOPOLOGICAL_DIMENSION_HPP
0011
0012
0013 #include <algorithm>
0014
0015 #include <boost/geometry/algorithms/detail/visit.hpp>
0016 #include <boost/geometry/algorithms/is_empty.hpp>
0017 #include <boost/geometry/core/topological_dimension.hpp>
0018
0019
0020 namespace boost { namespace geometry
0021 {
0022
0023
0024 #ifndef DOXYGEN_NO_DETAIL
0025 namespace detail
0026 {
0027
0028
0029 template <typename GeometryCollection>
0030 inline int gc_topological_dimension(GeometryCollection const& geometry)
0031 {
0032 int result = -1;
0033 detail::visit_breadth_first([&](auto const& g)
0034 {
0035 if (! geometry::is_empty(g))
0036 {
0037 static const int d = geometry::topological_dimension<decltype(g)>::value;
0038 result = (std::max)(result, d);
0039 }
0040 return result >= 2;
0041 }, geometry);
0042 return result;
0043 }
0044
0045
0046 }
0047 #endif
0048
0049 }}
0050
0051 #endif