File indexing completed on 2025-07-15 08:33:50
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/geometry/core/access.hpp>
0017 #include <boost/geometry/core/coordinate_dimension.hpp>
0018 #include <boost/geometry/core/coordinate_type.hpp>
0019 #include <boost/geometry/util/bounds.hpp>
0020
0021
0022 namespace boost { namespace geometry
0023 {
0024
0025 #ifndef DOXYGEN_NO_DETAIL
0026 namespace detail { namespace envelope
0027 {
0028
0029 template <std::size_t Dimension, std::size_t DimensionCount>
0030 struct initialize_loop
0031 {
0032 template <typename Box, typename CoordinateType>
0033 static inline void apply(Box& box,
0034 CoordinateType min_value,
0035 CoordinateType max_value)
0036 {
0037 geometry::set<min_corner, Dimension>(box, min_value);
0038 geometry::set<max_corner, Dimension>(box, max_value);
0039
0040 initialize_loop
0041 <
0042 Dimension + 1, DimensionCount
0043 >::apply(box, min_value, max_value);
0044 }
0045 };
0046
0047 template <std::size_t DimensionCount>
0048 struct initialize_loop<DimensionCount, DimensionCount>
0049 {
0050 template <typename Box, typename CoordinateType>
0051 static inline void apply(Box&, CoordinateType, CoordinateType)
0052 {
0053 }
0054 };
0055
0056
0057 template
0058 <
0059 typename Box,
0060 std::size_t Dimension = 0,
0061 std::size_t DimensionCount = dimension<Box>::value
0062 >
0063 struct initialize
0064 {
0065 typedef typename coordinate_type<Box>::type coordinate_type;
0066
0067 static inline void apply(Box& box,
0068 coordinate_type min_value
0069 = util::bounds<coordinate_type>::highest(),
0070 coordinate_type max_value
0071 = util::bounds<coordinate_type>::lowest())
0072 {
0073 initialize_loop
0074 <
0075 Dimension, DimensionCount
0076 >::apply(box, min_value, max_value);
0077 }
0078 };
0079
0080 }}
0081 #endif
0082
0083 }}
0084
0085 #endif