1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // This file was modified by Oracle on 2018.
6 // Modifications copyright (c) 2018 Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
14 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
15 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
20 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
23 namespace boost { namespace geometry
26 #ifndef DOXYGEN_NO_DETAIL
27 namespace detail { namespace overlay
31 static inline std::string dir(int d)
33 return d == 0 ? "-" : (d == 1 ? "L" : d == -1 ? "R" : "#");
35 static inline std::string how_str(int h)
37 return h == 0 ? "-" : (h == 1 ? "A" : "D");
40 template <typename P, typename SR, typename O, typename C>
41 std::ostream& operator<<(std::ostream &os, turn_info<P, SR, O, C> const& info)
44 << " src " << info.seg_id.source_index
45 << " seg " << info.seg_id.segment_index
46 << " (// " << info.other_id.source_index
47 << "." << info.other_id.segment_index << ")"
48 << " how " << info.how
49 << "[" << how_str(info.arrival)
50 << " " << dir(info.direction)
51 << (info.opposite ? " o" : "")
54 << dir(info.sides.template get<0,0>())
55 << dir(info.sides.template get<0,1>())
56 << dir(info.sides.template get<1,0>())
57 << dir(info.sides.template get<1,1>())
58 << " nxt seg " << info.travels_to_vertex_index
59 << " , ip " << info.travels_to_ip_index
60 << " , or " << info.next_ip_index
61 << " frac " << info.fraction
72 }} // namespace detail::overlay
73 #endif //DOXYGEN_NO_DETAIL
76 }} // namespace boost::geometry
79 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP