From a093cd5e9fae45ad938481534e87dfd75e374a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 6 Jul 2017 12:00:39 +0200 Subject: [PATCH] use a small struct instead of a two element map --- .../Corefinement/Face_graph_output_builder.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h index 781f765e19f..6a180e4e3d3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h @@ -130,7 +130,17 @@ class Face_graph_output_builder // for mapping an edge per polyline per triangle mesh An_edge_per_polyline_map an_edge_per_polyline; // To collect all intersection edges - std::map mesh_to_intersection_edges; + class Mesh_to_intersection_edges{ + TriangleMesh& m_tm; + Intersection_edge_map tm_map; + Intersection_edge_map other_map; + public: + Mesh_to_intersection_edges(TriangleMesh& tm1, TriangleMesh) : m_tm(tm1) {} + Intersection_edge_map& operator[](TriangleMesh* tm_ptr) { + return &m_tm==tm_ptr?tm_map:other_map; + } + }; + Mesh_to_intersection_edges mesh_to_intersection_edges; typename An_edge_per_polyline_map::iterator last_polyline; @@ -342,6 +352,7 @@ public: , is_tm1_inside_out( is_tm1_closed && !PMP::is_outward_oriented(tm1) ) , is_tm2_inside_out( is_tm2_closed && !PMP::is_outward_oriented(tm2) ) , NID(-1) + , mesh_to_intersection_edges(tm1, tm2) {} bool union_is_valid() const