// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2010-2011 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP // Adapts Geometries from Boost.Polygon for usage in Boost.Geometry // boost::polygon::polygon_with_holes_data -> boost::geometry::polygon #include #include #include #include #include #include #include #include namespace boost { namespace geometry { #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS namespace traits { template struct tag > { typedef polygon_tag type; }; template struct ring_const_type > { typedef adapt::bp::ring_proxy const> type; }; template struct ring_mutable_type > { typedef adapt::bp::ring_proxy > type; }; template struct interior_const_type > { typedef adapt::bp::holes_proxy const> type; }; template struct interior_mutable_type > { typedef adapt::bp::holes_proxy > type; }; template struct exterior_ring > { typedef boost::polygon::polygon_with_holes_data polygon_type; typedef adapt::bp::ring_proxy proxy; typedef adapt::bp::ring_proxy const_proxy; static inline proxy get(polygon_type& p) { return proxy(p); } static inline const_proxy get(polygon_type const& p) { return const_proxy(p); } }; template struct interior_rings > { typedef boost::polygon::polygon_with_holes_data polygon_type; typedef adapt::bp::holes_proxy proxy; typedef adapt::bp::holes_proxy const_proxy; static inline proxy get(polygon_type& p) { return proxy(p); } static inline const_proxy get(polygon_type const& p) { return const_proxy(p); } }; } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS }} // namespace boost::geometry #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP