Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / geometry / core / tags.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
9
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
13
14 #ifndef BOOST_GEOMETRY_CORE_TAGS_HPP
15 #define BOOST_GEOMETRY_CORE_TAGS_HPP
16
17
18 namespace boost { namespace geometry
19 {
20
21 // Tags defining strategies linked to coordinate systems
22
23 /// Tag used for casting spherical/geographic coordinate systems
24 struct spherical_tag {};
25
26
27 /// Tag indicating Cartesian coordinate system family (cartesian,epsg)
28 struct cartesian_tag {};
29
30 /// Tag indicating Spherical polar coordinate system family
31 struct spherical_polar_tag : spherical_tag {};
32
33 /// Tag indicating Spherical equatorial coordinate system family
34 struct spherical_equatorial_tag : spherical_tag {};
35
36 /// Tag indicating Geographic coordinate system family (geographic)
37 struct geographic_tag : spherical_tag {};
38
39
40
41 // Tags defining tag hierarchy
42
43 /// For single-geometries (point, linestring, polygon, box, ring, segment)
44 struct single_tag {};
45
46
47 /// For multiple-geometries (multi_point, multi_linestring, multi_polygon)
48 struct multi_tag {};
49
50 /// For point-like types (point, multi_point)
51 struct pointlike_tag {};
52
53 /// For linear types (linestring, multi-linestring, segment)
54 struct linear_tag {};
55
56 /// For areal types (polygon, multi_polygon, box, ring)
57 struct areal_tag {};
58
59 // Subset of areal types (polygon, multi_polygon, ring)
60 struct polygonal_tag : areal_tag {};
61
62 /// For volume types (also box (?), polyhedron)
63 struct volumetric_tag {};
64
65
66 // Tags defining geometry types
67
68
69 /// "default" tag
70 struct geometry_not_recognized_tag {};
71
72 /// OGC Point identifying tag
73 struct point_tag : single_tag, pointlike_tag {};
74
75 /// OGC Linestring identifying tag
76 struct linestring_tag : single_tag, linear_tag {};
77
78 /// OGC Polygon identifying tag
79 struct polygon_tag : single_tag, polygonal_tag {};
80
81 /// Convenience (linear) ring identifying tag
82 struct ring_tag : single_tag, polygonal_tag {};
83
84 /// Convenience 2D or 3D box (mbr / aabb) identifying tag
85 struct box_tag : single_tag, areal_tag {};
86
87 /// Convenience segment (2-points) identifying tag
88 struct segment_tag : single_tag, linear_tag {};
89
90
91 /// OGC Multi point identifying tag
92 struct multi_point_tag : multi_tag, pointlike_tag  {};
93
94 /// OGC Multi linestring identifying tag
95 struct multi_linestring_tag : multi_tag, linear_tag {};
96
97 /// OGC Multi polygon identifying tag
98 struct multi_polygon_tag : multi_tag, polygonal_tag {};
99
100 /// OGC Geometry Collection identifying tag
101 struct geometry_collection_tag : multi_tag {};
102
103
104 /*!
105 \brief Meta-function to get for a tag of a multi-geometry
106     the tag of the corresponding single-geometry
107 */
108 template <typename Tag>
109 struct single_tag_of
110 {};
111
112 #ifndef DOXYGEN_NO_DETAIL
113
114 template <>
115 struct single_tag_of<multi_point_tag>
116 {
117     typedef point_tag type;
118 };
119
120 template <>
121 struct single_tag_of<multi_linestring_tag>
122 {
123     typedef linestring_tag type;
124 };
125
126 template <>
127 struct single_tag_of<multi_polygon_tag>
128 {
129     typedef polygon_tag type;
130 };
131
132 #endif
133
134
135 }} // namespace boost::geometry
136
137 #endif // BOOST_GEOMETRY_CORE_TAGS_HPP