Moved convert to detail::convert

Removed deprecated file copy.hpp

[SVN r71117]
This commit is contained in:
Barend Gehrels
2011-04-08 14:49:49 +00:00
parent 85f1994a42
commit 2e024cff21
28 changed files with 77 additions and 162 deletions

View File

@@ -51,7 +51,7 @@ struct append_point
int = 0, int = 0)
{
typename geometry::point_type<Geometry>::type copy;
geometry::detail::convert::convert_point_to_point(point, copy);
geometry::detail::conversion::convert_point_to_point(point, copy);
traits::push_back<Geometry>::apply(geometry, copy);
}
};

View File

@@ -28,7 +28,7 @@
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/distance.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/strategies/centroid.hpp>
@@ -83,7 +83,7 @@ struct centroid_point
static inline void apply(Point const& point, PointCentroid& centroid,
Strategy const&)
{
geometry::convert(point, centroid);
geometry::detail::convert(point, centroid);
}
};
@@ -163,7 +163,7 @@ inline bool range_ok(Range const& range, Point& centroid)
else // if (n == 1)
{
// Take over the first point in a "coordinate neutral way"
geometry::convert(*boost::begin(range), centroid);
geometry::detail::convert(*boost::begin(range), centroid);
return false;
}
return true;

View File

@@ -11,8 +11,8 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP
#define BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP
#include <cstddef>
@@ -33,7 +33,7 @@ namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace convert
namespace detail { namespace conversion
{
template
@@ -75,7 +75,7 @@ struct point_to_box<Point, Box, Index, DimensionCount, DimensionCount>
};
}} // namespace detail::convert
}} // namespace detail::conversion
#endif // DOXYGEN_NO_DETAIL
@@ -117,7 +117,7 @@ template
typename Geometry1, typename Geometry2
>
struct convert<point_tag, point_tag, DimensionCount, Geometry1, Geometry2>
: detail::convert::point_to_point<Geometry1, Geometry2, 0, DimensionCount>
: detail::conversion::point_to_point<Geometry1, Geometry2, 0, DimensionCount>
{};
@@ -186,11 +186,11 @@ struct convert<point_tag, box_tag, DimensionCount, Point, Box>
{
static inline void apply(Point const& point, Box& box)
{
detail::convert::point_to_box
detail::conversion::point_to_box
<
Point, Box, min_corner, 0, DimensionCount
>::apply(point, box);
detail::convert::point_to_box
detail::conversion::point_to_box
<
Point, Box, max_corner, 0, DimensionCount
>::apply(point, box);
@@ -232,6 +232,11 @@ struct convert<polygon_tag, ring_tag, DimensionCount, Polygon, Ring>
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
#ifndef DOXYGEN_NO_DETAIL
namespace detail
{
/*!
\brief Converts one geometry to another geometry
\details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only
@@ -241,6 +246,8 @@ if it is possible and applicable.
\tparam Geometry2 \tparam_geometry
\param geometry1 \param_geometry (source)
\param geometry2 \param_geometry (target)
\note It is moved to namespace detail because it overlaps functionality
of assign. So assign will be changed such that it also can convert.
*/
template <typename Geometry1, typename Geometry2>
inline void convert(Geometry1 const& geometry1, Geometry2& geometry2)
@@ -257,8 +264,11 @@ inline void convert(Geometry1 const& geometry1, Geometry2& geometry2)
>::apply(geometry1, geometry2);
}
}
#endif // DOXYGEN_NO_DETAIL
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP

View File

@@ -28,7 +28,7 @@ namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace convert
namespace detail { namespace conversion
{
@@ -60,7 +60,7 @@ inline void convert_point_to_point(Source const& source, Destination& destinatio
}} // namespace detail::convert
}} // namespace detail::conversion
#endif // DOXYGEN_NO_DETAIL
}} // namespace boost::geometry

View File

@@ -13,7 +13,7 @@
#include <boost/geometry/algorithms/append.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>
#include <boost/geometry/geometries/segment.hpp>
@@ -181,8 +181,8 @@ OutputIterator clip_range_with_box(Box const& b, Range const& range,
++previous, ++vertex)
{
point_type p1, p2;
geometry::convert(*previous, p1);
geometry::convert(*vertex, p2);
geometry::detail::convert(*previous, p1);
geometry::detail::convert(*vertex, p2);
// Clip the segment. Five situations:
// 1. Segment is invisible, finish line if any (shouldn't occur)

View File

@@ -19,7 +19,7 @@
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
namespace boost { namespace geometry
@@ -50,7 +50,7 @@ struct convert_ring<ring_tag>
{
if (! append)
{
geometry::convert(source, destination);
geometry::detail::convert(source, destination);
if (reverse)
{
boost::reverse(destination);
@@ -69,7 +69,7 @@ struct convert_ring<polygon_tag>
{
if (! append)
{
geometry::convert(source, exterior_ring(destination));
geometry::detail::convert(source, exterior_ring(destination));
if (reverse)
{
boost::reverse(exterior_ring(destination));
@@ -79,7 +79,7 @@ struct convert_ring<polygon_tag>
{
interior_rings(destination).resize(
interior_rings(destination).size() + 1);
geometry::convert(source, interior_rings(destination).back());
geometry::detail::convert(source, interior_rings(destination).back());
if (reverse)
{
boost::reverse(interior_rings(destination).back());

View File

@@ -17,7 +17,7 @@
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
@@ -71,7 +71,7 @@ struct copy_segment_point_range
rview_type view(cview);
geometry::convert(*(boost::begin(view) + index), point);
geometry::detail::convert(*(boost::begin(view) + index), point);
return true;
}
};

View File

@@ -12,7 +12,7 @@
#include <cstddef>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
@@ -64,7 +64,7 @@ struct get_turn_without_info
{
TurnInfo tp;
geometry::convert(result.template get<0>().intersections[i], tp.point);
geometry::detail::convert(result.template get<0>().intersections[i], tp.point);
*out++ = tp;
}

View File

@@ -14,7 +14,7 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/strategies/intersection.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
@@ -94,7 +94,7 @@ struct touch_interior : public base_turn_handler
DirInfo const& dir_info)
{
ti.method = method_touch_interior;
geometry::convert(intersection_info.intersections[0], ti.point);
geometry::detail::convert(intersection_info.intersections[0], ti.point);
// Both segments of q touch segment p somewhere in its interior
// 1) We know: if q comes from LEFT or RIGHT
@@ -213,7 +213,7 @@ struct touch : public base_turn_handler
DirInfo const& dir_info)
{
ti.method = method_touch;
geometry::convert(intersection_info.intersections[0], ti.point);
geometry::detail::convert(intersection_info.intersections[0], ti.point);
int const side_qi_p1 = dir_info.sides.template get<1, 0>();
int const side_qk_p1 = SideStrategy::apply(pi, pj, qk);
@@ -376,7 +376,7 @@ struct touch : public base_turn_handler
<< " qk " << get<0>(qk) << " , " << get<1>(qk)
<< std::endl;
#endif
}
};
@@ -404,7 +404,7 @@ struct equal : public base_turn_handler
{
ti.method = method_equal;
// Copy the SECOND intersection point
geometry::convert(intersection_info.intersections[1], ti.point);
geometry::detail::convert(intersection_info.intersections[1], ti.point);
int const side_pk_q2 = SideStrategy::apply(qj, qk, pk);
int const side_pk_p = SideStrategy::apply(pi, pj, pk);
@@ -486,7 +486,7 @@ struct collinear : public base_turn_handler
DirInfo const& dir_info)
{
ti.method = method_collinear;
geometry::convert(intersection_info.intersections[1], ti.point);
geometry::detail::convert(intersection_info.intersections[1], ti.point);
int const arrival = dir_info.arrival[0];
// Should not be 0, this is checked before
@@ -585,7 +585,7 @@ private :
// If P arrives within Q, set info on P (which is done above, index=0),
// this turn-info belongs to the second intersection point, index=1
// (see e.g. figure CLO1)
geometry::convert(intersection_info.intersections[1 - Index], tp.point);
geometry::detail::convert(intersection_info.intersections[1 - Index], tp.point);
return true;
}
@@ -661,7 +661,7 @@ struct crosses : public base_turn_handler
DirInfo const& dir_info)
{
ti.method = method_crosses;
geometry::convert(intersection_info.intersections[0], ti.point);
geometry::detail::convert(intersection_info.intersections[0], ti.point);
// In all casees:
// If Q crosses P from left to right
@@ -877,7 +877,7 @@ struct get_turn_info
#ifdef BOOST_GEOMETRY_DEBUG_GET_TURNS
std::cout << "get_turns, nyi: " << method << std::endl;
#endif
break;
break;
}
return out;

View File

@@ -21,7 +21,7 @@
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/clip_linestring.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
@@ -65,7 +65,7 @@ struct intersection_segment_segment_point
for (std::size_t i = 0; i < is.count; i++)
{
PointOut p;
geometry::convert(is.intersections[i], p);
geometry::detail::convert(is.intersections[i], p);
*out++ = p;
}
return out;
@@ -95,7 +95,7 @@ struct intersection_linestring_linestring_point
it = boost::begin(turns); it != boost::end(turns); ++it)
{
PointOut p;
geometry::convert(it->point, p);
geometry::detail::convert(it->point, p);
*out++ = p;
}
return out;

View File

@@ -19,7 +19,6 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/expand.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/exterior_ring.hpp>

View File

@@ -32,7 +32,7 @@
#include <boost/geometry/strategies/concepts/simplify_concept.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/num_interior_rings.hpp>
@@ -181,7 +181,7 @@ struct simplify<point_tag, Point, Strategy>
static inline void apply(Point const& point, Point& out,
Distance const& max_distance, Strategy const& strategy)
{
geometry::convert(point, out);
geometry::detail::convert(point, out);
}
};

View File

@@ -78,7 +78,7 @@ struct radian_access
}
};
// Specialize, any "degree" coordinate system will convert to radian
// Specialize, any "degree" coordinate system will be converted to radian
// but only for dimension 0,1 (so: dimension 2 and heigher are untouched)
template

View File

@@ -24,7 +24,7 @@
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
@@ -199,7 +199,7 @@ struct wkt_box
// Convert to ring, then stream
typedef model::ring<point_type> ring_type;
ring_type ring;
geometry::convert(box, ring);
geometry::detail::convert(box, ring);
os << "POLYGON(";
wkt_sequence<ring_type>::apply(os, ring);
os << ")";

View File

@@ -21,7 +21,7 @@ namespace detail { namespace buffer
{
// TODO: once convert this to proper strategy
// TODO: once change this to proper strategy
// It is different from current segment intersection because these are not segments but lines
// If we have the Line concept, we can create a strategy
template <typename Point, typename Line1, typename Line2 = Line1>

View File

@@ -33,7 +33,7 @@
#include <boost/geometry/algorithms/detail/overlay/ring_properties.hpp>
#include <boost/geometry/algorithms/detail/overlay/select_rings.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -134,7 +134,7 @@ struct dissolve_ring_or_polygon
else
{
GeometryOut g;
geometry::convert(geometry, g);
geometry::detail::convert(geometry, g);
*out++ = g;
return out;
}

View File

@@ -25,9 +25,6 @@
#include <boost/geometry/geometries/concepts/point_concept.hpp>
#include <boost/geometry/algorithms/convert.hpp>
namespace boost { namespace geometry
{

View File

@@ -13,7 +13,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/extensions/gis/projections/factory.hpp>
#include <boost/geometry/extensions/gis/projections/parameters.hpp>

View File

@@ -13,7 +13,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/extensions/gis/projections/factory.hpp>
#include <boost/geometry/extensions/gis/projections/parameters.hpp>

View File

@@ -17,7 +17,7 @@
#include <cstddef>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
@@ -63,7 +63,7 @@ public:
nsphere(P const& center, T const& radius)
: m_radius(radius)
{
geometry::convert(center, m_center);
geometry::detail::convert(center, m_center);
}
inline P const& center() const { return m_center; }

View File

@@ -16,7 +16,7 @@
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/arithmetic/dot_product.hpp>
#include <boost/geometry/core/cs.hpp>
@@ -51,7 +51,7 @@ struct join_round2
static inline Vector create_vector(Point1 const& p1, Point2 const& p2)
{
Vector v;
geometry::convert(p1, v);
geometry::detail::convert(p1, v);
subtract_point(v, p2);
return v;
}
@@ -111,7 +111,7 @@ struct join_round2
PointOut projected_point;
multiply_value(v, b);
geometry::convert(vertex, projected_point);
geometry::detail::convert(vertex, projected_point);
add_point(projected_point, v);
coordinate_type projected_distance = geometry::distance(projected_point, mid_point);

View File

@@ -18,7 +18,7 @@
#include <boost/concept/assert.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
@@ -57,8 +57,8 @@ public:
*/
inline box(Point const& min_corner, Point const& max_corner)
{
geometry::convert(min_corner, m_min_corner);
geometry::convert(max_corner, m_max_corner);
geometry::detail::convert(min_corner, m_min_corner);
geometry::detail::convert(max_corner, m_max_corner);
}
inline Point const& min_corner() const { return m_min_corner; }

View File

@@ -40,7 +40,6 @@
#include <boost/geometry/algorithms/buffer.hpp>
#include <boost/geometry/algorithms/centroid.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/convex_hull.hpp>
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/difference.hpp>

View File

@@ -20,7 +20,6 @@
#include <boost/range.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/strategies/distance.hpp>

View File

@@ -22,7 +22,7 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/arithmetic/dot_product.hpp>
@@ -132,8 +132,8 @@ public :
// For consistency we define w also in FP
fp_vector_type v, w;
geometry::convert(p2, v);
geometry::convert(p, w);
geometry::detail::convert(p2, v);
geometry::detail::convert(p, w);
subtract_point(v, p1);
subtract_point(w, p1);
@@ -163,7 +163,7 @@ public :
>::apply(strategy);
fp_point_type projected;
geometry::convert(p1, projected);
geometry::detail::convert(p1, projected);
multiply_value(v, b);
add_point(projected, v);

View File

@@ -20,7 +20,7 @@
#include <boost/numeric/conversion/cast.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@@ -104,7 +104,7 @@ struct copy_per_coordinate
// Defensive check, dimensions are equal, selected by specialization
assert_dimension_equal<P1, P2>();
geometry::convert(p1, p2);
geometry::detail::convert(p1, p2);
return true;
}
};
@@ -312,14 +312,14 @@ struct default_strategy<CoordSysTag, CoordSysTag, CoordSys, CoordSys, D, D, P1,
typedef copy_per_coordinate<P1, P2> type;
};
/// Specialization to convert from degree to radian for any coordinate system / point type combination
/// Specialization to transform from degree to radian for any coordinate system / point type combination
template <typename CoordSysTag, template<typename> class CoordSys, typename P1, typename P2>
struct default_strategy<CoordSysTag, CoordSysTag, CoordSys<degree>, CoordSys<radian>, 2, 2, P1, P2>
{
typedef degree_radian_vv<P1, P2, std::multiplies> type;
};
/// Specialization to convert from radian to degree for any coordinate system / point type combination
/// Specialization to transform from radian to degree for any coordinate system / point type combination
template <typename CoordSysTag, template<typename> class CoordSys, typename P1, typename P2>
struct default_strategy<CoordSysTag, CoordSysTag, CoordSys<radian>, CoordSys<degree>, 2, 2, P1, P2>
{
@@ -341,28 +341,28 @@ struct default_strategy<CoordSysTag, CoordSysTag, CoordSys<radian>, CoordSys<deg
typedef degree_radian_vv_3<P1, P2, std::divides> type;
};
/// Specialization to convert from unit sphere(phi,theta) to XYZ
/// Specialization to transform from unit sphere(phi,theta) to XYZ
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 2, 3, P1, P2>
{
typedef from_spherical_2_to_cartesian_3<P1, P2> type;
};
/// Specialization to convert from sphere(phi,theta,r) to XYZ
/// Specialization to transform from sphere(phi,theta,r) to XYZ
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
{
typedef from_spherical_3_to_cartesian_3<P1, P2> type;
};
/// Specialization to convert from XYZ to unit sphere(phi,theta)
/// Specialization to transform from XYZ to unit sphere(phi,theta)
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 2, P1, P2>
{
typedef from_cartesian_3_to_spherical_2<P1, P2> type;
};
/// Specialization to convert from XYZ to sphere(phi,theta,r)
/// Specialization to transform from XYZ to sphere(phi,theta,r)
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
{

View File

@@ -1,87 +0,0 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_UTIL_COPY_HPP
#define BOOST_GEOMETRY_UTIL_COPY_HPP
#if defined(BOOST_MSVC_FULL_VER)
#pragma message ("copy_coordinates is deprecated. Use 'convert'")
#else
#warning "copy_coordinates is deprecated. Use 'convert'"
#endif
#include <cstddef>
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
#include <boost/numeric/conversion/cast.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace copy
{
template <typename Src, typename Dst, std::size_t D, std::size_t N>
struct copy_coordinates
{
static inline void copy(Src const& source, Dst& dest)
{
typedef typename coordinate_type<Dst>::type coordinate_type;
set<D>(dest, boost::numeric_cast<coordinate_type>(get<D>(source)));
copy_coordinates<Src, Dst, D + 1, N>::copy(source, dest);
}
};
template <typename Src, typename Dst, std::size_t N>
struct copy_coordinates<Src, Dst, N, N>
{
static inline void copy(Src const& , Dst& )
{
}
};
}} // namespace detail::copy
#endif // DOXYGEN_NO_DETAIL
// Deprecated!
// This is the same as "convert", but this is specific to point, convert is more generic
template <typename Src, typename Dst>
inline void copy_coordinates(Src const& source, Dst& dest)
{
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<Src>) );
BOOST_CONCEPT_ASSERT( (concept::Point<Dst>) );
//assert_dimension_equal<Dst, Src>();
detail::copy::copy_coordinates
<
Src,
Dst,
0,
dimension<Src>::type::value
>::copy(source, dest);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_UTIL_COPY_HPP

View File

@@ -23,8 +23,6 @@
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>