1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
14 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
15 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
20 #include <boost/numeric/conversion/cast.hpp>
21 #include <boost/geometry/core/access.hpp>
22 #include <boost/geometry/core/coordinate_dimension.hpp>
23 #include <boost/geometry/core/coordinate_type.hpp>
26 namespace boost { namespace geometry
29 #ifndef DOXYGEN_NO_DETAIL
30 namespace detail { namespace conversion
38 std::size_t Dimension,
39 std::size_t DimensionCount
41 struct indexed_to_indexed
43 static inline void apply(Source const& source, Destination& destination)
45 typedef typename coordinate_type<Destination>::type coordinate_type;
47 geometry::set<min_corner, Dimension>(destination,
48 boost::numeric_cast<coordinate_type>(
49 geometry::get<min_corner, Dimension>(source)));
50 geometry::set<max_corner, Dimension>(destination,
51 boost::numeric_cast<coordinate_type>(
52 geometry::get<max_corner, Dimension>(source)));
57 Dimension + 1, DimensionCount
58 >::apply(source, destination);
66 std::size_t DimensionCount
68 struct indexed_to_indexed<Source, Destination, DimensionCount, DimensionCount>
70 static inline void apply(Source const& , Destination& )
75 }} // namespace detail::conversion
76 #endif // DOXYGEN_NO_DETAIL
78 }} // namespace boost::geometry
80 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP