File indexing completed on 2026-08-21 08:45:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GRAPH_UTIL_HPP
0010 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GRAPH_UTIL_HPP
0011
0012 #include <boost/graph/biconnected_components.hpp>
0013 #include <boost/graph/adjacency_list.hpp>
0014
0015 namespace boost { namespace geometry
0016 {
0017
0018 #ifndef DOXYGEN_NO_DETAIL
0019 namespace detail { namespace overlay
0020 {
0021
0022 struct edge_component
0023 {
0024 using kind = edge_property_tag;
0025 };
0026
0027
0028
0029
0030 template <typename Graph, typename Components>
0031 void fix_components(Components& components, Graph const& g)
0032 {
0033 typename graph_traits<Graph>::edge_iterator ei, ei_end;
0034 for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
0035 {
0036 auto& component = components[*ei];
0037
0038 auto const source_vertex = source(*ei, g);
0039 auto const target_vertex = target(*ei, g);
0040
0041
0042 auto const reverse_edge_pair = edge(target_vertex, source_vertex, g);
0043 if (! reverse_edge_pair.second)
0044 {
0045 continue;
0046 }
0047
0048 auto& reverse_component = components[reverse_edge_pair.first];
0049
0050 if (component != reverse_component)
0051 {
0052 component = reverse_component;
0053 }
0054 }
0055 }
0056
0057 }}
0058 #endif
0059
0060 }}
0061
0062 #endif