1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // This file was modified by Oracle on 2020.
6 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
7 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9 // Use, modification and distribution is subject to the Boost Software License,
10 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
14 #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
16 // Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
17 // boost::polygon::point_data -> boost::geometry::point
20 #include <type_traits>
22 #include <boost/polygon/polygon.hpp>
24 #include <boost/geometry/core/access.hpp>
25 #include <boost/geometry/core/cs.hpp>
26 #include <boost/geometry/core/coordinate_dimension.hpp>
27 #include <boost/geometry/core/coordinate_type.hpp>
28 #include <boost/geometry/core/tags.hpp>
31 namespace boost { namespace geometry
35 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
40 template <typename CoordinateType>
41 struct tag<boost::polygon::point_data<CoordinateType> >
43 typedef point_tag type;
47 template <typename CoordinateType>
48 struct coordinate_type<boost::polygon::point_data<CoordinateType> >
50 typedef CoordinateType type;
54 template <typename CoordinateType>
55 struct coordinate_system<boost::polygon::point_data<CoordinateType> >
57 typedef cs::cartesian type;
61 template <typename CoordinateType>
62 struct dimension<boost::polygon::point_data<CoordinateType> >
63 : std::integral_constant<std::size_t, 2>
67 template <typename CoordinateType>
68 struct access<boost::polygon::point_data<CoordinateType>, 0>
70 typedef boost::polygon::point_data<CoordinateType> point_type;
72 static inline CoordinateType get(point_type const& p)
77 static inline void set(point_type& p, CoordinateType const& value)
84 template <typename CoordinateType>
85 struct access<boost::polygon::point_data<CoordinateType>, 1>
87 typedef boost::polygon::point_data<CoordinateType> point_type;
89 static inline CoordinateType get(point_type const& p)
94 static inline void set(point_type& p, CoordinateType const& value)
101 } // namespace traits
102 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
105 }} // namespace boost::geometry
108 #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP