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