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_ALGORITHM_ISVALID_H_ 22 #define _SFCGAL_ALGORITHM_ISVALID_H_ 23 24 #include <SFCGAL/Geometry.h> 25 #include <SFCGAL/Validity.h> 26 #include <SFCGAL/algorithm/force2D.h> 27 #include <SFCGAL/algorithm/force3D.h> 28 29 namespace SFCGAL { 30 31 /** 32 * Functions used to assert for geometry validity 33 * @note exception message is apparently limited in length, thus print the reason for invalidity before its text representation (that can be very long) 34 */ 35 void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_VALIDITY( const Geometry& g ); 36 void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_VALIDITY_2D( const Geometry& g ); 37 void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_VALIDITY_3D( const Geometry& g ); 38 void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_VALIDITY_ON_PLANE( const Geometry& g ); 39 40 namespace algorithm { 41 42 /** 43 * @brief Check validity of a geometry 44 * @ingroup public_api 45 */ 46 SFCGAL_API const Validity isValid( const Geometry& g, const double& toleranceAbs= 1e-9 ); 47 48 /** 49 * Sets the geometry flag on a geometry and propagate to every internal geometries 50 * @ingroup public_api 51 */ 52 SFCGAL_API void propagateValidityFlag( Geometry& g, bool valid ); 53 54 /** 55 * Tag used for variants of algorithm that do not do validity check 56 * @ingroup public_api 57 */ 58 struct NoValidityCheck {}; 59 60 }//algorithm 61 }//SFCGAL 62 63 64 #endif 65