point_well_formed_non_cartesian.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright (c) 2014, Oracle and/or its affiliates.
  4. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  5. // Licensed under the Boost Software License version 1.0.
  6. // http://www.boost.org/users/license.html
  7. #include <test_geometries/custom_lon_lat_point.hpp>
  8. #include <boost/geometry/core/cs.hpp>
  9. #include <boost/geometry/geometries/point.hpp>
  10. #include <boost/geometry/geometries/concepts/check.hpp>
  11. namespace bg = boost::geometry;
  12. template <typename CoordinateSystem>
  13. inline void test_coordinate_system()
  14. {
  15. typedef bg::model::point<double, 2, CoordinateSystem> bg_double_point;
  16. typedef bg::model::point<int, 2, CoordinateSystem> bg_int_point;
  17. typedef rw_lon_lat_point<double, CoordinateSystem> rw_double_point;
  18. typedef ro_lon_lat_point<double, CoordinateSystem> ro_double_point;
  19. typedef rw_lon_lat_point<int, CoordinateSystem> rw_int_point;
  20. typedef ro_lon_lat_point<int, CoordinateSystem> ro_int_point;
  21. bg::concepts::check<bg_int_point>();
  22. bg::concepts::check<bg_int_point const>();
  23. bg::concepts::check<bg_double_point>();
  24. bg::concepts::check<bg_double_point const>();
  25. bg::concepts::check<rw_int_point>();
  26. bg::concepts::check<rw_int_point const>();
  27. bg::concepts::check<ro_int_point const>();
  28. bg::concepts::check<rw_double_point>();
  29. bg::concepts::check<rw_double_point const>();
  30. bg::concepts::check<ro_double_point const>();
  31. }
  32. int main()
  33. {
  34. test_coordinate_system<bg::cs::geographic<bg::degree> >();
  35. test_coordinate_system<bg::cs::geographic<bg::radian> >();
  36. test_coordinate_system<bg::cs::spherical<bg::degree> >();
  37. test_coordinate_system<bg::cs::spherical<bg::radian> >();
  38. test_coordinate_system<bg::cs::spherical_equatorial<bg::degree> >();
  39. test_coordinate_system<bg::cs::spherical_equatorial<bg::radian> >();
  40. test_coordinate_system<bg::cs::polar<bg::degree> >();
  41. test_coordinate_system<bg::cs::polar<bg::radian> >();
  42. return 0;
  43. }