// Copyright (c) 2018 GeometryFactory Sarl (France). // All rights reserved. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is part of CGAL (www.cgal.org) // // $URL: https://github.com/CGAL/cgal/blob/v5.1/Stream_support/include/CGAL/IO/traits_polygon.h $ // $Id: traits_polygon.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Maxime Gimeno #ifndef CGAL_IO_TRAITS_POLYGON_H #define CGAL_IO_TRAITS_POLYGON_H #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #include #include #include #include #include namespace boost{ namespace geometry{ namespace traits{ // WKT traits for Polygon template< typename K > struct tag > { typedef ring_tag type; }; template< typename K > struct tag > { typedef polygon_tag type; }; template< typename K > struct ring_const_type > { typedef const CGAL::Polygon_2& type; }; template< typename K > struct ring_mutable_type > { typedef CGAL::Polygon_2& type; }; template< typename K > struct interior_const_type > { typedef const typename CGAL::Polygon_with_holes_2::Holes_container& type; }; template< typename K > struct interior_mutable_type > { typedef typename CGAL::Polygon_with_holes_2::Holes_container& type; }; template< typename K > struct exterior_ring > { static CGAL::Polygon_2& get(CGAL::Polygon_with_holes_2& p) { return (p.outer_boundary()); } static CGAL::Polygon_2 const& get(CGAL::Polygon_with_holes_2 const& p) { return (p.outer_boundary()); } }; template< typename K > struct interior_rings > { static typename CGAL::Polygon_with_holes_2::Holes_container& get(CGAL::Polygon_with_holes_2& p) { return p.holes(); } static const typename CGAL::Polygon_with_holes_2::Holes_container& get(CGAL::Polygon_with_holes_2 const& p) { return p.holes(); } }; }//end traits }//end geometry //extra specialization template< typename K > struct range_value > { typedef typename CGAL::Polygon_2::Point_2 type; }; }//end boost #endif #endif