Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:50:24

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2022, Oracle and/or its affiliates.
0004 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0005 
0006 // Licensed under the Boost Software License version 1.0.
0007 // http://www.boost.org/users/license.html
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 } // namespace detail
0047 #endif // DOXYGEN_NO_DETAIL
0048 
0049 }} // namespace boost::geometry
0050 
0051 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_GC_TOPOLOGICAL_DIMENSION_HPP