custom_segment.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
  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 GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP
  8. #define GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP
  9. #include <boost/geometry/geometries/register/point.hpp>
  10. #include <boost/geometry/geometries/register/segment.hpp>
  11. #include <boost/geometry/core/tag.hpp>
  12. #include <boost/geometry/core/tags.hpp>
  13. namespace test
  14. {
  15. struct custom_point_for_segment
  16. {
  17. double x, y;
  18. };
  19. struct custom_segment
  20. {
  21. custom_point_for_segment one, two;
  22. };
  23. template <typename P>
  24. struct custom_segment_of
  25. {
  26. P p1, p2;
  27. };
  28. struct custom_segment_4
  29. {
  30. double a, b, c, d;
  31. };
  32. } // namespace test
  33. BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y)
  34. BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two)
  35. BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2)
  36. BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(test::custom_segment_4, test::custom_point_for_segment, a, b, c, d)
  37. #endif // GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP