|
| 1 | +// Boost.Geometry (aka GGL, Generic Geometry Library) |
| 2 | + |
| 3 | +// Copyright (c) 2007-2025 Barend Gehrels, Amsterdam, the Netherlands. |
| 4 | +// Copyright (c) 2023-2024 Adam Wulkiewicz, Lodz, Poland. |
| 5 | + |
| 6 | +// This file was modified by Oracle on 2017-2024. |
| 7 | +// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates. |
| 8 | +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle |
| 9 | +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle |
| 10 | + |
| 11 | +// Use, modification and distribution is subject to the Boost Software License, |
| 12 | +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 13 | +// http://www.boost.org/LICENSE_1_0.txt) |
| 14 | + |
| 15 | +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TRAVERSE_HPP |
| 16 | +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TRAVERSE_HPP |
| 17 | + |
| 18 | +#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> |
| 19 | + |
| 20 | +#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) \ |
| 21 | + || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT) \ |
| 22 | + || defined(BOOST_GEOMETRY_DEBUG_TRAVERSE) |
| 23 | +# include <string> |
| 24 | +# include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp> |
| 25 | +# include <boost/geometry/io/wkt/wkt.hpp> |
| 26 | +#endif |
| 27 | + |
| 28 | +namespace boost { namespace geometry |
| 29 | +{ |
| 30 | + |
| 31 | +#ifndef DOXYGEN_NO_DETAIL |
| 32 | +namespace detail { namespace overlay |
| 33 | +{ |
| 34 | + |
| 35 | +template <typename Turn, typename Operation> |
| 36 | +#ifdef BOOST_GEOMETRY_DEBUG_TRAVERSE |
| 37 | +inline void debug_traverse(Turn const& turn, Operation op, |
| 38 | + std::string const& header, bool condition = true) |
| 39 | +{ |
| 40 | + if (! condition) |
| 41 | + { |
| 42 | + return; |
| 43 | + } |
| 44 | + std::cout << " " << header |
| 45 | + << " at " << op.seg_id |
| 46 | + << " meth: " << method_char(turn.method) |
| 47 | + << " op: " << operation_char(op.operation) |
| 48 | + << " of: " << operation_char(turn.operations[0].operation) |
| 49 | + << operation_char(turn.operations[1].operation) |
| 50 | + << " " << geometry::wkt(turn.point) |
| 51 | + << std::endl; |
| 52 | + |
| 53 | + if (boost::contains(header, "Finished")) |
| 54 | + { |
| 55 | + std::cout << std::endl; |
| 56 | + } |
| 57 | +} |
| 58 | +#else |
| 59 | +inline void debug_traverse(Turn const& , Operation, const char*, bool = true) |
| 60 | +{ |
| 61 | +} |
| 62 | +#endif |
| 63 | + |
| 64 | +}} // namespace detail::overlay |
| 65 | +#endif // DOXYGEN_NO_DETAIL |
| 66 | + |
| 67 | +}} // namespace boost::geometry |
| 68 | + |
| 69 | +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TRAVERSE_HPP |
0 commit comments