summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/line_interpolate.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/line_interpolate.hpp')
-rw-r--r--boost/geometry/algorithms/line_interpolate.hpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/boost/geometry/algorithms/line_interpolate.hpp b/boost/geometry/algorithms/line_interpolate.hpp
index a3b4b2ba83..5739c444ee 100644
--- a/boost/geometry/algorithms/line_interpolate.hpp
+++ b/boost/geometry/algorithms/line_interpolate.hpp
@@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2018-2021 Oracle and/or its affiliates.
+// Copyright (c) 2018-2023 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -11,21 +11,19 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_LINE_INTERPOLATE_HPP
#define BOOST_GEOMETRY_ALGORITHMS_LINE_INTERPOLATE_HPP
-#include <iterator>
#include <type_traits>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
-#include <boost/range/iterator.hpp>
#include <boost/range/value_type.hpp>
+#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/variant_fwd.hpp>
#include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
#include <boost/geometry/algorithms/detail/dummy_geometries.hpp>
-#include <boost/geometry/core/cs.hpp>
-#include <boost/geometry/core/closure.hpp>
+#include <boost/geometry/core/exception.hpp>
#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
@@ -37,6 +35,12 @@
#include <boost/geometry/strategies/line_interpolate/geographic.hpp>
#include <boost/geometry/strategies/line_interpolate/spherical.hpp>
+#include <boost/geometry/util/condition.hpp>
+#include <boost/geometry/util/range.hpp>
+#include <boost/geometry/util/type_traits.hpp>
+
+#include <boost/geometry/views/segment_view.hpp>
+
namespace boost { namespace geometry
{
@@ -86,11 +90,10 @@ struct interpolate_range
PointLike & pointlike,
Strategies const& strategies)
{
- typedef typename boost::range_iterator<Range const>::type iterator_t;
typedef typename boost::range_value<Range const>::type point_t;
- iterator_t it = boost::begin(range);
- iterator_t end = boost::end(range);
+ auto it = boost::begin(range);
+ auto const end = boost::end(range);
if (it == end) // empty(range)
{
@@ -109,7 +112,7 @@ struct interpolate_range
typedef decltype(pp_strategy.apply(
std::declval<point_t>(), std::declval<point_t>())) distance_type;
- iterator_t prev = it++;
+ auto prev = it++;
distance_type repeated_distance = max_distance;
distance_type prev_distance = 0;
distance_type current_distance = 0;
@@ -130,7 +133,7 @@ struct interpolate_range
p,
diff_distance);
Policy::apply(p, pointlike);
- if (std::is_same<PointLike, point_t>::value)
+ if ( BOOST_GEOMETRY_CONDITION(util::is_point<PointLike>::value) )
{
return;
}
@@ -256,7 +259,7 @@ struct line_interpolate<Strategy, false>
Distance const& max_distance,
Pointlike & pointlike,
Strategy const& strategy)
- {
+ {
using strategies::line_interpolate::services::strategy_converter;
dispatch::line_interpolate
@@ -275,7 +278,7 @@ struct line_interpolate<default_strategy, false>
Distance const& max_distance,
Pointlike & pointlike,
default_strategy)
- {
+ {
typedef typename strategies::line_interpolate::services::default_strategy
<
Geometry