common.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_TEST_CS_UNDEFINED_COMMON_HPP
  7. #define BOOST_GEOMETRY_TEST_CS_UNDEFINED_COMMON_HPP
  8. #include <geometry_test_common.hpp>
  9. #include <boost/geometry/geometries/geometries.hpp>
  10. #include <boost/geometry/strategies/strategies.hpp>
  11. #include <boost/geometry/io/wkt/read.hpp>
  12. struct geom
  13. {
  14. //typedef bg::model::point<double, 2, bg::cs::cartesian> point;
  15. typedef bg::model::point<double, 2, bg::cs::undefined> point;
  16. typedef bg::model::box<point> box;
  17. typedef bg::model::segment<point> segment;
  18. typedef bg::model::linestring<point> linestring;
  19. typedef bg::model::ring<point> ring;
  20. typedef bg::model::polygon<point> polygon;
  21. typedef bg::model::multi_linestring<linestring> multi_linestring;
  22. typedef bg::model::multi_polygon<polygon> multi_polygon;
  23. typedef bg::model::multi_point<point> multi_point;
  24. geom()
  25. {
  26. pt = point(0, 0);
  27. b = box(point(-1, -1), point(1, 1));
  28. s = segment(point(0, 0), point(1, 1));
  29. ls.push_back(point(0, 0));
  30. ls.push_back(point(1, 1));
  31. ls.push_back(point(1.1, 1.1));
  32. r.push_back(point(0, 0));
  33. r.push_back(point(0, 1));
  34. r.push_back(point(1, 1));
  35. r.push_back(point(1, 0));
  36. r.push_back(point(0, 0));
  37. po.outer() = r;
  38. po.inners().push_back(ring());
  39. po.inners().back().push_back(point(0, 0));
  40. po.inners().back().push_back(point(0.2, 0.1));
  41. po.inners().back().push_back(point(0.1, 0.2));
  42. po.inners().back().push_back(point(0, 0));
  43. mls.push_back(ls);
  44. mpo.push_back(po);
  45. mpt.push_back(pt);
  46. }
  47. point pt;
  48. box b;
  49. segment s;
  50. linestring ls;
  51. ring r;
  52. polygon po;
  53. multi_linestring mls;
  54. multi_polygon mpo;
  55. multi_point mpt;
  56. };
  57. #endif // BOOST_GEOMETRY_TEST_CS_UNDEFINED_COMMON_HPP