1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
- #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
- #include <cstddef>
- #include <boost/geometry/core/access.hpp>
- #include <boost/geometry/core/coordinate_dimension.hpp>
- #include <boost/geometry/core/coordinate_type.hpp>
- #include <boost/geometry/util/numeric_cast.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail { namespace conversion
- {
- template
- <
- typename Source,
- typename Destination,
- std::size_t Dimension,
- std::size_t DimensionCount
- >
- struct indexed_to_indexed
- {
- static inline void apply(Source const& source, Destination& destination)
- {
- typedef typename coordinate_type<Destination>::type coordinate_type;
- geometry::set<min_corner, Dimension>(destination,
- util::numeric_cast<coordinate_type>(
- geometry::get<min_corner, Dimension>(source)));
- geometry::set<max_corner, Dimension>(destination,
- util::numeric_cast<coordinate_type>(
- geometry::get<max_corner, Dimension>(source)));
- indexed_to_indexed
- <
- Source, Destination,
- Dimension + 1, DimensionCount
- >::apply(source, destination);
- }
- };
- template
- <
- typename Source,
- typename Destination,
- std::size_t DimensionCount
- >
- struct indexed_to_indexed<Source, Destination, DimensionCount, DimensionCount>
- {
- static inline void apply(Source const& , Destination& )
- {}
- };
- }}
- #endif
- }}
- #endif
|