Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:51

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2021, Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0006 
0007 // Licensed under the Boost Software License version 1.0.
0008 // http://www.boost.org/users/license.html
0009 
0010 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP
0011 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP
0012 
0013 #include <vector>
0014 
0015 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
0016 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
0017 
0018 namespace boost { namespace geometry
0019 {
0020 
0021 namespace strategy { namespace envelope
0022 {
0023 
0024 class spherical_boxes
0025 {
0026 public:
0027     template <typename Box>
0028     class state
0029     {
0030         friend spherical_boxes;
0031 
0032         std::vector<Box> m_boxes;
0033     };
0034 
0035     template <typename Box>
0036     static void apply(state<Box> & st, Box const& box)
0037     {
0038         st.m_boxes.push_back(box);
0039     }
0040 
0041     template <typename Box>
0042     static void result(state<Box> const& st, Box & box)
0043     {
0044         if (! st.m_boxes.empty())
0045         {
0046             geometry::detail::envelope::envelope_range_of_boxes::apply(st.m_boxes, box);
0047         }
0048         else
0049         {
0050             geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(box);
0051         }
0052     }
0053 };
0054 
0055 }} // namespace strategy::envelope
0056 
0057 }} //namepsace boost::geometry
0058 
0059 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_BOXES_HPP