1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
4 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (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)
14 #ifndef BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
15 #define BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP
18 #include <boost/mpl/assert.hpp>
20 #include <boost/geometry/core/point_type.hpp>
21 #include <boost/geometry/util/bare_type.hpp>
24 namespace boost { namespace geometry
32 \brief Traits class defining the coordinate system of a point, important for strategy selection
36 \par Specializations should provide:
37 - typedef CS type; (cs::cartesian, cs::spherical, etc)
39 template <typename Point, typename Enable = void>
40 struct coordinate_system
44 false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE, (types<Point>)
52 #ifndef DOXYGEN_NO_DISPATCH
53 namespace core_dispatch
55 template <typename GeometryTag, typename G>
56 struct coordinate_system
58 typedef typename point_type<GeometryTag, G>::type P;
60 // Call its own specialization on point-tag
61 typedef typename coordinate_system<point_tag, P>::type type;
65 template <typename Point>
66 struct coordinate_system<point_tag, Point>
68 typedef typename traits::coordinate_system
70 typename geometry::util::bare_type<Point>::type
75 } // namespace core_dispatch
80 \brief \brief_meta{type, coordinate system (cartesian\, spherical\, etc), \meta_point_type}
81 \tparam Geometry \tparam_geometry
84 \qbk{[include reference/core/coordinate_system.qbk]}
86 template <typename Geometry>
87 struct coordinate_system
89 typedef typename core_dispatch::coordinate_system
91 typename tag<Geometry>::type,
92 typename geometry::util::bare_type<Geometry>::type
97 }} // namespace boost::geometry
100 #endif // BOOST_GEOMETRY_CORE_COORDINATE_SYSTEM_HPP