File indexing completed on 2025-12-15 09:50:23
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/geometry/core/access.hpp>
0025 #include <boost/geometry/core/coordinate_type.hpp>
0026 #include <boost/geometry/geometries/concepts/check.hpp>
0027 #include <boost/geometry/util/algorithm.hpp>
0028 #include <boost/geometry/util/numeric_cast.hpp>
0029
0030
0031 namespace boost { namespace geometry
0032 {
0033
0034 #ifndef DOXYGEN_NO_DETAIL
0035 namespace detail
0036 {
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 template <std::size_t Index, typename Geometry, typename Point>
0054 inline void assign_point_to_index(Point const& point, Geometry& geometry)
0055 {
0056 concepts::check<Point const>();
0057 concepts::check<Geometry>();
0058
0059 detail::for_each_dimension<Geometry>([&](auto dimension)
0060 {
0061 geometry::set<Index, dimension>(geometry,
0062 util::numeric_cast<coordinate_type_t<Geometry>>(geometry::get<dimension>(point)));
0063 });
0064 }
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 template <std::size_t Index, typename Point, typename Geometry>
0083 inline void assign_point_from_index(Geometry const& geometry, Point& point)
0084 {
0085 concepts::check<Geometry const>();
0086 concepts::check<Point>();
0087
0088 detail::for_each_dimension<Geometry>([&](auto dimension)
0089 {
0090 geometry::set<dimension>(point,
0091 util::numeric_cast
0092 <
0093 coordinate_type_t<Point>
0094 >(geometry::get<Index, dimension>(geometry)));
0095 });
0096 }
0097
0098
0099 }
0100 #endif
0101
0102
0103 }}
0104
0105
0106 #endif