diff --git a/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp b/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp index 29d9ab208..6e175640e 100644 --- a/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp @@ -137,7 +137,7 @@ private : return default_order(left, right); } - inline int union_code(Indexed const& left, Indexed const& right) const + inline int overlay_code(Indexed const& left, Indexed const& right) const { typedef typename boost::range_value::type turn_type; typedef typename turn_type::turn_operation_type turn_op_type; @@ -162,13 +162,13 @@ private : // If the operation is union, get the two union-operations point_type p_lhs; - if (left_op.operation == operation_union - && left_other_op.operation != operation_union) + if (left_op.operation == m_for_operation + && left_other_op.operation != m_for_operation) { p_lhs = left_op.fraction.is_one() ? p_both3 : p_both2; } - else if (left_other_op.operation == operation_union - && left_op.operation != operation_union) + else if (left_other_op.operation == m_for_operation + && left_op.operation != m_for_operation) { p_lhs = left_other_op.fraction.is_one() ? p_left_o3 : p_left_o2; } @@ -178,13 +178,13 @@ private : } point_type p_rhs; - if (right_op.operation == operation_union - && right_other_op.operation != operation_union) + if (right_op.operation == m_for_operation + && right_other_op.operation != m_for_operation) { p_rhs = right_op.fraction.is_one() ? p_both3 : p_both2; } - else if (right_other_op.operation == operation_union - && right_op.operation != operation_union) + else if (right_other_op.operation == m_for_operation + && right_op.operation != m_for_operation) { p_rhs = right_other_op.fraction.is_one() ? p_right_o3 : p_right_o2; } @@ -267,13 +267,14 @@ public : return left_code < right_code; } - if (m_for_operation == operation_union) + //if (m_for_operation == operation_union) { - int const code = union_code(left, right); + int const code = overlay_code(left, right); if (code != -1) { - // Most left should be ordered first. If code = 1, then lhs + // For union: if code = 1, then lhs // is most-left, and we should return true (smaller) + // For intersection the same is valid return code == 1; } } diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index 6364e8f12..17d97f9fb 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -125,10 +125,10 @@ void test_areal() test_one("case_102_multi", case_102_multi[0], case_102_multi[1], 3, 26, 19.75); +#endif test_one("case_107_multi", case_107_multi[0], case_107_multi[1], 2, 10, 1.5); -#endif test_one("case_recursive_boxes_1", case_recursive_boxes_1[0], case_recursive_boxes_1[1], 10, 97, 47.0);