Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-03 08:15:38

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