summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/convert.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/geometry/algorithms/convert.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/geometry/algorithms/convert.hpp')
-rw-r--r--boost/geometry/algorithms/convert.hpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/boost/geometry/algorithms/convert.hpp b/boost/geometry/algorithms/convert.hpp
index 6a8ba1acb6..6ccaa0dd4b 100644
--- a/boost/geometry/algorithms/convert.hpp
+++ b/boost/geometry/algorithms/convert.hpp
@@ -5,6 +5,10 @@
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
+// This file was modified by Oracle on 2017.
+// Modifications copyright (c) 2017, Oracle and/or its affiliates.
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
+
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -29,10 +33,8 @@
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
-#include <boost/geometry/algorithms/append.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/for_each.hpp>
-#include <boost/geometry/algorithms/detail/assign_values.hpp>
#include <boost/geometry/algorithms/detail/assign_box_corners.hpp>
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
#include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
@@ -153,8 +155,24 @@ struct range_to_range
geometry::closure<Range1>::value
>::type view_type;
+ struct default_policy
+ {
+ template <typename Point1, typename Point2>
+ static inline void apply(Point1 const& point1, Point2 & point2)
+ {
+ geometry::detail::conversion::convert_point_to_point(point1, point2);
+ }
+ };
+
static inline void apply(Range1 const& source, Range2& destination)
{
+ apply(source, destination, default_policy());
+ }
+
+ template <typename ConvertPointPolicy>
+ static inline ConvertPointPolicy apply(Range1 const& source, Range2& destination,
+ ConvertPointPolicy convert_point)
+ {
geometry::clear(destination);
rview_type rview(source);
@@ -179,8 +197,12 @@ struct range_to_range
it != boost::end(view) && i < n;
++it, ++i)
{
- geometry::append(destination, *it);
+ typename boost::range_value<Range2>::type point;
+ convert_point.apply(*it, point);
+ range::push_back(destination, point);
}
+
+ return convert_point;
}
};