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 #ifndef BOOST_GEOMETRY_STRATEGY_GEOGRAPHIC_EXPAND_SEGMENT_HPP
0020 #define BOOST_GEOMETRY_STRATEGY_GEOGRAPHIC_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/algorithms/detail/envelope/box.hpp>
0029 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
0030 #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
0031
0032 #include <boost/geometry/srs/spheroid.hpp>
0033
0034 #include <boost/geometry/strategy/expand.hpp>
0035 #include <boost/geometry/strategy/geographic/envelope_segment.hpp>
0036 #include <boost/geometry/strategies/geographic/parameters.hpp>
0037 #include <boost/geometry/strategy/spherical/expand_segment.hpp>
0038
0039
0040 namespace boost { namespace geometry
0041 {
0042
0043 namespace strategy { namespace expand
0044 {
0045
0046 template
0047 <
0048 typename FormulaPolicy = strategy::andoyer,
0049 typename Spheroid = geometry::srs::spheroid<double>,
0050 typename CalculationType = void
0051 >
0052 class geographic_segment
0053 {
0054 public:
0055 inline geographic_segment()
0056 : m_envelope_strategy()
0057 {}
0058
0059 explicit inline geographic_segment(Spheroid const& spheroid)
0060 : m_envelope_strategy(spheroid)
0061 {}
0062
0063 template <typename Box, typename Segment>
0064 inline void apply(Box& box, Segment const& segment) const
0065 {
0066 detail::segment_on_spheroid::apply(box, segment, m_envelope_strategy);
0067 }
0068
0069 Spheroid model() const
0070 {
0071 return m_envelope_strategy.model();
0072 }
0073
0074 private:
0075 strategy::envelope::geographic_segment
0076 <
0077 FormulaPolicy, Spheroid, CalculationType
0078 > m_envelope_strategy;
0079 };
0080
0081
0082 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0083
0084 namespace services
0085 {
0086
0087 template <typename CalculationType>
0088 struct default_strategy<segment_tag, geographic_tag, CalculationType>
0089 {
0090 typedef geographic_segment
0091 <
0092 strategy::andoyer,
0093 geometry::srs::spheroid<double>,
0094 CalculationType
0095 > type;
0096 };
0097
0098 }
0099
0100 #endif
0101
0102
0103 }}
0104
0105 }}
0106
0107 #endif