diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index a7238183d..376f5a71f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -60,13 +60,16 @@ public: namespace detail { namespace overlay { -template +template struct side_calculator { typedef boost::geometry::strategy::side::side_by_triangle<> side; // todo: get from coordinate system - inline side_calculator(Point1 const& pi, Point1 const& pj, Point1 const& pk, - Point2 const& qi, Point2 const& qj, Point2 const& qk) + inline side_calculator(Pi const& pi, Pj const& pj, Pk const& pk, + Qi const& qi, Qj const& qj, Qk const& qk) : m_pi(pi), m_pj(pj), m_pk(pk) , m_qi(qi), m_qj(qj), m_qk(qk) {} @@ -79,12 +82,12 @@ struct side_calculator inline int pk_wrt_q2() const { return side::apply(m_qj, m_qk, m_pk); } inline int qk_wrt_p2() const { return side::apply(m_pj, m_pk, m_qk); } - Point1 const& m_pi; - Point1 const& m_pj; - Point1 const& m_pk; - Point2 const& m_qi; - Point2 const& m_qj; - Point2 const& m_qk; + Pi const& m_pi; + Pj const& m_pj; + Pk const& m_pk; + Qi const& m_qi; + Qj const& m_qj; + Qk const& m_qk; }; struct base_turn_handler diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp index 5a7b5599b..b78489b04 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp @@ -541,10 +541,7 @@ struct get_turn_info_for_endpoint } else if ( ip_j2 ) { -// NOTE: this conversion may be problematic - Point1 i2_conv; - geometry::convert(i2, i2_conv); - side_calculator side_calc(i2_conv, i1, j1, i2, j2, k2); + side_calculator side_calc(i2, i1, j1, i2, j2, k2); std::pair operations = operations_of_equal(side_calc); @@ -589,11 +586,7 @@ struct get_turn_info_for_endpoint } else if ( ip_j2 ) { -// NOTE: this conversion may be problematic - Point1 i2_conv; - geometry::convert(i2, i2_conv); - - side_calculator side_calc(i2_conv, j1, i1, i2, j2, k2); + side_calculator side_calc(i2, j1, i1, i2, j2, k2); std::pair operations = operations_of_equal(side_calc); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp index 46eb6758c..003bac689 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp @@ -600,15 +600,11 @@ struct get_turn_info_linear_areal } else { - // NOTE: the conversion may be problematic - Point1 qi_conv; - geometry::convert(qi, qi_conv); - method_type replaced_method = method_touch_interior; if ( ip0.is_qj ) { - side_calculator side_calc(qi_conv, pi, pj, qi, qj, qk); + side_calculator side_calc(qi, pi, pj, qi, qj, qk); std::pair operations = get_info_e::operations_of_equal(side_calc); @@ -620,11 +616,9 @@ struct get_turn_info_linear_areal } else { -// NOTE: the conversion may be problematic - Point2 pi_conv; - geometry::convert(pi, pi_conv); - - side_calculator side_calc(qi_conv, pi, pj, qi, pi_conv, qj); + side_calculator side_calc(qi, pi, pj, qi, pi, qj); std::pair operations = get_info_e::operations_of_equal(side_calc); @@ -639,7 +633,6 @@ struct get_turn_info_linear_areal // equals<> or collinear<> will assign the second point, // we'd like to assign the first one - //geometry::convert(result.template get<0>().intersections[0], tp.point); base_turn_handler::assign_point(tp, tp.method, result.template get<0>(), 0); // NOTE: not really needed especially for the first point @@ -671,9 +664,7 @@ struct get_turn_info_linear_areal } else //if ( result.template get<0>().count == 1 ) { - Point1 qi_conv; - geometry::convert(qi, qi_conv); - side_calculator side_calc(qi_conv, pj, pi, qi, qj, qk); + side_calculator side_calc(qi, pj, pi, qi, qj, qk); std::pair operations = get_info_e::operations_of_equal(side_calc); @@ -698,7 +689,6 @@ struct get_turn_info_linear_areal // equals<> or collinear<> will assign the second point, // we'd like to assign the first one std::size_t ip_index = ip_count > 1 ? 1 : 0; - //geometry::convert(result.template get<0>().intersections[ip_index], tp.point); base_turn_handler::assign_point(tp, tp.method, result.template get<0>(), ip_index); AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>()); diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 59f9eb672..8a76473f3 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -582,9 +582,6 @@ void test_boxes_nd() typedef bg::model::point p1; typedef bg::model::point p2; typedef bg::model::point p3; - typedef bg::model::box b1; - typedef bg::model::box b2; - typedef bg::model::box b3; test_boxes_per_d(p1(0), p1(5), p1(3), p1(6), true); test_boxes_per_d(p2(0,0), p2(5,5), p2(3,3), p2(6,6), true);