From a70bf9458ad66af5809b477a994b2af03106e048 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 6 Jun 2019 17:34:53 +0200 Subject: [PATCH 1/2] fix optimizers protection If some vertices have a non-zero weights and they do not belong to input features, then global optimizers should not be used. The case without feature protection was not treated until now. --- Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h index 71652287a6b..59839352144 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h @@ -59,7 +59,12 @@ bool has_non_protecting_weights(const Triangulation& tr, const Weighted_point& vv_wp = tr.point(vv); if (cwsr(vv_wp, FT(0)) != CGAL::EQUAL) { - if (with_features && vv->in_dimension() > 1) + if (with_features) + { + if (vv->in_dimension() > 1) + return true; + } + else return true; } } From 91157b216795629ea4cc1168b8b5022ab258bcbd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 13 Jun 2019 18:08:38 +0200 Subject: [PATCH 2/2] Fix `Has_feature` is not `Tag_true` or `Tag_false`, but it *derives* from one of them! Anyway, it is easier to use the nested value `::value`. --- Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h index 59839352144..39eaae34cf7 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h @@ -42,8 +42,7 @@ template bool has_non_protecting_weights(const Triangulation& tr, const MeshDomain&) { - bool with_features = - boost::is_same, CGAL::Tag_true>::value; + const bool with_features = Has_features::value; typedef typename Triangulation::FT FT; typedef typename Triangulation::Weighted_point Weighted_point;