diff --git a/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/edge_collapse.tex b/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/edge_collapse.tex index b84972ad4b7..463b141c6f8 100644 --- a/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/edge_collapse.tex +++ b/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/edge_collapse.tex @@ -80,17 +80,28 @@ and whose \ccc{value_type} is \subsubsection{\ccc{edge_index_map(EdgeIndexMap edge_idx_map)} } Maps each {\em directed} edge in the surface into an integer number -in the range \ccc{[0,num_edge(surface)}.\\ -\ccc{EdgeIndexMap} must be a +in the range \ccc{[0,num_edge(surface)}. + +\ccc{EdgeIndexMap} must be a either a \ccAnchor{http://www.boost.org/libs/property_map/ReadablePropertyMap.html}{ReadablePropertyMap} whose \ccc{key_type} is \ccc{boost::graph_traits::edge_descriptor} and whose \ccc{value_type} is -\ccc{boost::graph_traits::size_type} +\ccc{boost::graph_traits::size_type}, +or the same as \ccc{EdgeCollapsableMesh}, in which case +\ccc{edge_idx_map} is in fact the surface to be simplified. + +If \ccc{edge_idx_map} is a valid property map, it is +passed as the argument, but if it is the surface, a +temporary property map is passed instead. +Such temporary map externaly relates each edge +in the surface (\ccc{edge_idx_map}) to its index, +without requiring any user intervention or any special +provision in the surface edge. \textbf{Default}: the property map obtained by calling \ccc{get(edge_index,surface)}, which in turn requires the surface edge class to have a member function -\ccc{edges_size_type id() const;}. +\ccc{int id() const;}. \subsubsection{\ccc{edge_is_border_map(EdgeIsBorderMap edge_border_map)} } diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/Edge_collapse_fully_cached_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/Edge_collapse_fully_cached_polyhedron.cpp index 224ddca1296..34578496a5f 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/Edge_collapse_fully_cached_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/Edge_collapse_fully_cached_polyhedron.cpp @@ -52,7 +52,7 @@ int main( int argc, char** argv ) SMS::edge_collapse(surface ,SMS::Count_stop_condition(1000) - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) .SMS::set_cache (SMS::LindstromTurk_set_cost_and_placement_cache()) .SMS::get_cost (SMS::Cached_cost ()) @@ -91,7 +91,7 @@ int main( int argc, char** argv ) SMS::edge_collapse(surface ,SMS::Count_stop_condition(1000) - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) .SMS::set_cache (set_full_cache) .SMS::get_cost (SMS::Cached_cost ()) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_enriched_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_enriched_polyhedron.cpp index 3153277b2e7..3abc9bd732e 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_enriched_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_enriched_polyhedron.cpp @@ -33,7 +33,7 @@ struct My_items : public CGAL::Polyhedron_items_3 }; template < class Refs, class Traits> struct Halfedge_wrapper { - typedef CGAL::HalfedgeDS_halfedge_base_with_id Halfedge; + typedef CGAL::HalfedgeDS_halfedge_max_base_with_id Halfedge; }; template < class Refs, class Traits> struct Face_wrapper { diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_polyhedron.cpp index 810414f9444..4604c9ff54e 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_polyhedron.cpp @@ -38,7 +38,7 @@ int main( int argc, char** argv ) // while third argument could have been omited, as shown in the next example. int r = SMS::edge_collapse(surface ,stop_policy - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) ); // === CONCRETE USAGE EXAMPLE ENDS HERE === diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_visited_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_visited_polyhedron.cpp index 7b9598d3c05..fcb19a2cbe2 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_visited_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_visited_polyhedron.cpp @@ -123,7 +123,7 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse(surface ,SMS::Count_ratio_stop_condition(0.10) - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) .SMS::visitor(&vis) ); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_enriched_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_enriched_polyhedron.cpp index bed563cea1e..cdf52ce18b4 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_enriched_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_enriched_polyhedron.cpp @@ -53,7 +53,7 @@ struct My_items : public CGAL::Polyhedron_items_3 }; template < class Refs, class Traits> struct Halfedge_wrapper { - typedef CGAL::HalfedgeDS_halfedge_base_with_id Halfedge; + typedef CGAL::HalfedgeDS_halfedge_max_base_with_id Halfedge; }; template < class Refs, class Traits> struct Face_wrapper { @@ -90,7 +90,7 @@ int main( int argc, char** argv ) ,SMS::Count_ratio_stop_condition(0.10) ,SMS.vertex_is_fixed_map(CGAL::Vertex_is_fixed_map_stored()) // The edge_index_map parameter is ommited becasue - // the halfedge in this polyhedron support the stored id(). + // the halfedge in this polyhedron supports the stored id(). ); // === CONCRETE USAGE EXAMPLE ENDS HERE === diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_polyhedron.cpp index 89e46a94570..8cf9f361509 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/LT_edge_collapse_with_fixed_vertices_polyhedron.cpp @@ -47,7 +47,7 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse(surface ,SMS::Count_ratio_stop_condition(0.10) - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) .SMS::vertex_is_fixed_map(boost::make_assoc_property_map(is_vertex_fixed)) ); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/MP_edge_collapse_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/MP_edge_collapse_polyhedron.cpp index 99c5a36dd77..87a2490d216 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/MP_edge_collapse_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/MP_edge_collapse_polyhedron.cpp @@ -40,7 +40,7 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse(surface ,SMS::Count_ratio_stop_condition(0.10) - ,SMS::external_edge_index_map(surface) + ,SMS::edge_index_map(surface) .SMS::set_cache (SMS::Set_no_cache ()) .SMS::get_cost (SMS::Edge_length_cost ())