proj4.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Boost.Geometry
  2. // Copyright (c) 2017, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_PROJ4_HPP
  8. #define BOOST_GEOMETRY_SRS_PROJECTIONS_PROJ4_HPP
  9. #include <string>
  10. #include <boost/tuple/tuple.hpp>
  11. namespace boost { namespace geometry { namespace srs
  12. {
  13. struct dynamic {};
  14. struct proj4
  15. {
  16. explicit proj4(const char* s)
  17. : str(s)
  18. {}
  19. explicit proj4(std::string const& s)
  20. : str(s)
  21. {}
  22. std::string str;
  23. };
  24. template
  25. <
  26. // null_type -> void?
  27. typename P0 = boost::tuples::null_type,
  28. typename P1 = boost::tuples::null_type,
  29. typename P2 = boost::tuples::null_type,
  30. typename P3 = boost::tuples::null_type,
  31. typename P4 = boost::tuples::null_type,
  32. typename P5 = boost::tuples::null_type,
  33. typename P6 = boost::tuples::null_type,
  34. typename P7 = boost::tuples::null_type,
  35. typename P8 = boost::tuples::null_type,
  36. typename P9 = boost::tuples::null_type
  37. >
  38. struct static_proj4
  39. : boost::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>
  40. {
  41. typedef boost::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> base_type;
  42. static_proj4()
  43. {}
  44. explicit static_proj4(P0 const& p0)
  45. : base_type(p0)
  46. {}
  47. static_proj4(P0 const& p0, P1 const& p1)
  48. : base_type(p0, p1)
  49. {}
  50. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2)
  51. : base_type(p0, p1, p2)
  52. {}
  53. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3)
  54. : base_type(p0, p1, p2, p3)
  55. {}
  56. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4)
  57. : base_type(p0, p1, p2, p3, p4)
  58. {}
  59. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4, P5 const& p5)
  60. : base_type(p0, p1, p2, p3, p4, p5)
  61. {}
  62. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4, P5 const& p5, P6 const& p6)
  63. : base_type(p0, p1, p2, p3, p4, p5, p6)
  64. {}
  65. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4, P5 const& p5, P6 const& p6, P7 const& p7)
  66. : base_type(p0, p1, p2, p3, p4, p5, p6, p7)
  67. {}
  68. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4, P5 const& p5, P6 const& p6, P7 const& p7, P8 const& p8)
  69. : base_type(p0, p1, p2, p3, p4, p5, p6, p7, p8)
  70. {}
  71. static_proj4(P0 const& p0, P1 const& p1, P2 const& p2, P3 const& p3, P4 const& p4, P5 const& p5, P6 const& p6, P7 const& p7, P8 const& p8, P9 const& p9)
  72. : base_type(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)
  73. {}
  74. };
  75. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_TYPENAME_PX \
  76. typename P0, typename P1, typename P2, typename P3, typename P4, \
  77. typename P5, typename P6, typename P7, typename P8, typename P9
  78. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_PX \
  79. P0, P1, P2, P3, P4, P5, P6, P7, P8, P9
  80. }}} // namespace boost::geometry::srs
  81. #ifndef DOXYGEN_NO_DETAIL
  82. namespace boost { namespace geometry { namespace projections { namespace detail
  83. {
  84. template<typename R> struct function_argument_type;
  85. template<typename R, typename A> struct function_argument_type<R(A)> { typedef A type; };
  86. }}}} // namespace boost::geometry::projections::detail
  87. #endif // DOXYGEN_NO_DETAIL
  88. #endif // BOOST_GEOMETRY_SRS_PROJECTIONS_PROJ4_HPP