tags.hpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2014, 2018.
  6. // Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  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. #ifndef BOOST_GEOMETRY_CORE_TAGS_HPP
  14. #define BOOST_GEOMETRY_CORE_TAGS_HPP
  15. namespace boost { namespace geometry
  16. {
  17. // Tags defining strategies linked to coordinate systems
  18. /// Tag used for undefined coordinate system
  19. struct cs_undefined_tag {};
  20. /// Tag used for casting spherical/geographic coordinate systems
  21. struct spherical_tag {};
  22. /// Tag indicating Cartesian coordinate system family (cartesian,epsg)
  23. struct cartesian_tag {};
  24. /// Tag indicating Spherical polar coordinate system family
  25. struct spherical_polar_tag : spherical_tag {};
  26. /// Tag indicating Spherical equatorial coordinate system family
  27. struct spherical_equatorial_tag : spherical_tag {};
  28. /// Tag indicating Geographic coordinate system family (geographic)
  29. struct geographic_tag : spherical_tag {};
  30. // Tags defining coordinate systems reference models
  31. /// For reference spheroid defining parameters of geographical coordinate system
  32. struct srs_spheroid_tag {};
  33. /// For reference sphere defining parameters of spherical coordinate system
  34. struct srs_sphere_tag : srs_spheroid_tag {};
  35. // Tags defining tag hierarchy
  36. /// For single-geometries (point, linestring, polygon, box, ring, segment)
  37. struct single_tag {};
  38. /// For multiple-geometries (multi_point, multi_linestring, multi_polygon)
  39. struct multi_tag {};
  40. /// For point-like types (point, multi_point)
  41. struct pointlike_tag {};
  42. /// For linear types (linestring, multi-linestring, segment)
  43. struct linear_tag {};
  44. /// For areal types (polygon, multi_polygon, box, ring)
  45. struct areal_tag {};
  46. // Subset of areal types (polygon, multi_polygon, ring)
  47. struct polygonal_tag : areal_tag {};
  48. /// For volume types (also box (?), polyhedron)
  49. struct volumetric_tag {};
  50. // Tags defining geometry types
  51. /// "default" tag
  52. struct geometry_not_recognized_tag {};
  53. /// OGC Point identifying tag
  54. struct point_tag : single_tag, pointlike_tag {};
  55. /// OGC Linestring identifying tag
  56. struct linestring_tag : single_tag, linear_tag {};
  57. /// OGC Polygon identifying tag
  58. struct polygon_tag : single_tag, polygonal_tag {};
  59. /// Convenience (linear) ring identifying tag
  60. struct ring_tag : single_tag, polygonal_tag {};
  61. /// Convenience 2D or 3D box (mbr / aabb) identifying tag
  62. struct box_tag : single_tag, areal_tag {};
  63. /// Convenience segment (2-points) identifying tag
  64. struct segment_tag : single_tag, linear_tag {};
  65. /// OGC Multi point identifying tag
  66. struct multi_point_tag : multi_tag, pointlike_tag {};
  67. /// OGC Multi linestring identifying tag
  68. struct multi_linestring_tag : multi_tag, linear_tag {};
  69. /// OGC Multi polygon identifying tag
  70. struct multi_polygon_tag : multi_tag, polygonal_tag {};
  71. /// OGC Geometry Collection identifying tag
  72. struct geometry_collection_tag : multi_tag {};
  73. /*!
  74. \brief Meta-function to get for a tag of a multi-geometry
  75. the tag of the corresponding single-geometry
  76. */
  77. template <typename Tag>
  78. struct single_tag_of
  79. {};
  80. #ifndef DOXYGEN_NO_DETAIL
  81. template <>
  82. struct single_tag_of<multi_point_tag>
  83. {
  84. typedef point_tag type;
  85. };
  86. template <>
  87. struct single_tag_of<multi_linestring_tag>
  88. {
  89. typedef linestring_tag type;
  90. };
  91. template <>
  92. struct single_tag_of<multi_polygon_tag>
  93. {
  94. typedef polygon_tag type;
  95. };
  96. #endif
  97. }} // namespace boost::geometry
  98. #endif // BOOST_GEOMETRY_CORE_TAGS_HPP