1 /** 2 * SFCGAL 3 * 4 * Copyright (C) 2012-2013 Oslandia <infos@oslandia.com> 5 * Copyright (C) 2012-2013 IGN (http://www.ign.fr) 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Library General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Library General Public License for more details. 16 17 * You should have received a copy of the GNU Library General Public 18 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef SFCGAL_DIFFERENCE_ALGORITHM 22 #define SFCGAL_DIFFERENCE_ALGORITHM 23 24 #include <SFCGAL/config.h> 25 26 #include <memory> 27 28 namespace SFCGAL { 29 class Geometry; 30 namespace detail { 31 template <int Dim> class GeometrySet; 32 template <int Dim> struct PrimitiveHandle; 33 } 34 35 namespace algorithm { 36 struct NoValidityCheck; 37 38 /** 39 * Difference on 2D geometries. 40 * @pre ga and gb are valid geometries 41 * @ingroup public_api 42 */ 43 SFCGAL_API std::unique_ptr<Geometry> difference( const Geometry& ga, const Geometry& gb ); 44 45 /** 46 * Diffrence on 2D geometries. No validity check variant 47 * @pre ga and gb are valid geometries 48 * @ingroup detail 49 * @warning No actual validity check is done. 50 */ 51 SFCGAL_API std::unique_ptr<Geometry> difference( const Geometry& ga, const Geometry& gb,NoValidityCheck ); 52 53 /** 54 * Difference on 3D geometries. Assume z = 0 if needed 55 * @pre ga and gb are valid geometries 56 * @ingroup public_api 57 */ 58 SFCGAL_API std::unique_ptr<Geometry> difference3D( const Geometry& ga, const Geometry& gb ); 59 60 /** 61 * Difference on 3D geometries. Assume z = 0 if needed 62 * @pre ga and gb are valid geometries 63 * @ingroup detail 64 * @warning@ No actual validity check is done 65 */ 66 SFCGAL_API std::unique_ptr<Geometry> difference3D( const Geometry& ga, const Geometry& gb, NoValidityCheck ); 67 68 /** 69 * @ingroup detail 70 */ 71 template <int Dim> 72 void difference( const detail::GeometrySet<Dim>& a, const detail::GeometrySet<Dim>& b, detail::GeometrySet<Dim>& ); 73 74 } 75 } 76 77 #endif 78