Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-05 09:18:04

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0004 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 // Copyright (c) 2024 Adam Wulkiewicz, Lodz, Poland.
0007 
0008 // This file was modified by Oracle on 2020.
0009 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 
0012 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0013 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0014 
0015 // Use, modification and distribution is subject to the Boost Software License,
0016 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0017 // http://www.boost.org/LICENSE_1_0.txt)
0018 
0019 #ifndef BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
0020 #define BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
0021 
0022 
0023 #include <boost/geometry/core/point_type.hpp>
0024 #include <boost/geometry/core/static_assert.hpp>
0025 #include <boost/geometry/util/type_traits_std.hpp>
0026 
0027 
0028 namespace boost { namespace geometry
0029 {
0030 
0031 
0032 namespace traits
0033 {
0034 
0035 /*!
0036 \brief Traits class defining the coordinate system of a point, important for strategy selection
0037 \ingroup traits
0038 \par Geometries:
0039     - point
0040 \par Specializations should provide:
0041     - typedef CS type; (cs::cartesian, cs::spherical, etc)
0042 */
0043 template <typename Point, typename Enable = void>
0044 struct coordinate_system
0045 {
0046     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0047         "Not implemented for this Point type.",
0048         Point);
0049 };
0050 
0051 } // namespace traits
0052 
0053 
0054 
0055 #ifndef DOXYGEN_NO_DISPATCH
0056 namespace core_dispatch
0057 {
0058     template <typename GeometryTag, typename G>
0059     struct coordinate_system
0060     {
0061         using P = typename point_type<GeometryTag, G>::type;
0062 
0063         // Call its own specialization on point-tag
0064         using type = typename coordinate_system<point_tag, P>::type;
0065     };
0066 
0067 
0068     template <typename Point>
0069     struct coordinate_system<point_tag, Point>
0070     {
0071         using type = typename traits::coordinate_system
0072             <
0073                 util::remove_cptrref_t<Point>
0074             >::type;
0075     };
0076 
0077 
0078 } // namespace core_dispatch
0079 #endif
0080 
0081 
0082 /*!
0083 \brief \brief_meta{type, coordinate system (cartesian\, spherical\, etc), \meta_point_type}
0084 \tparam Geometry \tparam_geometry
0085 \ingroup core
0086 
0087 \qbk{[include reference/core/coordinate_system.qbk]}
0088 */
0089 template <typename Geometry>
0090 struct coordinate_system
0091 {
0092     using type = typename core_dispatch::coordinate_system
0093         <
0094             tag_t<Geometry>,
0095             util::remove_cptrref_t<Geometry>
0096         >::type;
0097 };
0098 
0099 template <typename Geometry>
0100 using coordinate_system_t = typename coordinate_system<Geometry>::type;
0101 
0102 #ifndef DOXYGEN_NO_DETAIL
0103 namespace detail {
0104 
0105 // Short cut for coordinate system units
0106 template <typename Geometry>
0107 struct coordinate_system_units
0108 {
0109     using type = typename coordinate_system<Geometry>::type::units;
0110 };
0111 
0112 
0113 template <typename Geometry>
0114 using coordinate_system_units_t = typename coordinate_system_units<Geometry>::type;
0115 
0116 } // namespace detail
0117 #endif // DOXYGEN_NO_DETAIL
0118 
0119 }} // namespace boost::geometry
0120 
0121 
0122 #endif // BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP