39
39
#include < boost/geometry/algorithms/detail/sections/section_functions.hpp>
40
40
#include < boost/geometry/algorithms/detail/sections/sectionalize.hpp>
41
41
42
- #include < boost/geometry/core/access.hpp>
43
42
#include < boost/geometry/core/assert.hpp>
44
43
#include < boost/geometry/core/coordinate_dimension.hpp>
45
44
#include < boost/geometry/core/exterior_ring.hpp>
@@ -669,10 +668,6 @@ struct get_turns_cs
669
668
// into account (not in the iterator, nor in the retrieve policy)
670
669
iterator_type it = boost::begin (view);
671
670
672
- // bool first = true;
673
-
674
- // char previous_side[2] = {0, 0};
675
-
676
671
signed_size_type index = 0 ;
677
672
678
673
for (iterator_type prev = it++;
@@ -684,64 +679,19 @@ struct get_turns_cs
684
679
685
680
unique_sub_range_from_view_policy view_unique_sub_range (view, *prev, *it, it);
686
681
687
- /* if (first)
688
- {
689
- previous_side[0] = get_side<0>(box, *prev);
690
- previous_side[1] = get_side<1>(box, *prev);
691
- }
692
-
693
- char current_side[2];
694
- current_side[0] = get_side<0>(box, *it);
695
- current_side[1] = get_side<1>(box, *it);
696
-
697
- // There can NOT be intersections if
698
- // 1) EITHER the two points are lying on one side of the box (! 0 && the same)
699
- // 2) OR same in Y-direction
700
- // 3) OR all points are inside the box (0)
701
- if (! (
702
- (current_side[0] != 0 && current_side[0] == previous_side[0])
703
- || (current_side[1] != 0 && current_side[1] == previous_side[1])
704
- || (current_side[0] == 0
705
- && current_side[1] == 0
706
- && previous_side[0] == 0
707
- && previous_side[1] == 0)
708
- )
709
- )*/
710
- if (true )
711
- {
712
- get_turns_with_box (seg_id, source_id2,
713
- view_unique_sub_range,
714
- box_points,
715
- intersection_strategy,
716
- robust_policy,
717
- turns,
718
- interrupt_policy);
719
- // Future performance enhancement:
720
- // return if told by the interrupt policy
721
- }
682
+ get_turns_with_box (seg_id, source_id2,
683
+ view_unique_sub_range,
684
+ box_points,
685
+ intersection_strategy,
686
+ robust_policy,
687
+ turns,
688
+ interrupt_policy);
689
+ // Future performance enhancement:
690
+ // return if told by the interrupt policy
722
691
}
723
692
}
724
693
725
694
private:
726
- template <std::size_t Index, typename Point >
727
- static inline int get_side (Box const & box, Point const & point)
728
- {
729
- // Inside -> 0
730
- // Outside -> -1 (left/below) or 1 (right/above)
731
- // On border -> -2 (left/lower) or 2 (right/upper)
732
- // The only purpose of the value is to not be the same,
733
- // and to denote if it is inside (0)
734
-
735
- typename coordinate_type<Point >::type const & c = get<Index>(point);
736
- typename coordinate_type<Box>::type const & left = get<min_corner, Index>(box);
737
- typename coordinate_type<Box>::type const & right = get<max_corner, Index>(box);
738
-
739
- if (geometry::math::equals (c, left)) return -2 ;
740
- else if (geometry::math::equals (c, right)) return 2 ;
741
- else if (c < left) return -1 ;
742
- else if (c > right) return 1 ;
743
- else return 0 ;
744
- }
745
695
746
696
template
747
697
<
0 commit comments