Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / geometry / algorithms / detail / envelope / linear.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
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
7 // This file was modified by Oracle on 2015, 2016.
8 // Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
9
10 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
11 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12
13 // Distributed under the Boost Software License, Version 1.0.
14 // (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
16
17 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP
18 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP
19
20 #include <boost/geometry/core/cs.hpp>
21 #include <boost/geometry/core/tags.hpp>
22
23 #include <boost/geometry/iterators/segment_iterator.hpp>
24
25 #include <boost/geometry/algorithms/detail/envelope/range.hpp>
26
27 #include <boost/geometry/algorithms/dispatch/envelope.hpp>
28
29
30 namespace boost { namespace geometry
31 {
32
33 #ifndef DOXYGEN_NO_DETAIL
34 namespace detail { namespace envelope
35 {
36
37
38 struct envelope_linestring_on_spheroid
39 {
40     template <typename Linestring, typename Box, typename Strategy>
41     static inline void apply(Linestring const& linestring,
42                              Box& mbr,
43                              Strategy const& strategy)
44     {
45         envelope_range::apply(geometry::segments_begin(linestring),
46                               geometry::segments_end(linestring),
47                               mbr,
48                               strategy);
49     }
50 };
51
52
53 }} // namespace detail::envelope
54 #endif // DOXYGEN_NO_DETAIL
55
56
57 #ifndef DOXYGEN_NO_DISPATCH
58 namespace dispatch
59 {
60
61
62 template <typename Linestring, typename CS_Tag>
63 struct envelope<Linestring, linestring_tag, CS_Tag>
64     : detail::envelope::envelope_range
65 {};
66
67 template <typename Linestring>
68 struct envelope<Linestring, linestring_tag, spherical_equatorial_tag>
69     : detail::envelope::envelope_linestring_on_spheroid
70 {};
71
72 template <typename Linestring>
73 struct envelope<Linestring, linestring_tag, geographic_tag>
74     : detail::envelope::envelope_linestring_on_spheroid
75 {};
76
77
78 template <typename MultiLinestring, typename CS_Tag>
79 struct envelope
80     <
81         MultiLinestring, multi_linestring_tag, CS_Tag
82     > : detail::envelope::envelope_multi_range
83         <
84             detail::envelope::envelope_range
85         >
86 {};
87
88 template <typename MultiLinestring>
89 struct envelope
90     <
91         MultiLinestring, multi_linestring_tag, spherical_equatorial_tag
92     > : detail::envelope::envelope_multi_range_on_spheroid
93         <
94             detail::envelope::envelope_linestring_on_spheroid
95         >
96 {};
97
98 template <typename MultiLinestring>
99 struct envelope
100     <
101         MultiLinestring, multi_linestring_tag, geographic_tag
102     > : detail::envelope::envelope_multi_range_on_spheroid
103         <
104             detail::envelope::envelope_linestring_on_spheroid
105         >
106 {};
107
108 } // namespace dispatch
109 #endif // DOXYGEN_NO_DISPATCH
110
111
112 }} // namespace boost::geometry
113
114 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_LINEAR_HPP