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 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef GEOMETRY_TEST_TEST_COMMON_TEST_POINT_HPP
12 #define GEOMETRY_TEST_TEST_COMMON_TEST_POINT_HPP
14 #include <boost/geometry/core/access.hpp>
15 #include <boost/geometry/core/coordinate_type.hpp>
16 #include <boost/geometry/core/coordinate_system.hpp>
17 #include <boost/geometry/core/coordinate_dimension.hpp>
18 #include <boost/geometry/core/cs.hpp>
19 #include <boost/geometry/core/tag.hpp>
20 #include <boost/geometry/geometries/register/point.hpp>
22 // NOTE: since Boost 1.51 the Point type may always be a pointer.
23 // Therefore the traits class don't need to add a pointer.
24 // This obsoletes this whole test-point-type
36 struct test_const_point
39 : c1(0.0), c2(0.0), c3(0.0) { }
41 test_const_point(float c1, float c2, float c3)
42 : c1(c1), c2(c2), c3(c3) { }
44 const float c1, c2, c3;
51 namespace boost { namespace geometry { namespace traits {
54 struct tag<test::test_point> { typedef point_tag type; };
57 struct coordinate_type<test::test_point> { typedef float type; };
60 struct coordinate_system<test::test_point> { typedef cs::cartesian type; };
63 struct dimension<test::test_point>: boost::mpl::int_<3> {};
65 template<> struct access<test::test_point, 0>
67 static inline const float& get(const test::test_point& p)
72 static inline void set(test::test_point& p, const float& value)
78 template<> struct access<test::test_point, 1>
80 static inline const float& get(const test::test_point& p)
85 static inline void set(test::test_point& p, const float& value)
91 template<> struct access<test::test_point, 2>
93 static inline const float& get(const test::test_point& p)
98 static inline void set(test::test_point& p, const float& value)
104 }}} // namespace bg::traits
106 BOOST_GEOMETRY_REGISTER_POINT_3D_CONST(test::test_const_point,
108 boost::geometry::cs::cartesian,
111 #endif // GEOMETRY_TEST_TEST_COMMON_TEST_POINT_HPP