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 b966d227d99..1ed128cb15b 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 @@ -936,13 +936,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 > @@ -1039,17 +1032,19 @@ void split_connected_components(const PolygonMesh& pm, 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(pm, np), CGAL::get_initialized_halfedge_index_map(pm, 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 e64e707bbd8..aa74a72008e 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 @@ -1524,7 +1524,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 5ffa00ffeda..9740d3cbb2a 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 d9131e4a083..88b2536b5ad 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -1216,7 +1216,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)); @@ -1297,7 +1297,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 aec54c22b7c..f2e09a9dec4 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 @@ -163,10 +163,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 1c8b004bdd6..ece8e7f1410 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -165,18 +165,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 < @@ -342,18 +342,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_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index 5ef95e053f6..13e7130b742 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 60cdbf355be..4e663b7ca35 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 @@ -122,7 +122,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; @@ -182,7 +182,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 608758623a1..fa07beac286 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 @@ -92,7 +92,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; @@ -101,7 +101,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/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Isotropic_remeshing_plugin.cpp index c00c1fee0d3..f86ef0983b0 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/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 c5c78786f5e..6228d3ec392 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -35,37 +35,7 @@ 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 -{ -public: - typedef K key_type; - typedef V value_type; - typedef const V& 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&) - { - return pm.v; - } - - inline friend - void - put(Static_property_map&, const key_type&, const value_type&) - {} -}; - -/// Similar to Static_property_map but retricted to bool and the value is const at compile time +/// A boolean property map return a const value at compile time template class Static_boolean_property_map { 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)); }