From 4d2931cee8f36f7b655b6bcdebccaa2c372a5465 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Wed, 2 Jun 2021 16:17:16 +0200 Subject: [PATCH] pmp, range loop analysis fixed warnings --- .../Polygon_mesh_processing/internal/Snapping/snap.h | 12 ++++++------ .../internal/Snapping/snap_vertices.h | 10 +++++----- .../CGAL/Polygon_mesh_processing/orientation.h | 2 +- .../polygon_mesh_to_polygon_soup.h | 4 ++-- .../repair_self_intersections.h | 2 +- .../CGAL/Polygon_mesh_processing/stitch_borders.h | 8 ++++---- .../include/CGAL/Polygon_mesh_slicer.h | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index db117edbd7a..00dc8475b62 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -1017,7 +1017,7 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, Vertex_patch vertex_patch_map_A = get(Vertex_size_t_tag(), tm_A); Vertex_patch vertex_patch_map_B = get(Vertex_size_t_tag(), tm_B); - for(const halfedge_descriptor h : halfedge_range_A) + for(const halfedge_descriptor& h : halfedge_range_A) { CGAL_precondition(is_border(h, tm_A)); halfedge_descriptor h_opp = opposite(h, tm_A); @@ -1026,7 +1026,7 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, } // @todo avoid that when 'self_snapping' is true - for(const halfedge_descriptor h : halfedge_range_B) + for(const halfedge_descriptor& h : halfedge_range_B) { CGAL_precondition(is_border(h, tm_B)); halfedge_descriptor h_opp = opposite(h, tm_B); @@ -1111,16 +1111,16 @@ std::size_t snap_non_conformal(HalfedgeRange& halfedge_range_A, } } - for(const halfedge_descriptor h : locked_halfedges_A_vector) + for(const halfedge_descriptor& h : locked_halfedges_A_vector) put(locked_halfedges_A, h, true); - for(const halfedge_descriptor h : locked_halfedges_B_vector) + for(const halfedge_descriptor& h : locked_halfedges_B_vector) put(locked_halfedges_B, h, true); if(is_same_mesh) { - for(const halfedge_descriptor h : locked_halfedges_A_vector) + for(const halfedge_descriptor& h : locked_halfedges_A_vector) put(locked_halfedges_B, h, true); - for(const halfedge_descriptor h : locked_halfedges_B_vector) + for(const halfedge_descriptor& h : locked_halfedges_B_vector) put(locked_halfedges_A, h, true); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h index 0c2f26134c5..dce8b42c48b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h @@ -589,7 +589,7 @@ std::size_t snap_vertices_two_way(const HalfedgeRange_A& halfedge_range_A, { if(is_second_mesh_fixed) { - for(const halfedge_descriptor ha : vs_a) + for(const halfedge_descriptor& ha : vs_a) put(vpm_A, target(ha, tm_A), get(vpm_B, vb)); } else @@ -605,10 +605,10 @@ std::size_t snap_vertices_two_way(const HalfedgeRange_A& halfedge_range_A, std::cout << "new position of " << va << " " << vb << " --> " << new_p << std::endl; #endif - for(const halfedge_descriptor ha : vs_a) + for(const halfedge_descriptor& ha : vs_a) put(vpm_A, target(ha, tm_A), new_p); - for(const halfedge_descriptor hb : vs_b) + for(const halfedge_descriptor& hb : vs_b) put(vpm_B, target(hb, tm_B), new_p); } @@ -650,9 +650,9 @@ std::size_t snap_vertices_two_way(const HalfedgeRange_A& halfedge_range_A, // Quadratic, but all halfedges in vs_a and vs_b point to the same point. There shouldn't be many. // @fixme this assumes compatible orientation... - for(const halfedge_descriptor ha : vs_a) + for(const halfedge_descriptor& ha : vs_a) { - for(const halfedge_descriptor hb : vs_b) + for(const halfedge_descriptor& hb : vs_b) { if(!is_border(ha, tm_A) || !is_border(hb, tm_B)) continue; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index 5e170ff0203..8e5b5be3053 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -499,7 +499,7 @@ void copy_container_content( RefToContainer ref_wrapper) { ref_wrapper.get().reserve(vec.size()); - for(const T& t : vec) + for(const T t : vec) { ref_wrapper.get().push_back(t); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h index e9c0f6ce302..9bcb0378597 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h @@ -95,13 +95,13 @@ void polygon_mesh_to_polygon_soup(const PolygonMesh& mesh, CGAL::internal::reserve(points, points.size() + vertices(mesh).size()); CGAL::internal::reserve(polygons, polygons.size() + faces(mesh).size()); - for(const vertex_descriptor v : vertices(mesh)) + for(const vertex_descriptor& v : vertices(mesh)) { points.emplace_back(get(vpm, v)); put(vim, v, index++); } - for(const face_descriptor f : faces(mesh)) + for(const face_descriptor& f : faces(mesh)) { CGAL::Iterator_range > incident_halfedges = CGAL::halfedges_around_face(halfedge(f, mesh), mesh); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index ca8cc0c7897..f5fdc39b066 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -1570,7 +1570,7 @@ remove_self_intersections_one_step(std::set halfedges_to_consider() const { std::vector boundaries; - for(const halfedge_descriptor bh : m_cycle_reps) + for(const halfedge_descriptor& bh : m_cycle_reps) for(halfedge_descriptor h : CGAL::halfedges_around_face(bh, m_pmesh)) boundaries.push_back(h); @@ -222,7 +222,7 @@ public: CGAL_assertion(!cycle_halfedges.empty()); - for(const halfedge_descriptor h : cycle_halfedges) + for(const halfedge_descriptor& h : cycle_halfedges) put(m_candidate_halfedges, h, true); for(const halfedges_pair& hp : filtered_stitchable_halfedges) @@ -231,7 +231,7 @@ public: put(m_candidate_halfedges, hp.second, false); } - for(const halfedge_descriptor h : cycle_halfedges) + for(const halfedge_descriptor& h : cycle_halfedges) { if(!is_border(h, m_pmesh) || !get(m_candidate_halfedges, h)) continue; @@ -1147,7 +1147,7 @@ std::size_t stitch_boundary_cycles(const BorderHalfedgeRange& boundary_cycle_rep typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; std::size_t stitched_boundary_cycles_n = 0; - for(const halfedge_descriptor h : boundary_cycle_representatives) + for(const halfedge_descriptor& h : boundary_cycle_representatives) stitched_boundary_cycles_n += stitch_boundary_cycle(h, pmesh, cycle_reps_maintainer, np); return stitched_boundary_cycles_n; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h index 9c80a2e630a..655b3307cc0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h @@ -555,7 +555,7 @@ public: // Filter coplanar edges: we consider only coplanar edges incident to one non-coplanar facet // for each such edge, add the corresponding nodes in the adjacency-list graph as well as // the edge - for(const edge_descriptor ed : all_coplanar_edges) + for(const edge_descriptor& ed : all_coplanar_edges) { if ( face(halfedge(ed, m_tmesh), m_tmesh)==graph_traits::null_face() || opposite_face(ed)==graph_traits::null_face() ||