io.hpp 1.8 KB

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