1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
10 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
15 #include <boost/array.hpp>
18 namespace boost { namespace geometry
21 #ifndef DOXYGEN_NO_DETAIL
22 namespace detail { namespace overlay
26 static inline std::string dir(int d)
28 return d == 0 ? "-" : (d == 1 ? "L" : d == -1 ? "R" : "#");
30 static inline std::string how_str(int h)
32 return h == 0 ? "-" : (h == 1 ? "A" : "D");
36 std::ostream& operator<<(std::ostream &os, turn_info<P> const& info)
39 << " src " << info.seg_id.source_index
40 << " seg " << info.seg_id.segment_index
41 << " (// " << info.other_id.source_index
42 << "." << info.other_id.segment_index << ")"
43 << " how " << info.how
44 << "[" << how_str(info.arrival)
45 << " " << dir(info.direction)
46 << (info.opposite ? " o" : "")
49 << dir(info.sides.get<0,0>())
50 << dir(info.sides.get<0,1>())
51 << dir(info.sides.get<1,0>())
52 << dir(info.sides.get<1,1>())
53 << " nxt seg " << info.travels_to_vertex_index
54 << " , ip " << info.travels_to_ip_index
55 << " , or " << info.next_ip_index
56 << " frac " << info.fraction
67 }} // namespace detail::overlay
68 #endif //DOXYGEN_NO_DETAIL
71 }} // namespace boost::geometry
74 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP