Merge pull request #6011 from janetournois/Mesh_3-prevent_bad_initialization-jtournois

Mesh_3 - warning message after bad initialization
This commit is contained in:
Laurent Rineau 2021-10-06 12:04:54 +02:00
commit a5e3469e78
2 changed files with 18 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include <CGAL/Mesher_level_visitors.h>
#include <CGAL/Kernel_traits.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/assertions.h>
#ifdef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE
#include <CGAL/Surface_mesher/Surface_mesher_visitor.h>
@ -765,6 +766,18 @@ initialize()
facets_mesher_.scan_triangulation();
refinement_stage = REFINE_FACETS;
}
if (r_c3t3_.number_of_facets() == 0)
{
CGAL::warning_fail("r_c3t3_.number_of_facets() == 0",
__FILE__,
__LINE__,
"Warning : The mesh refinement process can't start.\n"
"When calling refine_mesh_3(), the input `c3t3` should have been initialized and have "
"at least one facet in the complex. Try to solve this issue using :\n"
"\t- The automatic initialization provided by make_mesh_3()\n"
"\t- Adding more and better chosen points on the input surface\n");
}
}

View File

@ -14,6 +14,9 @@
//
// Author(s) : Geert-Jan Giezeman and Sven Schönherr
#ifndef CGAL_ASSERTIONS_IMPL_H
#define CGAL_ASSERTIONS_IMPL_H
#ifdef CGAL_HEADER_ONLY
#define CGAL_INLINE_FUNCTION inline
#else
@ -280,3 +283,5 @@ set_warning_behaviour(Failure_behaviour eb)
}
} //namespace CGAL
#endif //CGAL_ASSERTIONS_IMPL_H