1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
6 // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
8 // This file was modified by Oracle on 2015-2020.
9 // Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
11 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
12 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
13 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
15 // Distributed under the Boost Software License, Version 1.0.
16 // (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
19 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
20 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP
25 #include <boost/geometry/core/access.hpp>
26 #include <boost/geometry/core/tags.hpp>
28 #include <boost/geometry/util/select_coordinate_type.hpp>
30 #include <boost/geometry/algorithms/detail/envelope/box.hpp>
31 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
32 #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
34 #include <boost/geometry/strategy/expand.hpp>
35 #include <boost/geometry/strategy/spherical/envelope_box.hpp>
36 #include <boost/geometry/strategy/spherical/envelope_segment.hpp>
39 namespace boost { namespace geometry
42 namespace strategy { namespace expand
45 #ifndef DOXYGEN_NO_DETAIL
49 struct segment_on_spheroid
51 template <typename Box, typename Segment, typename Strategy>
52 static inline void apply(Box& box, Segment const& segment, Strategy const& strategy)
56 // compute the envelope of the segment
57 geometry::detail::envelope::envelope_segment::apply(segment, mbrs[0], strategy);
60 strategy::envelope::spherical_box::apply(box, mbrs[1]);
62 // compute the envelope of the two boxes
63 geometry::detail::envelope::envelope_range_of_boxes::apply(mbrs, box);
68 #endif // DOXYGEN_NO_DETAIL
73 typename CalculationType = void
75 class spherical_segment
78 template <typename Box, typename Segment>
79 static inline void apply(Box& box, Segment const& segment)
81 detail::segment_on_spheroid::apply(box, segment,
82 strategy::envelope::spherical_segment<CalculationType>());
87 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
92 template <typename CalculationType>
93 struct default_strategy<segment_tag, spherical_equatorial_tag, CalculationType>
95 typedef spherical_segment<CalculationType> type;
98 template <typename CalculationType>
99 struct default_strategy<segment_tag, spherical_polar_tag, CalculationType>
101 typedef spherical_segment<CalculationType> type;
104 } // namespace services
106 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
109 }} // namespace strategy::expand
111 }} // namespace boost::geometry
113 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP