|
||||
File indexing completed on 2025-01-18 09:36:49
0001 // Boost.Geometry 0002 0003 // Copyright (c) 2019-2020, Oracle and/or its affiliates. 0004 0005 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle 0006 0007 // Licensed under the Boost Software License version 1.0. 0008 // http://www.boost.org/users/license.html 0009 0010 #ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_POINT_ORDER_HPP 0011 #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_POINT_ORDER_HPP 0012 0013 0014 //#include <type_traits> 0015 0016 0017 #include <boost/geometry/core/tags.hpp> 0018 0019 #include <boost/geometry/formulas/spherical.hpp> 0020 0021 #include <boost/geometry/strategy/spherical/area.hpp> 0022 #include <boost/geometry/strategies/spherical/point_in_point.hpp> 0023 #include <boost/geometry/strategies/point_order.hpp> 0024 0025 #include <boost/geometry/util/math.hpp> 0026 #include <boost/geometry/util/select_calculation_type.hpp> 0027 0028 0029 namespace boost { namespace geometry 0030 { 0031 0032 namespace strategy { namespace point_order 0033 { 0034 0035 //template <typename CalculationType = void> 0036 //struct spherical 0037 //{ 0038 // typedef azimuth_tag version_tag; 0039 // 0040 // template <typename Geometry> 0041 // struct result_type 0042 // { 0043 // typedef typename geometry::select_calculation_type_alt 0044 // < 0045 // CalculationType, Geometry 0046 // >::type type; 0047 // }; 0048 // 0049 // template <typename Point> 0050 // inline bool apply(Point const& p1, Point const& p2, 0051 // typename result_type<Point>::type & azi, 0052 // typename result_type<Point>::type & razi) const 0053 // { 0054 // typedef typename result_type<Point>::type calc_t; 0055 // 0056 // if (equals_point_point(p1, p2)) 0057 // { 0058 // return false; 0059 // } 0060 // 0061 // calc_t lon1 = geometry::get_as_radian<0>(p1); 0062 // calc_t lat1 = geometry::get_as_radian<1>(p1); 0063 // calc_t lon2 = geometry::get_as_radian<0>(p2); 0064 // calc_t lat2 = geometry::get_as_radian<1>(p2); 0065 // 0066 // convert_latitudes<Point>(lat1, lat2); 0067 // 0068 // formula::result_spherical<calc_t> 0069 // res = formula::spherical_azimuth<calc_t, true>(lon1, lat1, lon2, lat2); 0070 // 0071 // azi = res.azimuth; 0072 // razi = res.reverse_azimuth; 0073 // 0074 // return true; 0075 // } 0076 // 0077 // template <typename Point> 0078 // inline typename result_type<Point>::type 0079 // apply(Point const& /*p0*/, Point const& /*p1*/, Point const& /*p2*/, 0080 // typename result_type<Point>::type const& azi1, 0081 // typename result_type<Point>::type const& azi2) const 0082 // { 0083 // // TODO: support poles 0084 // return math::longitude_distance_signed<radian>(azi1, azi2); 0085 // } 0086 // 0087 //private: 0088 // template <typename Point> 0089 // static bool equals_point_point(Point const& p0, Point const& p1) 0090 // { 0091 // return strategy::within::spherical_point_point::apply(p0, p1); 0092 // } 0093 // 0094 // template <typename Point, typename CalcT> 0095 // static void convert_latitudes(CalcT & lat1, CalcT & lat2) 0096 // { 0097 // static const bool is_polar = std::is_same 0098 // < 0099 // typename geometry::cs_tag<Point>::type, 0100 // spherical_polar_tag 0101 // >::value; 0102 // 0103 // if (BOOST_GEOMETRY_CONDITION(is_polar)) 0104 // { 0105 // CalcT pi_half = math::half_pi<CalcT>(); 0106 // lat1 = pi_half - lat1; 0107 // lat2 = pi_half - lat2; 0108 // } 0109 // } 0110 //}; 0111 0112 template <typename CalculationType = void> 0113 struct spherical 0114 : strategy::area::spherical<double, CalculationType> 0115 { 0116 typedef area_tag version_tag; 0117 0118 // TEMP 0119 static strategy::area::spherical<double, CalculationType> get_area_strategy() 0120 { 0121 return strategy::area::spherical<double, CalculationType>(); 0122 } 0123 }; 0124 0125 namespace services 0126 { 0127 0128 template <> 0129 struct default_strategy<spherical_equatorial_tag> 0130 { 0131 typedef spherical<> type; 0132 }; 0133 0134 /*template <> 0135 struct default_strategy<spherical_polar_tag> 0136 { 0137 typedef spherical<> type; 0138 };*/ 0139 0140 } // namespace services 0141 0142 }} // namespace strategy::point_order 0143 0144 }} // namespace boost::geometry 0145 0146 #endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_POINT_ORDER_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |