diff --git a/include/boost/geometry/algorithms/detail/intersection/box_box.hpp b/include/boost/geometry/algorithms/detail/intersection/box_box.hpp index 30c31ff1e5..ff99a2290c 100644 --- a/include/boost/geometry/algorithms/detail/intersection/box_box.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/box_box.hpp @@ -16,7 +16,7 @@ #include -#include +#include namespace boost { namespace geometry diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp b/include/boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp similarity index 79% rename from include/boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp rename to include/boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp index 31db94dd95..86478226c7 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp @@ -11,12 +11,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP -#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP #include -#include namespace boost { namespace geometry @@ -42,18 +41,16 @@ struct intersection_box_box BoxOut& box_out, Strategy const& strategy) { - typedef typename coordinate_type::type ct; - - ct max1 = get(box1); - ct min2 = get(box2); + auto max1 = get(box1); + auto min2 = get(box2); if (max1 < min2) { return false; } - ct max2 = get(box2); - ct min1 = get(box1); + auto max2 = get(box2); + auto min1 = get(box1); if (max2 < min1) { @@ -93,4 +90,4 @@ struct intersection_box_box }} // namespace boost::geometry -#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP diff --git a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp index 49d190bd0c..39d107e013 100644 --- a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT) diff --git a/include/boost/geometry/algorithms/detail/overlay/cluster_exits.hpp b/include/boost/geometry/algorithms/detail/overlay/cluster_exits.hpp index 8c4f4c7f31..b1c7de217d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/cluster_exits.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/cluster_exits.hpp @@ -20,7 +20,6 @@ #include -#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 326c883b39..b6f8983e31 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -669,10 +668,6 @@ struct get_turns_cs // into account (not in the iterator, nor in the retrieve policy) iterator_type it = boost::begin(view); - //bool first = true; - - //char previous_side[2] = {0, 0}; - signed_size_type index = 0; for (iterator_type prev = it++; @@ -684,64 +679,19 @@ struct get_turns_cs unique_sub_range_from_view_policy view_unique_sub_range(view, *prev, *it, it); - /*if (first) - { - previous_side[0] = get_side<0>(box, *prev); - previous_side[1] = get_side<1>(box, *prev); - } - - char current_side[2]; - current_side[0] = get_side<0>(box, *it); - current_side[1] = get_side<1>(box, *it); - - // There can NOT be intersections if - // 1) EITHER the two points are lying on one side of the box (! 0 && the same) - // 2) OR same in Y-direction - // 3) OR all points are inside the box (0) - if (! ( - (current_side[0] != 0 && current_side[0] == previous_side[0]) - || (current_side[1] != 0 && current_side[1] == previous_side[1]) - || (current_side[0] == 0 - && current_side[1] == 0 - && previous_side[0] == 0 - && previous_side[1] == 0) - ) - )*/ - if (true) - { - get_turns_with_box(seg_id, source_id2, - view_unique_sub_range, - box_points, - intersection_strategy, - robust_policy, - turns, - interrupt_policy); - // Future performance enhancement: - // return if told by the interrupt policy - } + get_turns_with_box(seg_id, source_id2, + view_unique_sub_range, + box_points, + intersection_strategy, + robust_policy, + turns, + interrupt_policy); + // Future performance enhancement: + // return if told by the interrupt policy } } private: - template - static inline int get_side(Box const& box, Point const& point) - { - // Inside -> 0 - // Outside -> -1 (left/below) or 1 (right/above) - // On border -> -2 (left/lower) or 2 (right/upper) - // The only purpose of the value is to not be the same, - // and to denote if it is inside (0) - - typename coordinate_type::type const& c = get(point); - typename coordinate_type::type const& left = get(box); - typename coordinate_type::type const& right = get(box); - - if (geometry::math::equals(c, left)) return -2; - else if (geometry::math::equals(c, right)) return 2; - else if (c < left) return -1; - else if (c > right) return 1; - else return 0; - } template < diff --git a/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp b/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp index e41ee8238c..4fd69411d0 100644 --- a/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp @@ -13,7 +13,6 @@ #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp index 20369fa95a..1883e1df21 100644 --- a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 0baf475a00..82cfb86a83 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp index a3aec363c0..692de7345a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp index be0f2bcd87..1858c9ec2a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp @@ -21,7 +21,11 @@ #include #include #include + +#if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR) #include +#endif + #include #include diff --git a/include/boost/geometry/algorithms/detail/sections/range_by_section.hpp b/include/boost/geometry/algorithms/detail/sections/range_by_section.hpp index f321b40b2a..fd029db1b3 100644 --- a/include/boost/geometry/algorithms/detail/sections/range_by_section.hpp +++ b/include/boost/geometry/algorithms/detail/sections/range_by_section.hpp @@ -21,7 +21,6 @@ #include #include -#include #include #include #include diff --git a/include/boost/geometry/index/detail/algorithms/intersection_content.hpp b/include/boost/geometry/index/detail/algorithms/intersection_content.hpp index 1a2cd28bc0..260af9eca5 100644 --- a/include/boost/geometry/index/detail/algorithms/intersection_content.hpp +++ b/include/boost/geometry/index/detail/algorithms/intersection_content.hpp @@ -16,7 +16,7 @@ #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP #include -#include +#include #include