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