1
// Generic Geometry Library
3
// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
4
// Copyright Bruno Lalande 2008, 2009
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)
10
#ifndef GGL_CORE_GEOMETRY_ID_HPP
11
#define GGL_CORE_GEOMETRY_ID_HPP
14
#include <boost/mpl/int.hpp>
15
#include <boost/type_traits.hpp>
18
#include <ggl/core/tag.hpp>
19
#include <ggl/core/tags.hpp>
25
#ifndef DOXYGEN_NO_DISPATCH
26
namespace core_dispatch
29
template <typename GeometryTag>
30
struct geometry_id {};
34
struct geometry_id<point_tag> : boost::mpl::int_<1> {};
38
struct geometry_id<linestring_tag> : boost::mpl::int_<2> {};
42
struct geometry_id<polygon_tag> : boost::mpl::int_<3> {};
46
struct geometry_id<nsphere_tag> : boost::mpl::int_<91> {};
50
struct geometry_id<segment_tag> : boost::mpl::int_<92> {};
54
struct geometry_id<ring_tag> : boost::mpl::int_<93> {};
58
struct geometry_id<box_tag> : boost::mpl::int_<94> {};
62
} // namespace core_dispatch
68
\brief Meta-function the id for a geometry type
69
\note Used for e.g. reverse meta-function
72
template <typename Geometry>
73
struct geometry_id : core_dispatch::geometry_id<typename tag<Geometry>::type>
80
#endif // GGL_CORE_GEOMETRY_ID_HPP