File indexing completed on 2025-01-18 09:36:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_IO_SPHERICAL_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_IO_SPHERICAL_HPP
0012
0013
0014 #include <boost/geometry/strategies/detail.hpp>
0015 #include <boost/geometry/strategies/io/services.hpp>
0016
0017 #include <boost/geometry/strategies/spherical/point_order.hpp>
0018 #include <boost/geometry/strategies/spherical/point_in_point.hpp>
0019 #include <boost/geometry/strategies/spherical/point_in_poly_winding.hpp>
0020
0021
0022 namespace boost { namespace geometry
0023 {
0024
0025 namespace strategies { namespace io
0026 {
0027
0028 template <typename CalculationType = void>
0029 class spherical
0030 : public strategies::detail::spherical_base<void>
0031 {
0032 public:
0033 static auto point_order()
0034 {
0035 return strategy::point_order::spherical<CalculationType>();
0036 }
0037
0038 template <typename Geometry1, typename Geometry2>
0039 static auto relate(Geometry1 const&, Geometry2 const&,
0040 std::enable_if_t
0041 <
0042 util::is_pointlike<Geometry1>::value
0043 && util::is_pointlike<Geometry2>::value
0044 > * = nullptr)
0045 {
0046 return strategy::within::spherical_point_point();
0047 }
0048
0049 template <typename Geometry1, typename Geometry2>
0050 static auto relate(Geometry1 const&, Geometry2 const&,
0051 std::enable_if_t
0052 <
0053 util::is_pointlike<Geometry1>::value
0054 && ( util::is_linear<Geometry2>::value
0055 || util::is_polygonal<Geometry2>::value )
0056 > * = nullptr)
0057 {
0058 return strategy::within::spherical_winding<void, void, CalculationType>();
0059 }
0060 };
0061
0062 namespace services
0063 {
0064
0065 template <typename Geometry>
0066 struct default_strategy<Geometry, spherical_tag>
0067 {
0068 typedef spherical<> type;
0069 };
0070
0071 template <typename Geometry>
0072 struct default_strategy<Geometry, spherical_equatorial_tag>
0073 {
0074 typedef spherical<> type;
0075 };
0076
0077 template <typename Geometry>
0078 struct default_strategy<Geometry, spherical_polar_tag>
0079 {
0080 typedef spherical<> type;
0081 };
0082
0083 }
0084
0085 }}
0086
0087 }}
0088
0089 #endif