debug_turn_info.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Use, modification and distribution is subject to the Boost Software License,
  4. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TURN_INFO_HPP
  7. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TURN_INFO_HPP
  8. #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
  9. #include <boost/geometry/algorithms/detail/overlay/visit_info.hpp>
  10. namespace boost { namespace geometry
  11. {
  12. inline char method_char(detail::overlay::method_type const& method)
  13. {
  14. using namespace detail::overlay;
  15. switch(method)
  16. {
  17. case method_none : return '-';
  18. case method_disjoint : return 'd';
  19. case method_crosses : return 'i';
  20. case method_touch : return 't';
  21. case method_touch_interior : return 'm';
  22. case method_collinear : return 'c';
  23. case method_equal : return 'e';
  24. case method_error : return '!';
  25. default : return '?';
  26. }
  27. }
  28. inline char operation_char(detail::overlay::operation_type const& operation)
  29. {
  30. using namespace detail::overlay;
  31. switch(operation)
  32. {
  33. case operation_none : return '-';
  34. case operation_union : return 'u';
  35. case operation_intersection : return 'i';
  36. case operation_blocked : return 'x';
  37. case operation_continue : return 'c';
  38. case operation_opposite : return 'o';
  39. default : return '?';
  40. }
  41. }
  42. inline char visited_char(detail::overlay::visit_info const& v)
  43. {
  44. if (v.rejected()) return 'R';
  45. if (v.started()) return 's';
  46. if (v.visited()) return 'v';
  47. if (v.none()) return '-';
  48. if (v.finished()) return 'f';
  49. return '?';
  50. }
  51. }} // namespace boost::geometry
  52. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_DEBUG_TURN_INFO_HPP