From 5260100f882fde986df013c62a04c0f2a3a7795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 21 Apr 2023 09:07:14 +0200 Subject: [PATCH 1/3] fix warning --- .../CGAL/Polygon_mesh_processing/remesh_planar_patches.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h index 784b317c41d..6648fbb5454 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h @@ -698,8 +698,9 @@ bool decimate_impl(const TriangleMesh& tm, // TODO this is not optimal at all since we already have the set of contraints, // we could work on the graph on constraint and recover only the orientation // of the edge. To be done if someone find it too slow. + typedef typename boost::property_traits::value_type PID; std::vector hborders; - CGAL::Face_filtered_graph ffg(tm, cc_id, face_cc_ids); + CGAL::Face_filtered_graph ffg(tm, static_cast(cc_id), face_cc_ids); extract_boundary_cycles(ffg, std::back_inserter(hborders)); if (hborders.size()==1) From 731905c02c113ce36616358a0c72be3e0e88932a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 26 Apr 2023 09:03:28 +0200 Subject: [PATCH 2/3] fix one more --- .../CGAL/Polygon_mesh_processing/remesh_planar_patches.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h index 6648fbb5454..1a1509af04a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h @@ -57,7 +57,7 @@ struct Face_map friend void put(Face_map m, key_type k, value_type v) { - put(m.pm, v, m.face_ids[k]); + put(m.pm, v, static_cast(m.face_ids[k])); } PM pm; From 7f2ca4cfb740ae20a8559418dceef735bcfee7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 27 Apr 2023 15:52:52 +0200 Subject: [PATCH 3/3] fix more warnings --- .../Polygon_mesh_processing/remesh_planar_patches.h | 4 ++-- .../CGAL/Polygon_mesh_processing/region_growing.h | 10 ++++++---- .../Shape_detection/Region_growing/Region_growing.h | 6 ++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h index 1a1509af04a..fd007d5915f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h @@ -604,6 +604,7 @@ bool decimate_impl(const TriangleMesh& tm, typedef typename graph_traits::vertex_descriptor vertex_descriptor; typedef typename graph_traits::face_descriptor face_descriptor; typedef std::pair Id_pair; + typedef typename boost::property_traits::value_type PID; // compute the new mesh std::vector< std::vector< boost::container::small_vector > > faces_per_cc(nb_corners_and_nb_cc.second); @@ -698,7 +699,6 @@ bool decimate_impl(const TriangleMesh& tm, // TODO this is not optimal at all since we already have the set of contraints, // we could work on the graph on constraint and recover only the orientation // of the edge. To be done if someone find it too slow. - typedef typename boost::property_traits::value_type PID; std::vector hborders; CGAL::Face_filtered_graph ffg(tm, static_cast(cc_id), face_cc_ids); extract_boundary_cycles(ffg, std::back_inserter(hborders)); @@ -739,7 +739,7 @@ bool decimate_impl(const TriangleMesh& tm, #endif all_patches_successfully_remeshed = false; // make all vertices of the patch a corner - CGAL::Face_filtered_graph ffg(tm, cc_id, face_cc_ids); + CGAL::Face_filtered_graph ffg(tm, static_cast(cc_id), face_cc_ids); std::vector new_corners; for (vertex_descriptor v : vertices(ffg)) { diff --git a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h index 3029be2fe65..4aa40c42e38 100644 --- a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h +++ b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h @@ -33,14 +33,16 @@ namespace internal template void fill_plane_or_vector_map(const std::vector& normals, RegionMap region_map, typename GT::Vector_3) { - for (std::size_t i = 0 ; i::key_type KT; + for (KT i = 0 ; i(normals.size()); ++i) put(region_map, i, normals[i].first.orthogonal_vector()); } template void fill_plane_or_vector_map(const std::vector& normals, RegionMap region_map, typename GT::Plane_3) { - for (std::size_t i = 0 ; i::key_type KT; + for (KT i = 0; i < static_cast(normals.size()); ++i) put(region_map, i, normals[i].first); } @@ -195,7 +197,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh, if (candidates.size() == 1) { Id new_id = *candidates.begin(); - put(region_map, f0, new_id); + put(region_map, f0, static_cast(new_id)); tmp[new_id].second.push_back(f0); tmp[i].second.clear(); } @@ -207,7 +209,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh, tmp.erase(last, tmp.end()); //update region map - for (std::size_t i=0; i(tmp.size()); ++i) { for (face_descriptor f : tmp[i].second) put(region_map, f, i); diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h index f3b0268d190..20068827baa 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing.h @@ -451,9 +451,10 @@ namespace internal { Item_map item_map_ = Item_helper::get(item_map); m_nb_regions = 0; + typename boost::property_traits::value_type init_value(-1); for (auto it = input_range.begin(); it != input_range.end(); it++) { Item item = get(item_map_, it); - put(m_region_map, item, std::size_t(-1)); + put(m_region_map, item, init_value); } // TODO if we want to allow subranges while NeighborQuery operates on the full range // (like for faces in a PolygonMesh) we should fill a non-visited map rather than a visited map @@ -479,8 +480,9 @@ namespace internal { Boolean_property_map m_visited; void fill_region_map(std::size_t idx, const Region& region) { + typedef typename boost::property_traits::value_type Id; for (auto item : region) { - put(m_region_map, item, idx); + put(m_region_map, item, static_cast(idx)); } }