setop_output_type.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2016, 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_SETOP_OUTPUT_TYPE_HPP
  7. #define BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP
  8. #include <vector>
  9. #include <boost/geometry/core/tags.hpp>
  10. #include <boost/geometry/core/tag.hpp>
  11. #include <boost/geometry/geometries/geometries.hpp>
  12. template <typename Single, typename Tag = typename bg::tag<Single>::type>
  13. struct setop_output_type
  14. {
  15. typedef std::vector<Single> type;
  16. };
  17. template <typename Polygon>
  18. struct setop_output_type<Polygon, bg::polygon_tag>
  19. {
  20. typedef bg::model::multi_polygon<Polygon> type;
  21. };
  22. template <typename Linestring>
  23. struct setop_output_type<Linestring, bg::linestring_tag>
  24. {
  25. typedef bg::model::multi_linestring<Linestring> type;
  26. };
  27. template <typename Point>
  28. struct setop_output_type<Point, bg::point_tag>
  29. {
  30. typedef bg::model::multi_point<Point> type;
  31. };
  32. #endif // BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP