]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategy/spherical/envelope_boxes.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategy / spherical / envelope_boxes.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2021, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
6
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
9
10 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP
11 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP
12
13 #include <vector>
14
15 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
16 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
17
18 namespace boost { namespace geometry
19 {
20
21 namespace strategy { namespace envelope
22 {
23
24 class spherical_boxes
25 {
26 public:
27 template <typename Box>
28 class state
29 {
30 friend spherical_boxes;
31
32 std::vector<Box> m_boxes;
33 };
34
35 template <typename Box>
36 static void apply(state<Box> & st, Box const& box)
37 {
38 st.m_boxes.push_back(box);
39 }
40
41 template <typename Box>
42 static void result(state<Box> const& st, Box & box)
43 {
44 if (! st.m_boxes.empty())
45 {
46 geometry::detail::envelope::envelope_range_of_boxes::apply(st.m_boxes, box);
47 }
48 else
49 {
50 geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(box);
51 }
52 }
53 };
54
55 }} // namespace strategy::envelope
56
57 }} //namepsace boost::geometry
58
59 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP