File indexing completed on 2025-01-18 09:35:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_INDEXED_POINT_HPP
0019 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_INDEXED_POINT_HPP
0020
0021
0022 #include <cstddef>
0023
0024 #include <boost/numeric/conversion/cast.hpp>
0025
0026 #include <boost/geometry/core/access.hpp>
0027 #include <boost/geometry/core/coordinate_type.hpp>
0028 #include <boost/geometry/geometries/concepts/check.hpp>
0029 #include <boost/geometry/util/algorithm.hpp>
0030
0031
0032 namespace boost { namespace geometry
0033 {
0034
0035 #ifndef DOXYGEN_NO_DETAIL
0036 namespace detail
0037 {
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 template <std::size_t Index, typename Geometry, typename Point>
0055 inline void assign_point_to_index(Point const& point, Geometry& geometry)
0056 {
0057 concepts::check<Point const>();
0058 concepts::check<Geometry>();
0059
0060 detail::for_each_dimension<Geometry>([&](auto dimension)
0061 {
0062 geometry::set<Index, dimension>(geometry,
0063 boost::numeric_cast
0064 <
0065 typename coordinate_type<Geometry>::type
0066 >(geometry::get<dimension>(point)));
0067 });
0068 }
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 template <std::size_t Index, typename Point, typename Geometry>
0087 inline void assign_point_from_index(Geometry const& geometry, Point& point)
0088 {
0089 concepts::check<Geometry const>();
0090 concepts::check<Point>();
0091
0092 detail::for_each_dimension<Geometry>([&](auto dimension)
0093 {
0094 geometry::set<dimension>(point,
0095 boost::numeric_cast
0096 <
0097 typename coordinate_type<Point>::type
0098 >(geometry::get<Index, dimension>(geometry)));
0099 });
0100 }
0101
0102
0103 }
0104 #endif
0105
0106
0107 }}
0108
0109
0110 #endif