1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2010-2012 Barend Gehrels, 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 BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
10 #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
12 // Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
13 // boost::polygon::point_data -> boost::geometry::point
16 #include <boost/polygon/polygon.hpp>
18 #include <boost/geometry/core/access.hpp>
19 #include <boost/geometry/core/cs.hpp>
20 #include <boost/geometry/core/coordinate_dimension.hpp>
21 #include <boost/geometry/core/coordinate_type.hpp>
22 #include <boost/geometry/core/tags.hpp>
25 namespace boost { namespace geometry
29 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
34 template <typename CoordinateType>
35 struct tag<boost::polygon::point_data<CoordinateType> >
37 typedef point_tag type;
41 template <typename CoordinateType>
42 struct coordinate_type<boost::polygon::point_data<CoordinateType> >
44 typedef CoordinateType type;
48 template <typename CoordinateType>
49 struct coordinate_system<boost::polygon::point_data<CoordinateType> >
51 typedef cs::cartesian type;
55 template <typename CoordinateType>
56 struct dimension<boost::polygon::point_data<CoordinateType> >
61 template <typename CoordinateType>
62 struct access<boost::polygon::point_data<CoordinateType>, 0>
64 typedef boost::polygon::point_data<CoordinateType> point_type;
66 static inline CoordinateType get(point_type const& p)
71 static inline void set(point_type& p, CoordinateType const& value)
78 template <typename CoordinateType>
79 struct access<boost::polygon::point_data<CoordinateType>, 1>
81 typedef boost::polygon::point_data<CoordinateType> point_type;
83 static inline CoordinateType get(point_type const& p)
88 static inline void set(point_type& p, CoordinateType const& value)
96 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
99 }} // namespace boost::geometry
102 #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP