• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // This file was modified by Oracle on 2014, 2018.
8 // Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
9 
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14 
15 // Use, modification and distribution is subject to the Boost Software License,
16 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
18 
19 #ifndef BOOST_GEOMETRY_CORE_TAGS_HPP
20 #define BOOST_GEOMETRY_CORE_TAGS_HPP
21 
22 
23 namespace boost { namespace geometry
24 {
25 
26 // Tags defining strategies linked to coordinate systems
27 
28 /// Tag used for undefined coordinate system
29 struct cs_undefined_tag {};
30 
31 /// Tag used for casting spherical/geographic coordinate systems
32 struct spherical_tag {};
33 
34 
35 /// Tag indicating Cartesian coordinate system family (cartesian,epsg)
36 struct cartesian_tag {};
37 
38 /// Tag indicating Spherical polar coordinate system family
39 struct spherical_polar_tag : spherical_tag {};
40 
41 /// Tag indicating Spherical equatorial coordinate system family
42 struct spherical_equatorial_tag : spherical_tag {};
43 
44 /// Tag indicating Geographic coordinate system family (geographic)
45 struct geographic_tag : spherical_tag {};
46 
47 
48 // Tags defining coordinate systems reference models
49 
50 /// For reference spheroid defining parameters of geographical coordinate system
51 struct srs_spheroid_tag {};
52 
53 /// For reference sphere defining parameters of spherical coordinate system
54 struct srs_sphere_tag : srs_spheroid_tag {};
55 
56 
57 // Tags defining tag hierarchy
58 
59 /// For single-geometries (point, linestring, polygon, box, ring, segment)
60 struct single_tag {};
61 
62 
63 /// For multiple-geometries (multi_point, multi_linestring, multi_polygon)
64 struct multi_tag {};
65 
66 /// For point-like types (point, multi_point)
67 struct pointlike_tag {};
68 
69 /// For linear types (linestring, multi-linestring, segment)
70 struct linear_tag {};
71 
72 /// For areal types (polygon, multi_polygon, box, ring)
73 struct areal_tag {};
74 
75 // Subset of areal types (polygon, multi_polygon, ring)
76 struct polygonal_tag : areal_tag {};
77 
78 /// For volume types (also box (?), polyhedron)
79 struct volumetric_tag {};
80 
81 
82 // Tags defining geometry types
83 
84 
85 /// "default" tag
86 struct geometry_not_recognized_tag {};
87 
88 /// OGC Point identifying tag
89 struct point_tag : single_tag, pointlike_tag {};
90 
91 /// OGC Linestring identifying tag
92 struct linestring_tag : single_tag, linear_tag {};
93 
94 /// OGC Polygon identifying tag
95 struct polygon_tag : single_tag, polygonal_tag {};
96 
97 /// Convenience (linear) ring identifying tag
98 struct ring_tag : single_tag, polygonal_tag {};
99 
100 /// Convenience 2D or 3D box (mbr / aabb) identifying tag
101 struct box_tag : single_tag, areal_tag {};
102 
103 /// Convenience segment (2-points) identifying tag
104 struct segment_tag : single_tag, linear_tag {};
105 
106 
107 /// OGC Multi point identifying tag
108 struct multi_point_tag : multi_tag, pointlike_tag  {};
109 
110 /// OGC Multi linestring identifying tag
111 struct multi_linestring_tag : multi_tag, linear_tag {};
112 
113 /// OGC Multi polygon identifying tag
114 struct multi_polygon_tag : multi_tag, polygonal_tag {};
115 
116 /// OGC Geometry Collection identifying tag
117 struct geometry_collection_tag : multi_tag {};
118 
119 
120 /*!
121 \brief Meta-function to get for a tag of a multi-geometry
122     the tag of the corresponding single-geometry
123 */
124 template <typename Tag>
125 struct single_tag_of
126 {};
127 
128 #ifndef DOXYGEN_NO_DETAIL
129 
130 template <>
131 struct single_tag_of<multi_point_tag>
132 {
133     typedef point_tag type;
134 };
135 
136 template <>
137 struct single_tag_of<multi_linestring_tag>
138 {
139     typedef linestring_tag type;
140 };
141 
142 template <>
143 struct single_tag_of<multi_polygon_tag>
144 {
145     typedef polygon_tag type;
146 };
147 
148 #endif
149 
150 
151 }} // namespace boost::geometry
152 
153 #endif // BOOST_GEOMETRY_CORE_TAGS_HPP
154