Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:13:11

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 
0007 // This file was modified by Oracle on 2020.
0008 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 
0011 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0012 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0013 
0014 // Use, modification and distribution is subject to the Boost Software License,
0015 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
0017 
0018 #ifndef BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
0019 #define BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
0020 
0021 
0022 #include <boost/geometry/core/point_type.hpp>
0023 #include <boost/geometry/core/static_assert.hpp>
0024 #include <boost/geometry/util/type_traits_std.hpp>
0025 
0026 
0027 namespace boost { namespace geometry
0028 {
0029 
0030 
0031 namespace traits
0032 {
0033 
0034 /*!
0035 \brief Traits class defining the coordinate system of a point, important for strategy selection
0036 \ingroup traits
0037 \par Geometries:
0038     - point
0039 \par Specializations should provide:
0040     - typedef CS type; (cs::cartesian, cs::spherical, etc)
0041 */
0042 template <typename Point, typename Enable = void>
0043 struct coordinate_system
0044 {
0045     BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0046         "Not implemented for this Point type.",
0047         Point);
0048 };
0049 
0050 } // namespace traits
0051 
0052 
0053 
0054 #ifndef DOXYGEN_NO_DISPATCH
0055 namespace core_dispatch
0056 {
0057     template <typename GeometryTag, typename G>
0058     struct coordinate_system
0059     {
0060         typedef typename point_type<GeometryTag, G>::type P;
0061 
0062         // Call its own specialization on point-tag
0063         typedef typename coordinate_system<point_tag, P>::type type;
0064     };
0065 
0066 
0067     template <typename Point>
0068     struct coordinate_system<point_tag, Point>
0069     {
0070         typedef typename traits::coordinate_system
0071             <
0072                 typename util::remove_cptrref<Point>::type
0073             >::type type;
0074     };
0075 
0076 
0077 } // namespace core_dispatch
0078 #endif
0079 
0080 
0081 /*!
0082 \brief \brief_meta{type, coordinate system (cartesian\, spherical\, etc), \meta_point_type}
0083 \tparam Geometry \tparam_geometry
0084 \ingroup core
0085 
0086 \qbk{[include reference/core/coordinate_system.qbk]}
0087 */
0088 template <typename Geometry>
0089 struct coordinate_system
0090 {
0091     typedef typename core_dispatch::coordinate_system
0092         <
0093             typename tag<Geometry>::type,
0094             typename util::remove_cptrref<Geometry>::type
0095         >::type type;
0096 };
0097 
0098 
0099 }} // namespace boost::geometry
0100 
0101 
0102 #endif // BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP