• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 
3 // Copyright (c) 2014, 2018, 2019, Oracle and/or its affiliates.
4 
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
10 
11 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_COMPLEMENT_GRAPH_HPP
12 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_COMPLEMENT_GRAPH_HPP
13 
14 #ifdef BOOST_GEOMETRY_TEST_DEBUG
15 #include <iostream>
16 #endif
17 
18 #include <boost/geometry/algorithms/detail/is_valid/complement_graph.hpp>
19 
20 namespace boost { namespace geometry
21 {
22 
23 namespace detail { namespace is_valid
24 {
25 
26 
27 #ifdef BOOST_GEOMETRY_TEST_DEBUG
28 template <typename OutputStream, typename TurnPoint, typename CSTag>
29 inline void
debug_print_complement_graph(OutputStream & os,complement_graph<TurnPoint,CSTag> const & graph)30 debug_print_complement_graph(OutputStream& os,
31                              complement_graph<TurnPoint, CSTag> const& graph)
32 {
33     typedef typename complement_graph<TurnPoint>::vertex_handle vertex_handle;
34 
35     os << "num rings: " << graph.m_num_rings << std::endl;
36     os << "vertex ids: {";
37     for (vertex_handle it = graph.m_vertices.begin();
38          it != graph.m_vertices.end(); ++it)
39     {
40         os << " " << it->id();
41     }
42     os << " }" << std::endl;
43 
44     for (vertex_handle it = graph.m_vertices.begin();
45          it != graph.m_vertices.end(); ++it)
46     {
47         os << "neighbors of " << it->id() << ": {";
48         for (typename complement_graph
49                  <
50                      TurnPoint
51                  >::neighbor_container::const_iterator
52                  nit = graph.m_neighbors[it->id()].begin();
53              nit != graph.m_neighbors[it->id()].end(); ++nit)
54         {
55             os << " " << (*nit)->id();
56         }
57         os << "}" << std::endl;
58     }
59 }
60 #else
61 template <typename OutputStream, typename TurnPoint, typename CSTag>
62 inline void debug_print_complement_graph(OutputStream&,
63                                          complement_graph<TurnPoint, CSTag> const&)
64 {
65 }
66 #endif
67 
68 
69 }} // namespace detail::is_valid
70 
71 }} // namespace boost::geometry
72 
73 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_COMPLEMENT_GRAPH_HPP
74