From 6db2bff67bdada0ed2c736162811a923c7a1698c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 23 Nov 2016 15:47:11 +0100 Subject: [PATCH] handle call to corefinement functions with identical meshes --- .../Polygon_mesh_processing/corefinement.h | 45 +++++++++++++++++++ .../internal/Corefinement/Visitor.h | 14 ++++++ 2 files changed, 59 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index d45268c81a0..bffc206b326 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace CGAL { @@ -99,6 +100,7 @@ boolean_operation( TriangleMesh& tm1, NamedParametersOut3>& nps_out, const bool throw_on_self_intersection = false ) { + // Vertex point maps //for input meshes typedef typename GetVertexPointMap Ecm; + if (&tm1==&tm2) + { + Corefinement::mark_all_edges(tm1, ecm1); + Corefinement::mark_all_edges(tm2, ecm2); + return; + } + // surface intersection algorithm call typedef Corefinement::Default_node_visitor Dnv; typedef Corefinement::Default_face_visitor Dfv; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h index e7ffb017871..3adfe1127f9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h @@ -76,6 +76,20 @@ struct No_mark {} }; +template +void mark_all_edges(TriangleMesh& tm, const EdgeMarkMap& edge_mark_map) +{ + BOOST_FOREACH(typename boost::graph_traits::edge_descriptor ed, + edges(tm)) + { + put(edge_mark_map, ed, true); + } +} + +template +void mark_all_edges(TriangleMesh& tm, const No_mark&) +{} //nothing to do + //binds two edge constrained pmaps template struct Ecm_bind{