parameters.hpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Boost.Geometry
  2. // Copyright (c) 2017, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
  8. #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
  9. #include <boost/geometry/formulas/andoyer_inverse.hpp>
  10. #include <boost/geometry/formulas/thomas_direct.hpp>
  11. #include <boost/geometry/formulas/thomas_inverse.hpp>
  12. #include <boost/geometry/formulas/vincenty_direct.hpp>
  13. #include <boost/geometry/formulas/vincenty_inverse.hpp>
  14. #include <boost/mpl/assert.hpp>
  15. #include <boost/mpl/integral_c.hpp>
  16. namespace boost { namespace geometry { namespace strategy
  17. {
  18. struct andoyer
  19. {
  20. template
  21. <
  22. typename CT,
  23. bool EnableCoordinates = true,
  24. bool EnableReverseAzimuth = false,
  25. bool EnableReducedLength = false,
  26. bool EnableGeodesicScale = false
  27. >
  28. struct direct
  29. : formula::thomas_direct
  30. <
  31. CT, false,
  32. EnableCoordinates, EnableReverseAzimuth,
  33. EnableReducedLength, EnableGeodesicScale
  34. >
  35. {};
  36. template
  37. <
  38. typename CT,
  39. bool EnableDistance,
  40. bool EnableAzimuth,
  41. bool EnableReverseAzimuth = false,
  42. bool EnableReducedLength = false,
  43. bool EnableGeodesicScale = false
  44. >
  45. struct inverse
  46. : formula::andoyer_inverse
  47. <
  48. CT, EnableDistance,
  49. EnableAzimuth, EnableReverseAzimuth,
  50. EnableReducedLength, EnableGeodesicScale
  51. >
  52. {};
  53. };
  54. struct thomas
  55. {
  56. template
  57. <
  58. typename CT,
  59. bool EnableCoordinates = true,
  60. bool EnableReverseAzimuth = false,
  61. bool EnableReducedLength = false,
  62. bool EnableGeodesicScale = false
  63. >
  64. struct direct
  65. : formula::thomas_direct
  66. <
  67. CT, true,
  68. EnableCoordinates, EnableReverseAzimuth,
  69. EnableReducedLength, EnableGeodesicScale
  70. >
  71. {};
  72. template
  73. <
  74. typename CT,
  75. bool EnableDistance,
  76. bool EnableAzimuth,
  77. bool EnableReverseAzimuth = false,
  78. bool EnableReducedLength = false,
  79. bool EnableGeodesicScale = false
  80. >
  81. struct inverse
  82. : formula::thomas_inverse
  83. <
  84. CT, EnableDistance,
  85. EnableAzimuth, EnableReverseAzimuth,
  86. EnableReducedLength, EnableGeodesicScale
  87. >
  88. {};
  89. };
  90. struct vincenty
  91. {
  92. template
  93. <
  94. typename CT,
  95. bool EnableCoordinates = true,
  96. bool EnableReverseAzimuth = false,
  97. bool EnableReducedLength = false,
  98. bool EnableGeodesicScale = false
  99. >
  100. struct direct
  101. : formula::vincenty_direct
  102. <
  103. CT, EnableCoordinates, EnableReverseAzimuth,
  104. EnableReducedLength, EnableGeodesicScale
  105. >
  106. {};
  107. template
  108. <
  109. typename CT,
  110. bool EnableDistance,
  111. bool EnableAzimuth,
  112. bool EnableReverseAzimuth = false,
  113. bool EnableReducedLength = false,
  114. bool EnableGeodesicScale = false
  115. >
  116. struct inverse
  117. : formula::vincenty_inverse
  118. <
  119. CT, EnableDistance,
  120. EnableAzimuth, EnableReverseAzimuth,
  121. EnableReducedLength, EnableGeodesicScale
  122. >
  123. {};
  124. };
  125. template <typename FormulaPolicy>
  126. struct default_order
  127. {
  128. BOOST_MPL_ASSERT_MSG
  129. (
  130. false, NOT_IMPLEMENTED_FOR_THIS_TYPE
  131. , (types<FormulaPolicy>)
  132. );
  133. };
  134. template<>
  135. struct default_order<andoyer>
  136. : boost::mpl::integral_c<unsigned int, 1>
  137. {};
  138. template<>
  139. struct default_order<thomas>
  140. : boost::mpl::integral_c<unsigned int, 2>
  141. {};
  142. template<>
  143. struct default_order<vincenty>
  144. : boost::mpl::integral_c<unsigned int, 4>
  145. {};
  146. }}} // namespace boost::geometry::strategy
  147. #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP