diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/within/point_in_geometry.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/within/point_in_geometry.hpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/boost/geometry/algorithms/detail/within/point_in_geometry.hpp b/boost/geometry/algorithms/detail/within/point_in_geometry.hpp index 6f1c1816cb..e7486f0e45 100644 --- a/boost/geometry/algorithms/detail/within/point_in_geometry.hpp +++ b/boost/geometry/algorithms/detail/within/point_in_geometry.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013, 2014. -// Modifications copyright (c) 2013, 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2015. +// Modifications copyright (c) 2013-2015, Oracle and/or its affiliates. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -21,6 +21,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_WITHIN_POINT_IN_GEOMETRY_HPP #include <boost/assert.hpp> +#include <boost/core/ignore_unused.hpp> #include <boost/mpl/assert.hpp> #include <boost/range.hpp> #include <boost/type_traits/is_same.hpp> @@ -35,6 +36,7 @@ #include <boost/geometry/strategies/within.hpp> #include <boost/geometry/strategies/covered_by.hpp> +#include <boost/geometry/util/range.hpp> #include <boost/geometry/views/detail/normalized_view.hpp> namespace boost { namespace geometry { @@ -58,7 +60,7 @@ inline T check_result_type(T result) template <typename Point, typename Range, typename Strategy> inline int point_in_range(Point const& point, Range const& range, Strategy const& strategy) { - boost::ignore_unused_variable_warning(strategy); + boost::ignore_unused(strategy); typedef typename boost::range_iterator<Range const>::type iterator_type; typename Strategy::state_type state; @@ -147,7 +149,7 @@ struct point_in_geometry<Point2, point_tag> template <typename Point1, typename Strategy> static inline int apply(Point1 const& point1, Point2 const& point2, Strategy const& strategy) { - boost::ignore_unused_variable_warning(strategy); + boost::ignore_unused(strategy); return strategy.apply(point1, point2) ? 1 : -1; } }; @@ -158,6 +160,8 @@ struct point_in_geometry<Segment, segment_tag> template <typename Point, typename Strategy> static inline int apply(Point const& point, Segment const& segment, Strategy const& strategy) { + boost::ignore_unused(strategy); + typedef typename geometry::point_type<Segment>::type point_type; point_type p0, p1; // TODO: don't copy points @@ -194,11 +198,11 @@ struct point_in_geometry<Linestring, linestring_tag> return -1; // exterior // if the linestring doesn't have a boundary - if ( detail::equals::equals_point_point(*boost::begin(linestring), *(--boost::end(linestring))) ) + if (detail::equals::equals_point_point(range::front(linestring), range::back(linestring))) return 1; // interior // else if the point is equal to the one of the terminal points - else if ( detail::equals::equals_point_point(point, *boost::begin(linestring)) - || detail::equals::equals_point_point(point, *(--boost::end(linestring))) ) + else if (detail::equals::equals_point_point(point, range::front(linestring)) + || detail::equals::equals_point_point(point, range::back(linestring))) return 0; // boundary else return 1; // interior @@ -207,7 +211,7 @@ struct point_in_geometry<Linestring, linestring_tag> // throw an exception here? /*else if ( count == 1 ) { - if ( detail::equals::equals_point_point(point, *boost::begin(linestring)) ) + if ( detail::equals::equals_point_point(point, range::front(linestring)) ) return 1; }*/ @@ -333,8 +337,8 @@ struct point_in_geometry<Geometry, multi_linestring_tag> if ( boost::size(*it) < 2 ) continue; - point_type const& front = *boost::begin(*it); - point_type const& back = *(--boost::end(*it)); + point_type const& front = range::front(*it); + point_type const& back = range::back(*it); // is closed_ring - no boundary if ( detail::equals::equals_point_point(front, back) ) |