Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:52

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
0007 
0008 // This file was modified by Oracle on 2015-2020.
0009 // Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
0010 
0011 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0012 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0013 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0014 
0015 // Distributed under the Boost Software License, Version 1.0.
0016 // (See accompanying file LICENSE_1_0.txt or copy at
0017 // http://www.boost.org/LICENSE_1_0.txt)
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         // compute the envelope of the segment
0057         geometry::detail::envelope::envelope_segment::apply(segment, mbrs[0], strategy);
0058 
0059         // normalize the box
0060         strategy::envelope::spherical_box::apply(box, mbrs[1]);
0061 
0062         // compute the envelope of the two boxes
0063         geometry::detail::envelope::envelope_range_of_boxes::apply(mbrs, box);
0064     }
0065 };
0066 
0067 } // namespace detail
0068 #endif // DOXYGEN_NO_DETAIL
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 } // namespace services
0105 
0106 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0107 
0108 
0109 }} // namespace strategy::expand
0110 
0111 }} // namespace boost::geometry
0112 
0113 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_EXPAND_SEGMENT_HPP