debug_validity_phase.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2014, 2018, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Licensed under the Boost Software License version 1.0.
  6. // http://www.boost.org/users/license.html
  7. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_VALIDITY_PHASE_HPP
  8. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_VALIDITY_PHASE_HPP
  9. #ifdef GEOMETRY_TEST_DEBUG
  10. #include <iostream>
  11. #endif
  12. #include <boost/geometry/core/tag.hpp>
  13. #include <boost/geometry/core/tags.hpp>
  14. namespace boost { namespace geometry
  15. {
  16. namespace detail { namespace is_valid
  17. {
  18. template <typename Geometry, typename Tag = typename tag<Geometry>::type>
  19. struct debug_validity_phase
  20. {
  21. static inline void apply(int)
  22. {
  23. }
  24. };
  25. #ifdef BOOST_GEOMETRY_TEST_DEBUG
  26. template <typename Polygon>
  27. struct debug_validity_phase<Polygon, polygon_tag>
  28. {
  29. static inline void apply(int phase)
  30. {
  31. switch (phase)
  32. {
  33. case 1:
  34. std::cout << "checking exterior ring..." << std::endl;
  35. break;
  36. case 2:
  37. std::cout << "checking interior rings..." << std::endl;
  38. break;
  39. case 3:
  40. std::cout << "computing and analyzing turns..." << std::endl;
  41. break;
  42. case 4:
  43. std::cout << "checking if interior rings are inside "
  44. << "the exterior ring..." << std::endl;
  45. break;
  46. case 5:
  47. std::cout << "checking connectivity of interior..." << std::endl;
  48. break;
  49. }
  50. }
  51. };
  52. #endif
  53. }} // namespace detail::is_valid
  54. }} // namespace boost::geometry
  55. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_VALIDITY_PHASE_HPP