123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
- #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
- #include <cstddef>
- #include <functional>
- #include <boost/geometry/core/access.hpp>
- #include <boost/geometry/core/tags.hpp>
- #include <boost/geometry/util/select_coordinate_type.hpp>
- #include <boost/geometry/algorithms/detail/envelope/box.hpp>
- #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
- #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
- #include <boost/geometry/strategy/expand.hpp>
- #include <boost/geometry/strategy/spherical/envelope_box.hpp>
- #include <boost/geometry/strategy/spherical/envelope_segment.hpp>
- namespace boost { namespace geometry
- {
- namespace strategy { namespace expand
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
- struct segment_on_spheroid
- {
- template <typename Box, typename Segment, typename Strategy>
- static inline void apply(Box& box, Segment const& segment, Strategy const& strategy)
- {
- Box mbrs[2];
-
- geometry::detail::envelope::envelope_segment::apply(segment, mbrs[0], strategy);
-
- strategy::envelope::spherical_box::apply(box, mbrs[1]);
-
- geometry::detail::envelope::envelope_range_of_boxes::apply(mbrs, box);
- }
- };
- }
- #endif
- template
- <
- typename CalculationType = void
- >
- class spherical_segment
- {
- public:
- template <typename Box, typename Segment>
- static inline void apply(Box& box, Segment const& segment)
- {
- detail::segment_on_spheroid::apply(box, segment,
- strategy::envelope::spherical_segment<CalculationType>());
- }
- };
- #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
- namespace services
- {
- template <typename CalculationType>
- struct default_strategy<segment_tag, spherical_equatorial_tag, CalculationType>
- {
- typedef spherical_segment<CalculationType> type;
- };
- template <typename CalculationType>
- struct default_strategy<segment_tag, spherical_polar_tag, CalculationType>
- {
- typedef spherical_segment<CalculationType> type;
- };
- }
- #endif
- }}
- }}
- #endif
|