Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:12

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2018.
0006 // Modifications copyright (c) 2018 Oracle and/or its affiliates.
0007 
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP
0016 
0017 
0018 #include <string>
0019 
0020 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
0021 
0022 
0023 namespace boost { namespace geometry
0024 {
0025 
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail { namespace overlay
0028 {
0029 
0030 
0031     static inline std::string dir(int d)
0032     {
0033         return d == 0 ? "-" : (d == 1 ? "L" : d == -1 ? "R" : "#");
0034     }
0035     static inline std::string how_str(int h)
0036     {
0037         return h == 0 ? "-" : (h == 1 ? "A" : "D");
0038     }
0039 
0040     template <typename P, typename SR, typename O, typename C>
0041     std::ostream& operator<<(std::ostream &os, turn_info<P, SR, O, C> const& info)
0042     {
0043         os  << "\t"
0044             << " src " << info.seg_id.source_index
0045             << " seg " << info.seg_id.segment_index
0046             << " (// " << info.other_id.source_index
0047                 << "." << info.other_id.segment_index << ")"
0048             << " how " << info.how
0049                 << "[" << how_str(info.arrival)
0050                 << " " << dir(info.direction)
0051                 << (info.opposite ? " o" : "")
0052                 << "]"
0053             << " sd "
0054                 << dir(info.sides.template get<0,0>())
0055                 << dir(info.sides.template get<0,1>())
0056                 << dir(info.sides.template get<1,0>())
0057                 << dir(info.sides.template get<1,1>())
0058             << " nxt seg " << info.travels_to_vertex_index
0059             << " , ip " << info.travels_to_ip_index
0060             << " , or " << info.next_ip_index
0061             << " frac " << info.fraction
0062             << info.visit_state;
0063         if (info.flagged)
0064         {
0065             os << " FLAGGED";
0066         }
0067         return os;
0068     }
0069 
0070 
0071 
0072 }} // namespace detail::overlay
0073 #endif //DOXYGEN_NO_DETAIL
0074 
0075 
0076 }} // namespace boost::geometry
0077 
0078 
0079 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_STREAM_INFO_HPP