File indexing completed on 2025-01-18 09:35:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
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 }}
0076 #endif
0077
0078 }}
0079
0080 #endif