Back to home page

EIC code displayed by LXR

 
 

    


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

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, 2016, 2017, 2018.
0009 // Modifications copyright (c) 2015-2018, 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_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 } // namespace services
0099 
0100 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0101 
0102 
0103 }} // namespace strategy::expand
0104 
0105 }} // namespace boost::geometry
0106 
0107 #endif // BOOST_GEOMETRY_STRATEGY_GEOGRAPHIC_EXPAND_SEGMENT_HPP