File indexing completed on 2025-01-18 09:35:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_INITIALIZE_HPP
0012 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_INITIALIZE_HPP
0013
0014 #include <cstddef>
0015
0016 #include <boost/numeric/conversion/bounds.hpp>
0017
0018 #include <boost/geometry/core/access.hpp>
0019 #include <boost/geometry/core/coordinate_dimension.hpp>
0020 #include <boost/geometry/core/coordinate_type.hpp>
0021
0022
0023 namespace boost { namespace geometry
0024 {
0025
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail { namespace envelope
0028 {
0029
0030 template <std::size_t Dimension, std::size_t DimensionCount>
0031 struct initialize_loop
0032 {
0033 template <typename Box, typename CoordinateType>
0034 static inline void apply(Box& box,
0035 CoordinateType min_value,
0036 CoordinateType max_value)
0037 {
0038 geometry::set<min_corner, Dimension>(box, min_value);
0039 geometry::set<max_corner, Dimension>(box, max_value);
0040
0041 initialize_loop
0042 <
0043 Dimension + 1, DimensionCount
0044 >::apply(box, min_value, max_value);
0045 }
0046 };
0047
0048 template <std::size_t DimensionCount>
0049 struct initialize_loop<DimensionCount, DimensionCount>
0050 {
0051 template <typename Box, typename CoordinateType>
0052 static inline void apply(Box&, CoordinateType, CoordinateType)
0053 {
0054 }
0055 };
0056
0057
0058 template
0059 <
0060 typename Box,
0061 std::size_t Dimension = 0,
0062 std::size_t DimensionCount = dimension<Box>::value
0063 >
0064 struct initialize
0065 {
0066 typedef typename coordinate_type<Box>::type coordinate_type;
0067
0068 static inline void apply(Box& box,
0069 coordinate_type min_value
0070 = boost::numeric::bounds<coordinate_type>::highest(),
0071 coordinate_type max_value
0072 = boost::numeric::bounds<coordinate_type>::lowest())
0073 {
0074 initialize_loop
0075 <
0076 Dimension, DimensionCount
0077 >::apply(box, min_value, max_value);
0078 }
0079 };
0080
0081 }}
0082 #endif
0083
0084 }}
0085
0086 #endif