diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index 4c9588546a6..1baa386b724 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -74,7 +74,7 @@ int main(int argc, char** argv) // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map - normals(get(CGAL::face_index, lcc)); + normals(static_cast(num_faces(lcc)), get(CGAL::face_index, lcc)); calculate_face_normals( lcc // Graph diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index 5de0ba63f70..b74b56183f1 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -82,7 +82,7 @@ int main(int argc, char** argv) // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map - normals(get(CGAL::face_index, P)); + normals(static_cast(num_faces(P)), get(CGAL::face_index, P)); calculate_face_normals( P // Graph diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 22116a51ef8..670a4c183c9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -438,7 +438,7 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, Output_iterator out = choose_parameter(get_parameter(np, internal_np::output_iterator)); // vector_property_map - boost::vector_property_map face_cc(fimap); + boost::vector_property_map face_cc(static_cast(num_faces(pmesh)), fimap); std::size_t num = connected_components(pmesh, face_cc, np); // Even if we do not want to keep anything we need to first @@ -594,7 +594,7 @@ std::size_t keep_large_connected_components(PolygonMesh& pmesh, Output_iterator out = choose_parameter(get_parameter(np, internal_np::output_iterator)); // vector_property_map - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(static_cast(num_faces(pmesh)), fim); std::size_t num = connected_components(pmesh, face_cc, np); std::vector component_size(num, 0); @@ -655,14 +655,12 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh { using parameters::choose_parameter; using parameters::get_parameter; + using parameters::is_default_parameter; typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::face_iterator face_iterator; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::vertex_iterator vertex_iterator; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - typedef typename boost::graph_traits::edge_iterator edge_iterator; typedef typename GetInitializedVertexIndexMap::type VertexIndexMap; VertexIndexMap vim = get_initialized_vertex_index_map(pmesh, np); @@ -671,10 +669,10 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh for(std::size_t i : components_to_keep) cc_to_keep.insert(i); - boost::vector_property_map keep_vertex(vim); - for(vertex_descriptor v : vertices(pmesh)){ + boost::vector_property_map keep_vertex(static_cast(num_vertices(pmesh)), vim); + for(vertex_descriptor v : vertices(pmesh)) keep_vertex[v] = false; - } + for(face_descriptor f : faces(pmesh)){ if (cc_to_keep.find(get(fcm,f)) != cc_to_keep.end()) put(fcm, f, keep ? 1 : 0); @@ -691,11 +689,9 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh } } - edge_iterator eb, ee; - for (boost::tie(eb, ee) = edges(pmesh); eb != ee;) + std::vector edges_to_remove; + for (edge_descriptor e : edges(pmesh)) { - edge_descriptor e = *eb; - ++eb; vertex_descriptor v = source(e, pmesh); vertex_descriptor w = target(e, pmesh); halfedge_descriptor h = halfedge(e, pmesh); @@ -703,7 +699,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh if (!keep_vertex[v] && !keep_vertex[w]){ // don't care about connectivity // As vertices are not kept the faces and vertices will be removed later - remove_edge(e, pmesh); + edges_to_remove.push_back(e); } else if (keep_vertex[v] && keep_vertex[w]){ face_descriptor fh = face(h, pmesh), ofh = face(oh, pmesh); @@ -736,7 +732,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh // shortcut the next pointers as e will be removed set_next(prev(h, pmesh), next(oh, pmesh), pmesh); set_next(prev(oh, pmesh), next(h, pmesh), pmesh); - remove_edge(e, pmesh); + edges_to_remove.push_back(e); } } else if (keep_vertex[v]){ @@ -744,7 +740,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh set_halfedge(v, prev(h, pmesh), pmesh); } set_next(prev(h, pmesh), next(oh, pmesh), pmesh); - remove_edge(e, pmesh); + edges_to_remove.push_back(e); } else { CGAL_assertion(keep_vertex[w]); @@ -752,26 +748,40 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh set_halfedge(w, prev(oh, pmesh), pmesh); } set_next(prev(oh, pmesh), next(h, pmesh), pmesh); - remove_edge(e, pmesh); + edges_to_remove.push_back(e); } } + for (edge_descriptor e : edges_to_remove) + remove_edge(e, pmesh); - face_iterator fb, fe; // We now can remove all vertices and faces not marked as kept - for (boost::tie(fb, fe) = faces(pmesh); fb != fe;){ - face_descriptor f = *fb; - ++fb; - if (get(fcm,f) != 1){ - remove_face(f, pmesh); - } - } - vertex_iterator b, e; - for (boost::tie(b, e) = vertices(pmesh); b != e;){ - vertex_descriptor v = *b; - ++b; - if (!keep_vertex[v]){ + std::vector faces_to_remove; + for (face_descriptor f : faces(pmesh)) + if (get(fcm,f) != 1) + faces_to_remove.push_back(f); + for (face_descriptor f : faces_to_remove) + remove_face(f, pmesh); + + std::vector vertices_to_remove; + for(vertex_descriptor v: vertices(pmesh)) + if (!keep_vertex[v]) + vertices_to_remove.push_back(v); + if ( is_default_parameter(get_parameter(np, internal_np::vertex_is_constrained)) ) + for (vertex_descriptor v : vertices_to_remove) remove_vertex(v, pmesh); - } + else + { + typedef typename internal_np::Lookup_named_param_def // default (not used) + >::type Vertex_map; + Vertex_map is_cst = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), + Static_boolean_property_map()); + for (vertex_descriptor v : vertices_to_remove) + if (!get(is_cst, v)) + remove_vertex(v, pmesh); + else + set_halfedge(v, boost::graph_traits::null_halfedge(), pmesh); } } @@ -924,7 +934,7 @@ void remove_connected_components(PolygonMesh& pmesh typedef typename CGAL::GetInitializedFaceIndexMap::type FaceIndexMap; FaceIndexMap fim = CGAL::get_initialized_face_index_map(pmesh, np); - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(static_cast(num_faces(pmesh)), fim); connected_components(pmesh, face_cc, np); std::vector cc_to_remove; @@ -991,7 +1001,7 @@ void keep_connected_components(PolygonMesh& pmesh typedef typename CGAL::GetInitializedFaceIndexMap::type FaceIndexMap; FaceIndexMap fim = CGAL::get_initialized_face_index_map(pmesh, np); - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(static_cast(num_faces(pmesh)), fim); connected_components(pmesh, face_cc, np); std::vector cc_to_keep; @@ -1043,13 +1053,6 @@ void keep_connected_components(PolygonMesh& pmesh namespace internal { -template -struct No_mark -{ - friend bool get(No_mark, typename boost::graph_traits::edge_descriptor) { return false; } - friend void put(No_mark, typename boost::graph_traits::edge_descriptor, bool) { } -}; - template < class PolygonMesh, class PolygonMeshRange, class FIMap, class VIMap, class HIMap, class Ecm, class NamedParameters > @@ -1168,17 +1171,19 @@ void split_connected_components(const PolygonMesh& pmesh, PolygonMeshRange& cc_meshes, const NamedParameters& np) { + typedef Static_boolean_property_map< + typename boost::graph_traits::edge_descriptor, false> Default_ecm; typedef typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - internal::No_mark//default + Default_ecm//default > ::type Ecm; using parameters::choose_parameter; using parameters::get_parameter; Ecm ecm = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - internal::No_mark()); + Default_ecm()); internal::split_connected_components_impl(CGAL::get_initialized_face_index_map(pmesh, np), CGAL::get_initialized_halfedge_index_map(pmesh, np), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 16140c8bb95..ead3281779e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -1528,7 +1528,7 @@ private: // update status using constrained edge map if (!boost::is_same >::value) + Static_boolean_property_map >::value) { for(edge_descriptor e : edges(mesh_)) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h index d818c4c4915..5d3b20d2355 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h @@ -174,10 +174,10 @@ std::size_t make_umbrella_manifold(typename boost::graph_traits::ha typedef typename internal_np::Lookup_named_param_def // default (no constraint pmap) + Static_boolean_property_map // default (no constraint pmap) >::type VerticesMap; VerticesMap cmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); std::size_t nb_new_vertices = 0; 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 6318c23a212..e85a3f6acfc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -1281,7 +1281,7 @@ bool does_bound_a_volume(const TriangleMesh& tm, const NamedParameters& np) CGAL_precondition(is_closed(tm)); CGAL_precondition(is_triangle_mesh(tm)); - Static_property_map vidmap(0); // dummy map not used + Constant_property_map vidmap(0); // dummy map not used std::size_t res = volume_connected_components(tm, vidmap, np.do_orientation_tests(true) .i_used_as_a_predicate(true)); @@ -1370,7 +1370,7 @@ void orient_to_bound_a_volume(TriangleMesh& tm, std::vector face_cc(num_faces(tm), std::size_t(-1)); std::vector nesting_levels; std::vector is_cc_outward_oriented; - Static_property_map vidmap(0); // dummy map not used + Constant_property_map vidmap(0); // dummy map not used volume_connected_components(tm, vidmap, parameters::vertex_point_map(vpm) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h index 33b8ba7f908..556998e2f9a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h @@ -182,10 +182,10 @@ void random_perturbation(VertexRange vertices typedef typename internal_np::Lookup_named_param_def < internal_np::vertex_is_constrained_t, NamedParameters, - Constant_property_map // default + Static_boolean_property_map // default > ::type VCMap; VCMap vcmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); unsigned int seed = choose_parameter(get_parameter(np, internal_np::random_seed), -1); bool do_project = choose_parameter(get_parameter(np, internal_np::do_project), true); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 78fd29ed683..04acb56d43a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -214,18 +214,18 @@ void isotropic_remeshing(const FaceRange& faces typedef typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - Constant_property_map // default (no constraint pmap) + Static_boolean_property_map // default (no constraint pmap) > ::type ECMap; ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); typedef typename internal_np::Lookup_named_param_def < internal_np::vertex_is_constrained_t, NamedParameters, - Constant_property_map // default (no constraint pmap) + Static_boolean_property_map // default (no constraint pmap) > ::type VCMap; VCMap vcmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); bool protect = choose_parameter(get_parameter(np, internal_np::protect_constraints), false); typedef typename internal_np::Lookup_named_param_def < @@ -405,18 +405,18 @@ void split_long_edges(const EdgeRange& edges typedef typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - Constant_property_map // default (no constraint pmap) + Static_boolean_property_map // default (no constraint pmap) > ::type ECMap; ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); typename internal::Incremental_remesher, // no constraint pmap + Static_boolean_property_map, // no constraint pmap internal::Connected_components_pmap, FIMap > remesher(pmesh, vpmap, gt, false/*protect constraints*/, ecmap, - Constant_property_map(false), + Static_boolean_property_map(), internal::Connected_components_pmap(faces(pmesh), pmesh, ecmap, fimap, false), fimap, false/*need aabb_tree*/); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 931858e4170..7856142ecd7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -225,7 +225,7 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, return 0; // Compute the connected components only once - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(static_cast(num_faces(tmesh)), fim); std::size_t num = connected_components(tmesh, face_cc, np); #ifdef CGAL_PMP_DEBUG_SMALL_CC_REMOVAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index 2b23c5db8b2..14d5921ecb4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -353,17 +353,17 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, typedef typename boost::graph_traits::edge_descriptor edge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef Constant_property_map Default_VCM; + typedef Static_boolean_property_map Default_VCM; typedef typename internal_np::Lookup_named_param_def::type VCM; - VCM vcm_np = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), Default_VCM(false)); + VCM vcm_np = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), Default_VCM()); - typedef Constant_property_map Default_ECM; + typedef Static_boolean_property_map Default_ECM; typedef typename internal_np::Lookup_named_param_def::type ECM; - ECM ecm = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), Default_ECM(false)); + ECM ecm = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), Default_ECM()); typedef typename GetVertexPointMap::const_type VPM; VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h index c4965e19051..e1e9923747f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_mesh.h @@ -158,7 +158,7 @@ void smooth_mesh(const FaceRange& faces, typedef typename internal_np::Lookup_named_param_def // default + Static_boolean_property_map // default > ::type ECMap; typedef internal::Area_smoother Area_optimizer; @@ -218,7 +218,7 @@ void smooth_mesh(const FaceRange& faces, } ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); // a constrained edge has constrained extremities for(face_descriptor f : faces) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h index 6575aae6ef4..c945177ea95 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/smooth_shape.h @@ -115,7 +115,7 @@ void smooth_shape(const FaceRange& faces, typedef typename internal_np::Lookup_named_param_def< internal_np::vertex_is_constrained_t, NamedParameters, - Constant_property_map >::type VCMap; + Static_boolean_property_map >::type VCMap; using parameters::choose_parameter; using parameters::get_parameter; @@ -124,7 +124,7 @@ void smooth_shape(const FaceRange& faces, VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_property_map(CGAL::vertex_point, tmesh)); VCMap vcmap = choose_parameter(get_parameter(np, internal_np::vertex_is_constrained), - Constant_property_map(false)); + Static_boolean_property_map()); const unsigned int nb_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 1); #if defined(CGAL_EIGEN3_ENABLED) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp index 9b5a81b4855..45ad5168a05 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp @@ -38,7 +38,7 @@ void mesh_with_id(const char* argv1, const bool save_output) boost::vector_property_map::type> - fccmap(get(CGAL::face_index,sm)); + fccmap(static_cast(num_faces(sm)), get(CGAL::face_index,sm)); std::size_t num = PMP::connected_components(sm, fccmap); if (strcmp(argv1, "data/blobby_3cc.off") == 0) @@ -92,7 +92,7 @@ void mesh_no_id(const char* argv1, const bool save_output) boost::vector_property_map::type> - fccmap(fim); + fccmap(static_cast(num_faces(sm)), fim); std::size_t num = PMP::connected_components(sm, fccmap); @@ -133,7 +133,7 @@ void test_border_cases() boost::vector_property_map::type> - fccmap(get(boost::face_index,sm)); + fccmap(static_cast(num_faces(sm)), get(boost::face_index,sm)); PMP::connected_components(sm, fccmap); std::size_t nb_faces=num_faces(sm); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index 051517fd090..78d6371ded0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp @@ -378,7 +378,7 @@ public Q_SLOTS: *selection_item->polyhedron(), selection_item->constrained_edges_pmap(), get(CGAL::vertex_point, *selection_item->polyhedron()), - CGAL::Static_property_map(1), + CGAL::Constant_property_map(1), 4. / 3. * target_length)) { QApplication::restoreOverrideCursor(); @@ -578,7 +578,7 @@ public Q_SLOTS: pmesh, ecm, get(CGAL::vertex_point, pmesh), - CGAL::Static_property_map(1), + CGAL::Constant_property_map(1), 4. / 3. * target_length)) { QApplication::restoreOverrideCursor(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp index 1c1e7f3bd70..e2c4d3b576d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp @@ -237,7 +237,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionColorConnectedCom = get(boost::face_index, pmesh); boost::vector_property_map::type> - fccmap(fim); + fccmap(static_cast(num_faces(pmesh)),fim); boost::property_map >::type pid = get(CGAL::face_patch_id_t(), pmesh); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h index 3ec4c1871b7..e83fbd4637a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h @@ -273,7 +273,7 @@ public Q_SLOTS: boost::vector_property_map::type> - fccmap; + fccmap(static_cast(num_faces(poly))); //get connected componant from the picked face std::set final_sel; diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 3addac4c486..5c5f39e8788 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -1629,7 +1629,7 @@ QString Scene_surface_mesh_item::computeStats(int type) { boost::vector_property_map::type> - fccmap(get(boost::face_index, *(d->smesh_))); + fccmap(static_cast(num_faces(*(d->smesh_))), get(boost::face_index, *(d->smesh_))); return QString::number(CGAL::Polygon_mesh_processing::connected_components(*(d->smesh_), fccmap)); } case NB_BORDER_EDGES: diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h index dc2069dd7f9..b74fd55f97c 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h @@ -27,8 +27,8 @@ BOOST_MPL_HAS_XXX_TRAIT_DEF(Plane_3) template struct Get_static_property_map { typedef boost::graph_traits > Graph_traits; - typedef CGAL::Static_property_map > type; + typedef CGAL::Constant_property_map > type; }; } // end namespace internal diff --git a/Property_map/include/CGAL/property_map.h b/Property_map/include/CGAL/property_map.h index 988c7ab6583..36a470b38bd 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -37,33 +37,28 @@ namespace CGAL { /// \cond SKIP_DOXYGEN -/// This class is almost the same as boost::static_property_map -/// The difference is that it is writable, although put() does nothing -template -class Static_property_map +/// A boolean property map return a const value at compile time +template +class Static_boolean_property_map { public: - typedef K key_type; - typedef V value_type; - typedef const V& reference; + typedef Key key_type; + typedef bool value_type; + typedef bool reference; typedef boost::read_write_property_map_tag category; -private: - V v; - public: - Static_property_map(V pv) - :v(pv){} + inline friend value_type - get(const Static_property_map& pm, const key_type&) + get(Static_boolean_property_map, const key_type&) { - return pm.v; + return default_value; } inline friend void - put(Static_property_map&, const key_type&, const value_type&) + put(Static_boolean_property_map, const key_type&, const value_type&) {} }; diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h index 8ba1a3c1bee..b3881cb789e 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h @@ -36,7 +36,7 @@ struct property_map, CGAL::face_patch_id_t > typedef typename boost::graph_traits >::face_descriptor face_descriptor; - typedef CGAL::Static_property_map >::face_descriptor,std::pair > type; + typedef CGAL::Constant_property_map >::face_descriptor,std::pair > type; typedef type const_type; }; @@ -111,7 +111,7 @@ template CGAL_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::face_patch_id_t) inline get(CGAL::face_patch_id_t, const Surface_mesh

&) { - typedef CGAL::Static_property_map >::face_descriptor,std::pair > Pmap; + typedef CGAL::Constant_property_map >::face_descriptor,std::pair > Pmap; return Pmap(std::make_pair(0,1)); }