1// Boost.Geometry
2
3// Copyright (c) 2017, 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
19#include <boost/mpl/assert.hpp>
20#include <boost/mpl/integral_c.hpp>
21
22
23namespace boost { namespace geometry { namespace strategy
24{
25
26struct andoyer
27{
28 template
29 <
30 typename CT,
31 bool EnableCoordinates = true,
32 bool EnableReverseAzimuth = false,
33 bool EnableReducedLength = false,
34 bool EnableGeodesicScale = false
35 >
36 struct direct
37 : formula::thomas_direct
38 <
39 CT, false,
40 EnableCoordinates, EnableReverseAzimuth,
41 EnableReducedLength, EnableGeodesicScale
42 >
43 {};
44
45 template
46 <
47 typename CT,
48 bool EnableDistance,
49 bool EnableAzimuth,
50 bool EnableReverseAzimuth = false,
51 bool EnableReducedLength = false,
52 bool EnableGeodesicScale = false
53 >
54 struct inverse
55 : formula::andoyer_inverse
56 <
57 CT, EnableDistance,
58 EnableAzimuth, EnableReverseAzimuth,
59 EnableReducedLength, EnableGeodesicScale
60 >
61 {};
62};
63
64struct thomas
65{
66 template
67 <
68 typename CT,
69 bool EnableCoordinates = true,
70 bool EnableReverseAzimuth = false,
71 bool EnableReducedLength = false,
72 bool EnableGeodesicScale = false
73 >
74 struct direct
75 : formula::thomas_direct
76 <
77 CT, true,
78 EnableCoordinates, EnableReverseAzimuth,
79 EnableReducedLength, EnableGeodesicScale
80 >
81 {};
82
83 template
84 <
85 typename CT,
86 bool EnableDistance,
87 bool EnableAzimuth,
88 bool EnableReverseAzimuth = false,
89 bool EnableReducedLength = false,
90 bool EnableGeodesicScale = false
91 >
92 struct inverse
93 : formula::thomas_inverse
94 <
95 CT, EnableDistance,
96 EnableAzimuth, EnableReverseAzimuth,
97 EnableReducedLength, EnableGeodesicScale
98 >
99 {};
100};
101
102struct vincenty
103{
104 template
105 <
106 typename CT,
107 bool EnableCoordinates = true,
108 bool EnableReverseAzimuth = false,
109 bool EnableReducedLength = false,
110 bool EnableGeodesicScale = false
111 >
112 struct direct
113 : formula::vincenty_direct
114 <
115 CT, EnableCoordinates, EnableReverseAzimuth,
116 EnableReducedLength, EnableGeodesicScale
117 >
118 {};
119
120 template
121 <
122 typename CT,
123 bool EnableDistance,
124 bool EnableAzimuth,
125 bool EnableReverseAzimuth = false,
126 bool EnableReducedLength = false,
127 bool EnableGeodesicScale = false
128 >
129 struct inverse
130 : formula::vincenty_inverse
131 <
132 CT, EnableDistance,
133 EnableAzimuth, EnableReverseAzimuth,
134 EnableReducedLength, EnableGeodesicScale
135 >
136 {};
137};
138
139
140template <typename FormulaPolicy>
141struct default_order
142{
143 BOOST_MPL_ASSERT_MSG
144 (
145 false, NOT_IMPLEMENTED_FOR_THIS_TYPE
146 , (types<FormulaPolicy>)
147 );
148};
149
150template<>
151struct default_order<andoyer>
152 : boost::mpl::integral_c<unsigned int, 1>
153{};
154
155template<>
156struct default_order<thomas>
157 : boost::mpl::integral_c<unsigned int, 2>
158{};
159
160template<>
161struct default_order<vincenty>
162 : boost::mpl::integral_c<unsigned int, 4>
163{};
164
165}}} // namespace boost::geometry::strategy
166
167
168#endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
169