1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | |
3 | // Copyright (c) 2016, Oracle and/or its affiliates. |
4 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle |
5 | |
6 | // Licensed under the Boost Software License version 1.0. |
7 | // http://www.boost.org/users/license.html |
8 | |
9 | #ifndef BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP |
10 | #define BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP |
11 | |
12 | #include <vector> |
13 | |
14 | #include <boost/geometry/core/tags.hpp> |
15 | #include <boost/geometry/core/tag.hpp> |
16 | |
17 | #include <boost/geometry/geometries/geometries.hpp> |
18 | |
19 | template <typename Single, typename Tag = typename bg::tag<Single>::type> |
20 | struct setop_output_type |
21 | { |
22 | typedef std::vector<Single> type; |
23 | }; |
24 | |
25 | template <typename Polygon> |
26 | struct setop_output_type<Polygon, bg::polygon_tag> |
27 | { |
28 | typedef bg::model::multi_polygon<Polygon> type; |
29 | }; |
30 | |
31 | template <typename Linestring> |
32 | struct setop_output_type<Linestring, bg::linestring_tag> |
33 | { |
34 | typedef bg::model::multi_linestring<Linestring> type; |
35 | }; |
36 | |
37 | template <typename Point> |
38 | struct setop_output_type<Point, bg::point_tag> |
39 | { |
40 | typedef bg::model::multi_point<Point> type; |
41 | }; |
42 | |
43 | #endif // BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP |
44 | |