diff --git a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp index 6198bdbd6..542f07b9f 100644 --- a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +++ b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp @@ -66,10 +66,10 @@ public: } else if ( BoundaryQuery == boundary_any ) { - return sid.segment_index == 0 - && detail::equals::equals_point_point(pt, range::front(geometry)) - || sid.segment_index + 2 == geometry::num_points(geometry) - && detail::equals::equals_point_point(pt, range::back(geometry)); + return ( sid.segment_index == 0 + && detail::equals::equals_point_point(pt, range::front(geometry)) ) + || ( sid.segment_index + 2 == geometry::num_points(geometry) + && detail::equals::equals_point_point(pt, range::back(geometry)) ); } BOOST_ASSERT(false); diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index cb9b225c7..a38582691 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -404,7 +404,7 @@ struct linear_linear template class exit_watcher { - typedef point_identifier point_identifier; + typedef point_identifier point_info; public: exit_watcher() @@ -415,7 +415,7 @@ struct linear_linear bool enter(Point const& point, segment_identifier const& other_id) { bool result = other_entry_points.empty(); - other_entry_points.push_back(point_identifier(other_id, point)); + other_entry_points.push_back(point_info(other_id, point)); return result; } @@ -428,7 +428,7 @@ struct linear_linear if ( other_entry_points.empty() ) return true; - typedef typename std::vector::iterator point_iterator; + typedef typename std::vector::iterator point_iterator; // search for the entry point in the same range of other geometry point_iterator entry_it = std::find_if(other_entry_points.begin(), other_entry_points.end(), @@ -440,7 +440,7 @@ struct linear_linear // here we know that we possibly left LS // we must still check if we didn't get back on the same point exit_operation = exit_op; - exit_id = point_identifier(other_id, point); + exit_id = point_info(other_id, point); // erase the corresponding entry point other_entry_points.erase(entry_it); @@ -467,8 +467,8 @@ struct linear_linear private: overlay::operation_type exit_operation; - point_identifier exit_id; - std::vector other_entry_points; // TODO: use map here or sorted vector? + point_info exit_id; + std::vector other_entry_points; // TODO: use map here or sorted vector? }; // This analyser should be used like Input or SinglePass Iterator diff --git a/include/boost/geometry/algorithms/detail/relate/relate.hpp b/include/boost/geometry/algorithms/detail/relate/relate.hpp index 7f41719e8..77c68c3d8 100644 --- a/include/boost/geometry/algorithms/detail/relate/relate.hpp +++ b/include/boost/geometry/algorithms/detail/relate/relate.hpp @@ -41,12 +41,12 @@ #include #include +#include + #include #include #include -#include - namespace boost { namespace geometry { diff --git a/test/algorithms/Jamfile.v2 b/test/algorithms/Jamfile.v2 index 7c5b0f4da..8227c3d50 100644 --- a/test/algorithms/Jamfile.v2 +++ b/test/algorithms/Jamfile.v2 @@ -34,6 +34,7 @@ test-suite boost-geometry-algorithms [ run overlaps.cpp ] [ run perimeter.cpp ] [ run point_on_surface.cpp ] + [ run relate.cpp ] [ run remove_spikes.cpp ] [ run reverse.cpp ] [ run simplify.cpp ] diff --git a/test/algorithms/overlay/get_turns_linear_linear.cpp b/test/algorithms/overlay/get_turns_linear_linear.cpp index 89876ab68..a4fde8740 100644 --- a/test/algorithms/overlay/get_turns_linear_linear.cpp +++ b/test/algorithms/overlay/get_turns_linear_linear.cpp @@ -85,7 +85,9 @@ void check_geometry( BOOST_FOREACH(std::string const& s, expected) { - std::vector::iterator it = std::find_if(turns.begin(), turns.end(), equal_turn(s)); + typename std::vector::iterator + it = std::find_if(turns.begin(), turns.end(), equal_turn(s)); + if ( it != turns.end() ) turns.erase(it); else