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..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 @@ -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; @@ -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); @@ -699,7 +700,7 @@ bool decimate_impl(const TriangleMesh& tm, // 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. 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) @@ -738,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)); } }