replace assertion with exception

This commit is contained in:
Jane Tournois 2025-06-02 12:03:23 +02:00
parent ab8fed4841
commit 2145617b2c
1 changed files with 11 additions and 1 deletions

View File

@ -71,6 +71,7 @@
#include <iterator> #include <iterator>
#include <optional> #include <optional>
#include <vector> #include <vector>
#include <iostream> //exceptions
#if CGAL_CXX20 && __has_include(<ranges>) #if CGAL_CXX20 && __has_include(<ranges>)
# include <ranges> # include <ranges>
#endif #endif
@ -1583,6 +1584,15 @@ public:
} }
private: private:
class Non_planar_plc_facet_exception : public std::exception
{
const char* what() const throw()
{
return "ERROR : PLC facet is not coplanar";
}
};
void fill_cdt_2(CDT_2& cdt_2, CDT_3_signed_index polygon_contraint_id) void fill_cdt_2(CDT_2& cdt_2, CDT_3_signed_index polygon_contraint_id)
{ {
const auto vec_of_handles = std::invoke([this, polygon_contraint_id]() { const auto vec_of_handles = std::invoke([this, polygon_contraint_id]() {
@ -1695,7 +1705,7 @@ private:
cdt_2.insert_constraint(previous_2d, vh_2d); cdt_2.insert_constraint(previous_2d, vh_2d);
} catch(typename CDT_2::Intersection_of_constraints_exception&) { } catch(typename CDT_2::Intersection_of_constraints_exception&) {
// intersection of constraints probably due to the projection // intersection of constraints probably due to the projection
CGAL_error_msg("Error : Input PLC facet is not coplanar!"); throw Non_planar_plc_facet_exception();
} }
previous_2d = vh_2d; previous_2d = vh_2d;
} }