From 7379d58fadd66289726db69b32e34051a4207bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sun, 11 Apr 2021 07:45:14 +0200 Subject: [PATCH] fix compilation issues --- .../Isotropic_remeshing/remesh_impl.h | 9 ++++----- .../CGAL/Polygon_mesh_processing/remesh.h | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 29890d0c55b4..e51443f98317 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -231,14 +231,14 @@ namespace internal { template + typename FacePatchMap, + typename SizingFunction> bool constraints_are_short_enough(const PM& pmesh, EdgeConstraintMap ecmap, VertexPointMap vpmap, const FacePatchMap& fpm, - const double& high) + const SizingFunction& sizing) { - double sqh = high*high; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; for(edge_descriptor e : edges(pmesh)) @@ -248,8 +248,7 @@ namespace internal { get(ecmap, e) || get(fpm, face(h,pmesh))!=get(fpm, face(opposite(h,pmesh),pmesh)) ) { - if (sqh < CGAL::squared_distance(get(vpmap, source(h, pmesh)), - get(vpmap, target(h, pmesh)))) + if (sizing.is_too_long(source(h, pmesh), target(h, pmesh))) { return false; } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 2c91a260286a..bb582702dba2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -31,6 +31,16 @@ namespace CGAL { namespace Polygon_mesh_processing { +/*! \todo document me or merge the doc with the original overload*/ +template +void isotropic_remeshing(const FaceRange& faces + , const SizingFunction& sizing + , PolygonMesh& pmesh + , const NamedParameters& np); + /*! * \ingroup PMP_meshing_grp * @brief remeshes a triangulated region of a polygon mesh. @@ -181,8 +191,10 @@ void isotropic_remeshing(const FaceRange& faces , PolygonMesh& pmesh , const NamedParameters& np) { - isotropic_remeshing(faces, - CGAL::Uniform_sizing_field(target_edge_length, pmesh), + typedef Uniform_sizing_field Default_sizing; + isotropic_remeshing( + faces, + Default_sizing(target_edge_length, pmesh), pmesh, np); } @@ -261,12 +273,11 @@ void isotropic_remeshing(const FaceRange& faces #if !defined(CGAL_NO_PRECONDITIONS) if(protect) { - double high = 4. / 3. * target_edge_length; std::string msg("Isotropic remeshing : protect_constraints cannot be set to"); msg.append(" true with constraints larger than 4/3 * target_edge_length."); msg.append(" Remeshing aborted."); CGAL_precondition_msg( - internal::constraints_are_short_enough(pmesh, ecmap, vpmap, fpmap, high), + internal::constraints_are_short_enough(pmesh, ecmap, vpmap, fpmap, sizing), msg.c_str()); } #endif