diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp index c879a61c193..5adae277506 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp @@ -41,12 +41,12 @@ int main(int argc, char* argv[]) inp>>sm; std::cout<<"File '"< cst(sm); + CGAL::Surface_mesh_topology::Curves_on_surface_topology cst(sm, true); - Path_on_surface cycle1=cst.compute_edgewidth(); + Path_on_surface cycle1=cst.compute_edgewidth(true); CGAL::Surface_mesh_topology::Euclidean_length_weight_functor wf(sm); - Path_on_surface cycle2=cst.compute_edgewidth(wf); + Path_on_surface cycle2=cst.compute_edgewidth(wf, true); std::cout<<"Cycle 1 (pink): "; display_cycle_info(sm, cycle1); std::cout<<"Cycle 2 (green): "; display_cycle_info(sm, cycle2); diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Edge_weight_functor.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Edge_weight_functor.h index ff703c18fbf..814e9cec21f 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Edge_weight_functor.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Edge_weight_functor.h @@ -40,9 +40,9 @@ struct Euclidean_length_weight_functor Weight_t operator() (Dart_const_handle dh) const { - CGAL::sqrt(CGAL::squared_distance - (Get_traits::get_point(m_mesh, dh), - Get_traits::get_point(m_mesh, m_map.other_extremity(dh)))); + return CGAL::sqrt(CGAL::squared_distance + (Get_traits::get_point(m_mesh, dh), + Get_traits::get_point(m_mesh, m_map.other_extremity(dh)))); } protected: diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h index 284203dd8bf..a2ceab80d9b 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h @@ -108,7 +108,7 @@ public: // Here amesh is already closed, and have 0-attributes with int. // Thus the mesh is not copied. Shortest_noncontractible_cycle(Mesh* amesh, size_type perforated_mark, - bool display_time=false) : + bool /*display_time*/=false) : m_local_map(amesh), m_is_perforated(perforated_mark), m_cycle(*amesh) @@ -522,11 +522,11 @@ protected: Original_dart_const_handle dh_original=Get_original_dart::run(this, dh); if (cycle.can_be_pushed(dh_original, flip)) - { cycle.push_back(dh_original, flip); } + { cycle.push_back(dh_original, flip, false); } else { CGAL_assertion(cycle.can_be_pushed(dh_original, !flip)); - cycle.push_back(dh_original, !flip); + cycle.push_back(dh_original, !flip, false); } } @@ -576,6 +576,7 @@ protected: // Trace back the path from `b` to root for (int ind=min_b-1; ind!=-1; ind=m_trace_index[ind]) { add_to_cycle(m_spanning_tree[ind], cycle, true); } + cycle.update_is_closed(); CGAL_assertion(cycle.is_closed()); return true;