Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / geometry / strategies / geographic / distance_thomas.hpp
index 39e0ecf..490920c 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
 
-// This file was modified by Oracle on 2015, 2016.
-// Modifications copyright (c) 2015-2016 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2015-2017.
+// Modifications copyright (c) 2015-2017 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_THOMAS_HPP
 
 
-#include <boost/geometry/core/coordinate_type.hpp>
-#include <boost/geometry/core/radian_access.hpp>
+#include <boost/geometry/strategies/geographic/distance.hpp>
+#include <boost/geometry/strategies/geographic/parameters.hpp>
 
-#include <boost/geometry/strategies/distance.hpp>
-
-#include <boost/geometry/util/promote_floating_point.hpp>
-#include <boost/geometry/util/select_calculation_type.hpp>
-
-#include <boost/geometry/formulas/thomas_inverse.hpp>
 
 namespace boost { namespace geometry
 {
@@ -45,57 +39,28 @@ namespace strategy { namespace distance
 */
 template
 <
-    typename Spheroid,
+    typename Spheroid = srs::spheroid<double>,
     typename CalculationType = void
 >
 class thomas
+    : public strategy::distance::geographic
+        <
+            strategy::thomas, Spheroid, CalculationType
+        >
 {
-public :
-    template <typename Point1, typename Point2>
-    struct calculation_type
-        : promote_floating_point
-          <
-              typename select_calculation_type
-                  <
-                      Point1,
-                      Point2,
-                      CalculationType
-                  >::type
-          >
-    {};
-
-    typedef Spheroid model_type;
+    typedef strategy::distance::geographic
+        <
+            strategy::thomas, Spheroid, CalculationType
+        > base_type;
 
+public :
     inline thomas()
-        : m_spheroid()
+        : base_type()
     {}
 
     explicit inline thomas(Spheroid const& spheroid)
-        : m_spheroid(spheroid)
+        : base_type(spheroid)
     {}
-
-    template <typename Point1, typename Point2>
-    inline typename calculation_type<Point1, Point2>::type
-    apply(Point1 const& point1, Point2 const& point2) const
-    {
-        return geometry::formula::thomas_inverse
-                <
-                    typename calculation_type<Point1, Point2>::type,
-                    true, false
-                >::apply(get_as_radian<0>(point1),
-                         get_as_radian<1>(point1),
-                         get_as_radian<0>(point2),
-                         get_as_radian<1>(point2),
-                         m_spheroid).distance;
-    }
-
-    inline Spheroid const& model() const
-    {
-        return m_spheroid;
-    }
-
-private :
-    Spheroid m_spheroid;
 };
 
 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS