Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:17

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0008 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
0016 
0017 
0018 #include <cstddef>
0019 
0020 #include <boost/numeric/conversion/cast.hpp>
0021 #include <boost/geometry/core/access.hpp>
0022 #include <boost/geometry/core/coordinate_dimension.hpp>
0023 #include <boost/geometry/core/coordinate_type.hpp>
0024 
0025 
0026 namespace boost { namespace geometry
0027 {
0028 
0029 #ifndef DOXYGEN_NO_DETAIL
0030 namespace detail { namespace conversion
0031 {
0032 
0033 
0034 template
0035 <
0036     typename Source,
0037     typename Destination,
0038     std::size_t Dimension,
0039     std::size_t DimensionCount
0040 >
0041 struct indexed_to_indexed
0042 {
0043     static inline void apply(Source const& source, Destination& destination)
0044     {
0045         typedef typename coordinate_type<Destination>::type coordinate_type;
0046 
0047         geometry::set<min_corner, Dimension>(destination,
0048             boost::numeric_cast<coordinate_type>(
0049                 geometry::get<min_corner, Dimension>(source)));
0050         geometry::set<max_corner, Dimension>(destination,
0051             boost::numeric_cast<coordinate_type>(
0052                 geometry::get<max_corner, Dimension>(source)));
0053 
0054         indexed_to_indexed
0055             <
0056                 Source, Destination,
0057                 Dimension + 1, DimensionCount
0058             >::apply(source, destination);
0059     }
0060 };
0061 
0062 template
0063 <
0064     typename Source,
0065     typename Destination,
0066     std::size_t DimensionCount
0067 >
0068 struct indexed_to_indexed<Source, Destination, DimensionCount, DimensionCount>
0069 {
0070     static inline void apply(Source const& , Destination& )
0071     {}
0072 };
0073 
0074 
0075 }} // namespace detail::conversion
0076 #endif // DOXYGEN_NO_DETAIL
0077 
0078 }} // namespace boost::geometry
0079 
0080 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP