Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / geometry / strategies / cartesian / io.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2019, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
6
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
9
10 #ifndef BOOST_GEOMETRY_EXTENSIONS_STRATEGIES_CARTESIAN_IO_HPP
11 #define BOOST_GEOMETRY_EXTENSIONS_STRATEGIES_CARTESIAN_IO_HPP
12
13
14 #include <boost/geometry/strategies/io.hpp>
15
16 #include <boost/geometry/strategies/cartesian/point_order.hpp>
17 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
18
19
20 namespace boost { namespace geometry
21 {
22
23 namespace strategy { namespace io
24 {
25
26 template <typename CalculationType = void>
27 struct cartesian
28 {
29     typedef strategy::point_order::cartesian<CalculationType> point_order_strategy_type;
30     
31     static inline point_order_strategy_type get_point_order_strategy()
32     {
33         return point_order_strategy_type();
34     }
35
36     template <typename Geometry1, typename Geometry2>
37     struct point_in_geometry_strategy
38     {
39         typedef strategy::within::cartesian_winding
40             <
41                 typename point_type<Geometry1>::type,
42                 typename point_type<Geometry2>::type,
43                 CalculationType
44             > type;
45     };
46
47     template <typename Geometry1, typename Geometry2>
48     static inline typename point_in_geometry_strategy<Geometry1, Geometry2>::type
49         get_point_in_geometry_strategy()
50     {
51         typedef typename point_in_geometry_strategy
52             <
53                 Geometry1, Geometry2
54             >::type strategy_type;
55         return strategy_type();
56     }
57 };
58
59 namespace services
60 {
61
62 template <>
63 struct default_strategy<cartesian_tag>
64 {
65     typedef cartesian<> type;
66 };
67
68 } // namespace services
69
70 }} // namespace strategy::io
71
72 }} // namespace boost::geometry
73
74 #endif // BOOST_GEOMETRY_EXTENSIONS_STRATEGIES_CARTESIAN_IO_HPP