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 
0007 // This file was modified by Oracle on 2015, 2016, 2018, 2019.
0008 // Modifications copyright (c) 2015-2019, Oracle and/or its affiliates.
0009 
0010 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0011 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0012 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0013 
0014 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0015 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0016 
0017 // Distributed under the Boost Software License, Version 1.0.
0018 // (See accompanying file LICENSE_1_0.txt or copy at
0019 // http://www.boost.org/LICENSE_1_0.txt)
0020 
0021 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP
0022 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP
0023 
0024 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
0025 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
0026 
0027 #include <boost/geometry/iterators/segment_iterator.hpp>
0028 
0029 #include <boost/geometry/strategy/spherical/envelope_box.hpp>
0030 #include <boost/geometry/strategy/spherical/envelope_segment.hpp>
0031 #include <boost/geometry/strategy/spherical/expand_box.hpp>
0032 #include <boost/geometry/strategy/spherical/expand_segment.hpp>
0033 
0034 namespace boost { namespace geometry
0035 {
0036 
0037 namespace strategy { namespace envelope
0038 {
0039 
0040 template <typename CalculationType = void>
0041 class spherical
0042 {
0043 public:
0044     typedef spherical_tag cs_tag;
0045 
0046     // Linestring, Ring, Polygon
0047 
0048     template <typename Range>
0049     static inline geometry::segment_iterator<Range const> begin(Range const& range)
0050     {
0051         return geometry::segments_begin(range);
0052     }
0053 
0054     template <typename Range>
0055     static inline geometry::segment_iterator<Range const> end(Range const& range)
0056     {
0057         return geometry::segments_end(range);
0058     }
0059 
0060     // MultiLinestring, MultiPolygon
0061 
0062     template <typename Box>
0063     struct multi_state
0064     {
0065         void apply(Box const& single_box)
0066         {
0067             m_boxes.push_back(single_box);
0068         }
0069 
0070         void result(Box & box)
0071         {
0072             if (!m_boxes.empty())
0073             {
0074                 geometry::detail::envelope::envelope_range_of_boxes::apply(m_boxes, box);
0075             }
0076             else
0077             {
0078                 geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(box);
0079             }
0080         }
0081 
0082     private:
0083         std::vector<Box> m_boxes;
0084     };
0085 };
0086 
0087 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0088 
0089 namespace services
0090 {
0091 
0092 template <typename Tag, typename CalculationType>
0093 struct default_strategy<Tag, spherical_equatorial_tag, CalculationType>
0094 {
0095     typedef strategy::envelope::spherical<CalculationType> type;
0096 };
0097 
0098 template <typename Tag, typename CalculationType>
0099 struct default_strategy<Tag, spherical_polar_tag, CalculationType>
0100 {
0101     typedef strategy::envelope::spherical<CalculationType> type;
0102 };
0103 
0104 }
0105 
0106 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0107 
0108 
0109 }} // namespace strategy::envelope
0110 
0111 }} //namepsace boost::geometry
0112 
0113 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP