1
// Generic Geometry Library
3
// Copyright Bruno Lalande 2008, 2009
4
// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
5
// Use, modification and distribution is subject to the Boost Software License,
6
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7
// http://www.boost.org/LICENSE_1_0.txt)
9
#ifndef GGL_CORE_COORDINATE_TYPE_HPP
10
#define GGL_CORE_COORDINATE_TYPE_HPP
12
#include <boost/type_traits/remove_const.hpp>
14
#include <ggl/core/point_type.hpp>
21
\brief Traits class which indicate the coordinate type (double,float,...) of a point
25
\par Specializations should provide:
26
- typedef T type; (double,float,int,etc)
29
struct coordinate_type {};
33
#ifndef DOXYGEN_NO_DISPATCH
34
namespace core_dispatch
37
template <typename GeometryTag, typename G>
38
struct coordinate_type
40
typedef typename point_type<GeometryTag, G>::type point_type;
42
// Call its own specialization on point-tag
43
typedef typename coordinate_type<point_tag, point_type>::type type;
47
struct coordinate_type<point_tag, P>
49
typedef typename traits::coordinate_type<P>::type type;
52
} // namespace core_dispatch
53
#endif // DOXYGEN_NO_DISPATCH
56
\brief Meta-function which defines coordinate type (int, float, double, etc) of any geometry
60
struct coordinate_type
62
typedef typename boost::remove_const<G>::type ncg;
63
typedef typename core_dispatch::coordinate_type
65
typename tag<G>::type,
72
#endif // GGL_CORE_COORDINATE_TYPE_HPP