Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / geometry / strategies / geographic / parameters.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2017-2019, Oracle and/or its affiliates.
4 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
5
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9
10 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
12
13 #include <boost/geometry/formulas/andoyer_inverse.hpp>
14 #include <boost/geometry/formulas/thomas_direct.hpp>
15 #include <boost/geometry/formulas/thomas_inverse.hpp>
16 #include <boost/geometry/formulas/vincenty_direct.hpp>
17 #include <boost/geometry/formulas/vincenty_inverse.hpp>
18 //#include <boost/geometry/formulas/karney_direct.hpp>
19 //#include <boost/geometry/formulas/karney_inverse.hpp>
20
21 #include <boost/mpl/assert.hpp>
22 #include <boost/mpl/integral_c.hpp>
23
24
25 namespace boost { namespace geometry { namespace strategy
26 {
27
28 struct andoyer
29 {
30     template
31     <
32         typename CT,
33         bool EnableCoordinates = true,
34         bool EnableReverseAzimuth = false,
35         bool EnableReducedLength = false,
36         bool EnableGeodesicScale = false
37     >
38     struct direct
39             : formula::thomas_direct
40               <
41                   CT, false,
42                   EnableCoordinates, EnableReverseAzimuth,
43                   EnableReducedLength, EnableGeodesicScale
44               >
45     {};
46
47     template
48     <
49         typename CT,
50         bool EnableDistance,
51         bool EnableAzimuth,
52         bool EnableReverseAzimuth = false,
53         bool EnableReducedLength = false,
54         bool EnableGeodesicScale = false
55     >
56     struct inverse
57         : formula::andoyer_inverse
58             <
59                 CT, EnableDistance,
60                 EnableAzimuth, EnableReverseAzimuth,
61                 EnableReducedLength, EnableGeodesicScale
62             >
63     {};
64 };
65
66 struct thomas
67 {
68     template
69     <
70         typename CT,
71         bool EnableCoordinates = true,
72         bool EnableReverseAzimuth = false,
73         bool EnableReducedLength = false,
74         bool EnableGeodesicScale = false
75     >
76     struct direct
77             : formula::thomas_direct
78               <
79                   CT, true,
80                   EnableCoordinates, EnableReverseAzimuth,
81                   EnableReducedLength, EnableGeodesicScale
82               >
83     {};
84
85     template
86     <
87         typename CT,
88         bool EnableDistance,
89         bool EnableAzimuth,
90         bool EnableReverseAzimuth = false,
91         bool EnableReducedLength = false,
92         bool EnableGeodesicScale = false
93     >
94     struct inverse
95         : formula::thomas_inverse
96             <
97                 CT, EnableDistance,
98                 EnableAzimuth, EnableReverseAzimuth,
99                 EnableReducedLength, EnableGeodesicScale
100             >
101     {};
102 };
103
104 struct vincenty
105 {
106     template
107     <
108         typename CT,
109         bool EnableCoordinates = true,
110         bool EnableReverseAzimuth = false,
111         bool EnableReducedLength = false,
112         bool EnableGeodesicScale = false
113     >
114     struct direct
115             : formula::vincenty_direct
116               <
117                   CT, EnableCoordinates, EnableReverseAzimuth,
118                   EnableReducedLength, EnableGeodesicScale
119               >
120     {};
121
122     template
123     <
124         typename CT,
125         bool EnableDistance,
126         bool EnableAzimuth,
127         bool EnableReverseAzimuth = false,
128         bool EnableReducedLength = false,
129         bool EnableGeodesicScale = false
130     >
131     struct inverse
132         : formula::vincenty_inverse
133             <
134                 CT, EnableDistance,
135                 EnableAzimuth, EnableReverseAzimuth,
136                 EnableReducedLength, EnableGeodesicScale
137             >
138     {};
139 };
140 /*
141 struct karney
142 {
143     template
144     <
145         typename CT,
146         bool EnableCoordinates = true,
147         bool EnableReverseAzimuth = false,
148         bool EnableReducedLength = false,
149         bool EnableGeodesicScale = false,
150         size_t SeriesOrder = 8
151     >
152     struct direct
153             : formula::karney_direct
154               <
155                   CT, EnableCoordinates, EnableReverseAzimuth,
156                   EnableReducedLength, EnableGeodesicScale,
157                   SeriesOrder
158               >
159     {};
160
161     template
162     <
163         typename CT,
164         bool EnableDistance,
165         bool EnableAzimuth,
166         bool EnableReverseAzimuth = false,
167         bool EnableReducedLength = false,
168         bool EnableGeodesicScale = false,
169         size_t SeriesOrder = 8
170     >
171     struct inverse
172         : formula::karney_inverse
173             <
174                 CT, EnableDistance,
175                 EnableAzimuth, EnableReverseAzimuth,
176                 EnableReducedLength, EnableGeodesicScale,
177                 SeriesOrder
178             >
179     {};
180 };
181 */
182 template <typename FormulaPolicy>
183 struct default_order
184 {
185     BOOST_MPL_ASSERT_MSG
186     (
187         false, NOT_IMPLEMENTED_FOR_THIS_TYPE
188         , (types<FormulaPolicy>)
189     );
190 };
191
192 template<>
193 struct default_order<andoyer>
194     : boost::mpl::integral_c<unsigned int, 1>
195 {};
196
197 template<>
198 struct default_order<thomas>
199     : boost::mpl::integral_c<unsigned int, 2>
200 {};
201
202 template<>
203 struct default_order<vincenty>
204     : boost::mpl::integral_c<unsigned int, 4>
205 {};
206 /*
207 template<>
208 struct default_order<karney>
209     : boost::mpl::integral_c<unsigned int, 8>
210 {};
211 */
212
213 }}} // namespace boost::geometry::strategy
214
215
216 #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP