File indexing completed on 2025-01-18 09:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP
0022 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP
0023
0024 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
0025 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
0026
0027 #include <boost/geometry/iterators/segment_iterator.hpp>
0028
0029 #include <boost/geometry/strategy/spherical/envelope_box.hpp>
0030 #include <boost/geometry/strategy/spherical/envelope_segment.hpp>
0031 #include <boost/geometry/strategy/spherical/expand_box.hpp>
0032 #include <boost/geometry/strategy/spherical/expand_segment.hpp>
0033
0034 namespace boost { namespace geometry
0035 {
0036
0037 namespace strategy { namespace envelope
0038 {
0039
0040 template <typename CalculationType = void>
0041 class spherical
0042 {
0043 public:
0044 typedef spherical_tag cs_tag;
0045
0046
0047
0048 template <typename Range>
0049 static inline geometry::segment_iterator<Range const> begin(Range const& range)
0050 {
0051 return geometry::segments_begin(range);
0052 }
0053
0054 template <typename Range>
0055 static inline geometry::segment_iterator<Range const> end(Range const& range)
0056 {
0057 return geometry::segments_end(range);
0058 }
0059
0060
0061
0062 template <typename Box>
0063 struct multi_state
0064 {
0065 void apply(Box const& single_box)
0066 {
0067 m_boxes.push_back(single_box);
0068 }
0069
0070 void result(Box & box)
0071 {
0072 if (!m_boxes.empty())
0073 {
0074 geometry::detail::envelope::envelope_range_of_boxes::apply(m_boxes, box);
0075 }
0076 else
0077 {
0078 geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(box);
0079 }
0080 }
0081
0082 private:
0083 std::vector<Box> m_boxes;
0084 };
0085 };
0086
0087 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0088
0089 namespace services
0090 {
0091
0092 template <typename Tag, typename CalculationType>
0093 struct default_strategy<Tag, spherical_equatorial_tag, CalculationType>
0094 {
0095 typedef strategy::envelope::spherical<CalculationType> type;
0096 };
0097
0098 template <typename Tag, typename CalculationType>
0099 struct default_strategy<Tag, spherical_polar_tag, CalculationType>
0100 {
0101 typedef strategy::envelope::spherical<CalculationType> type;
0102 };
0103
0104 }
0105
0106 #endif
0107
0108
0109 }}
0110
0111 }}
0112
0113 #endif