1
// Boost.Geometry (aka GGL, Generic Geometry Library)
4
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
8
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
11
// Use, modification and distribution is subject to the Boost Software License,
12
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13
// http://www.boost.org/LICENSE_1_0.txt)
16
#include <boost/geometry/core/cs.hpp>
17
#include <boost/geometry/geometries/concepts/check.hpp>
31
namespace boost { namespace geometry { namespace traits {
33
template <> struct tag<ro_point> { typedef point_tag type; };
34
template <> struct coordinate_type<ro_point> { typedef float type; };
35
template <> struct coordinate_system<ro_point> { typedef bg::cs::cartesian type; };
36
template <> struct dimension<ro_point> { enum { value = 2 }; };
38
template <> struct access<ro_point, 0>
40
static float get(ro_point const& p) { return p.x; }
43
template <> struct access<ro_point, 1>
45
static float get(ro_point const& p) { return p.y; }
51
template <> struct tag<rw_point> { typedef point_tag type; };
52
template <> struct coordinate_type<rw_point> { typedef float type; };
53
template <> struct coordinate_system<rw_point> { typedef bg::cs::cartesian type; };
54
template <> struct dimension<rw_point> { enum { value = 2 }; };
56
template <> struct access<rw_point, 0>
58
static float get(rw_point const& p) { return p.x; }
59
static void set(rw_point& p, float value) { p.x = value; }
62
template <> struct access<rw_point, 1>
64
static float get(rw_point const& p) { return p.y; }
65
static void set(rw_point& p, float value) { p.y = value; }
69
}}} // namespace bg::traits
74
bg::concept::check<const ro_point>();
75
bg::concept::check<rw_point>();