]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | // Boost.Geometry |
2 | ||
3 | // Copyright (c) 2021, Oracle and/or its affiliates. | |
4 | ||
5 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle | |
6 | ||
7 | // Licensed under the Boost Software License version 1.0. | |
8 | // http://www.boost.org/users/license.html | |
9 | ||
10 | #ifndef BOOST_GEOMETRY_CORE_GEOMETRY_TYPES_HPP | |
11 | #define BOOST_GEOMETRY_CORE_GEOMETRY_TYPES_HPP | |
12 | ||
13 | #include <boost/range/value_type.hpp> | |
14 | ||
15 | #include <boost/geometry/core/static_assert.hpp> | |
16 | #include <boost/geometry/core/tag.hpp> | |
17 | #include <boost/geometry/core/tags.hpp> | |
18 | ||
19 | namespace boost { namespace geometry | |
20 | { | |
21 | ||
22 | namespace traits | |
23 | { | |
24 | ||
25 | // DynamicGeometry or GeometryCollection | |
26 | template <typename Geometry> | |
27 | struct geometry_types; | |
28 | ||
29 | } // namespace traits | |
30 | ||
31 | #ifndef DOXYGEN_NO_DISPATCH | |
32 | namespace traits_dispatch | |
33 | { | |
34 | ||
35 | template <typename Geometry, typename Tag = typename geometry::tag<Geometry>::type> | |
36 | struct geometry_types | |
37 | { | |
38 | BOOST_GEOMETRY_STATIC_ASSERT_FALSE( | |
39 | "Not implemented for this Geometry type.", | |
40 | Geometry); | |
41 | }; | |
42 | ||
43 | // By default treat GeometryCollection as a range of DynamicGeometries | |
44 | template <typename Geometry> | |
45 | struct geometry_types<Geometry, geometry_collection_tag> | |
46 | : traits::geometry_types<typename boost::range_value<Geometry>::type> | |
47 | {}; | |
48 | ||
49 | } // namespace traits_dispatch | |
50 | #endif // DOXYGEN_NO_DISPATCH | |
51 | ||
52 | namespace traits | |
53 | { | |
54 | ||
55 | // DynamicGeometry or GeometryCollection | |
56 | template <typename Geometry> | |
57 | struct geometry_types | |
58 | : traits_dispatch::geometry_types<Geometry> | |
59 | {}; | |
60 | ||
61 | } // namespace traits | |
62 | ||
63 | }} // namespace boost::geometry | |
64 | ||
65 | #endif // BOOST_GEOMETRY_CORE_GEOMETRY_TYPES_HPP |