3 // Copyright (c) 2019-2020, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_STRATEGIES_IO_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_IO_CARTESIAN_HPP
14 #include <boost/geometry/strategies/detail.hpp>
15 #include <boost/geometry/strategies/io/services.hpp>
17 #include <boost/geometry/strategies/cartesian/point_order.hpp>
18 #include <boost/geometry/strategies/cartesian/point_in_point.hpp>
19 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
22 namespace boost { namespace geometry
25 namespace strategies { namespace io
28 template <typename CalculationType = void>
30 : public strategies::detail::cartesian_base
33 static auto point_order()
35 return strategy::point_order::cartesian<CalculationType>();
38 template <typename Geometry1, typename Geometry2>
39 static auto relate(Geometry1 const&, Geometry2 const&,
42 util::is_pointlike<Geometry1>::value
43 && util::is_pointlike<Geometry2>::value
46 return strategy::within::cartesian_point_point();
49 template <typename Geometry1, typename Geometry2>
50 static auto relate(Geometry1 const&, Geometry2 const&,
53 util::is_pointlike<Geometry1>::value
54 && ( util::is_linear<Geometry2>::value
55 || util::is_polygonal<Geometry2>::value )
58 return strategy::within::cartesian_winding<void, void, CalculationType>();
65 template <typename Geometry>
66 struct default_strategy<Geometry, cartesian_tag>
68 typedef cartesian<> type;
71 } // namespace services
73 }} // namespace strategies::io
75 }} // namespace boost::geometry
77 #endif // BOOST_GEOMETRY_STRATEGIES_IO_CARTESIAN_HPP