File indexing completed on 2025-01-18 09:35:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_BOX_CORNERS_HPP
0015 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ASSIGN_BOX_CORNERS_HPP
0016
0017
0018 #include <cstddef>
0019
0020 #include <boost/geometry/geometries/concepts/check.hpp>
0021 #include <boost/geometry/algorithms/detail/assign_values.hpp>
0022 #include <boost/geometry/util/range.hpp>
0023
0024
0025 namespace boost { namespace geometry
0026 {
0027
0028 #ifndef DOXYGEN_NO_DETAIL
0029 namespace detail
0030 {
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 template <typename Box, typename Point>
0053 inline void assign_box_corners(Box const& box,
0054 Point& lower_left, Point& lower_right,
0055 Point& upper_left, Point& upper_right)
0056 {
0057 concepts::check<Box const>();
0058 concepts::check<Point>();
0059
0060 detail::assign::assign_box_2d_corner
0061 <min_corner, min_corner>(box, lower_left);
0062 detail::assign::assign_box_2d_corner
0063 <max_corner, min_corner>(box, lower_right);
0064 detail::assign::assign_box_2d_corner
0065 <min_corner, max_corner>(box, upper_left);
0066 detail::assign::assign_box_2d_corner
0067 <max_corner, max_corner>(box, upper_right);
0068 }
0069
0070
0071 #if defined(_MSC_VER)
0072 #pragma warning(push)
0073 #pragma warning(disable : 4127)
0074 #endif
0075
0076
0077 template <bool Reverse, typename Box, typename Range>
0078 inline void assign_box_corners_oriented(Box const& box, Range& corners)
0079 {
0080 if (Reverse)
0081 {
0082
0083 assign_box_corners(box,
0084 range::at(corners, 0), range::at(corners, 1),
0085 range::at(corners, 3), range::at(corners, 2));
0086 }
0087 else
0088 {
0089
0090 assign_box_corners(box,
0091 range::at(corners, 0), range::at(corners, 3),
0092 range::at(corners, 1), range::at(corners, 2));
0093 }
0094 }
0095 #if defined(_MSC_VER)
0096 #pragma warning(pop)
0097 #endif
0098
0099
0100 }
0101 #endif
0102
0103
0104 }}
0105
0106
0107 #endif