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_POINT_TO_POINT_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_POINT_TO_POINT_HPP
0016
0017
0018
0019 #include <cstddef>
0020
0021 #include <boost/numeric/conversion/cast.hpp>
0022 #include <boost/geometry/core/access.hpp>
0023 #include <boost/geometry/core/coordinate_dimension.hpp>
0024 #include <boost/geometry/core/coordinate_type.hpp>
0025
0026
0027 namespace boost { namespace geometry
0028 {
0029
0030 #ifndef DOXYGEN_NO_DETAIL
0031 namespace detail { namespace conversion
0032 {
0033
0034
0035
0036
0037
0038
0039
0040
0041 template <typename Source, typename Destination, std::size_t Dimension, std::size_t DimensionCount>
0042 struct point_to_point
0043 {
0044 static inline void apply(Source const& source, Destination& destination)
0045 {
0046 typedef typename coordinate_type<Destination>::type coordinate_type;
0047
0048 set<Dimension>(destination, boost::numeric_cast<coordinate_type>(get<Dimension>(source)));
0049 point_to_point<Source, Destination, Dimension + 1, DimensionCount>::apply(source, destination);
0050 }
0051 };
0052
0053 template <typename Source, typename Destination, std::size_t DimensionCount>
0054 struct point_to_point<Source, Destination, DimensionCount, DimensionCount>
0055 {
0056 static inline void apply(Source const& , Destination& )
0057 {}
0058 };
0059
0060
0061 template <typename Source, typename Destination>
0062 inline void convert_point_to_point(Source const& source, Destination& destination)
0063 {
0064 point_to_point<Source, Destination, 0, dimension<Destination>::value>::apply(source, destination);
0065 }
0066
0067
0068
0069 }}
0070 #endif
0071
0072 }}
0073
0074 #endif