123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_INDEXED_POINT_HPP
- #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_INDEXED_POINT_HPP
- #include <cstddef>
- #include <boost/geometry/core/access.hpp>
- #include <boost/geometry/core/coordinate_type.hpp>
- #include <boost/geometry/geometries/concepts/check.hpp>
- #include <boost/geometry/util/algorithm.hpp>
- #include <boost/geometry/util/numeric_cast.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
- template <std::size_t Index, typename Geometry, typename Point>
- inline void assign_point_to_index(Point const& point, Geometry& geometry)
- {
- concepts::check<Point const>();
- concepts::check<Geometry>();
- detail::for_each_dimension<Geometry>([&](auto dimension)
- {
- geometry::set<Index, dimension>(geometry,
- util::numeric_cast
- <
- typename coordinate_type<Geometry>::type
- >(geometry::get<dimension>(point)));
- });
- }
- template <std::size_t Index, typename Point, typename Geometry>
- inline void assign_point_from_index(Geometry const& geometry, Point& point)
- {
- concepts::check<Geometry const>();
- concepts::check<Point>();
- detail::for_each_dimension<Geometry>([&](auto dimension)
- {
- geometry::set<dimension>(point,
- util::numeric_cast
- <
- typename coordinate_type<Point>::type
- >(geometry::get<Index, dimension>(geometry)));
- });
- }
- }
- #endif
- }}
- #endif
|