File indexing completed on 2025-01-18 09:36:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
0020 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
0021
0022 #include <cstddef>
0023 #include <functional>
0024
0025 #include <boost/geometry/core/access.hpp>
0026 #include <boost/geometry/core/tags.hpp>
0027
0028 #include <boost/geometry/util/select_coordinate_type.hpp>
0029
0030 #include <boost/geometry/algorithms/detail/envelope/box.hpp>
0031 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
0032 #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
0033
0034 #include <boost/geometry/strategy/expand.hpp>
0035 #include <boost/geometry/strategy/spherical/envelope_box.hpp>
0036 #include <boost/geometry/strategy/spherical/envelope_segment.hpp>
0037
0038
0039 namespace boost { namespace geometry
0040 {
0041
0042 namespace strategy { namespace expand
0043 {
0044
0045 #ifndef DOXYGEN_NO_DETAIL
0046 namespace detail
0047 {
0048
0049 struct segment_on_spheroid
0050 {
0051 template <typename Box, typename Segment, typename Strategy>
0052 static inline void apply(Box& box, Segment const& segment, Strategy const& strategy)
0053 {
0054 Box mbrs[2];
0055
0056
0057 geometry::detail::envelope::envelope_segment::apply(segment, mbrs[0], strategy);
0058
0059
0060 strategy::envelope::spherical_box::apply(box, mbrs[1]);
0061
0062
0063 geometry::detail::envelope::envelope_range_of_boxes::apply(mbrs, box);
0064 }
0065 };
0066
0067 }
0068 #endif
0069
0070
0071 template
0072 <
0073 typename CalculationType = void
0074 >
0075 class spherical_segment
0076 {
0077 public:
0078 template <typename Box, typename Segment>
0079 static inline void apply(Box& box, Segment const& segment)
0080 {
0081 detail::segment_on_spheroid::apply(box, segment,
0082 strategy::envelope::spherical_segment<CalculationType>());
0083 }
0084 };
0085
0086
0087 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0088
0089 namespace services
0090 {
0091
0092 template <typename CalculationType>
0093 struct default_strategy<segment_tag, spherical_equatorial_tag, CalculationType>
0094 {
0095 typedef spherical_segment<CalculationType> type;
0096 };
0097
0098 template <typename CalculationType>
0099 struct default_strategy<segment_tag, spherical_polar_tag, CalculationType>
0100 {
0101 typedef spherical_segment<CalculationType> type;
0102 };
0103
0104 }
0105
0106 #endif
0107
0108
0109 }}
0110
0111 }}
0112
0113 #endif