From 2b5fe6f50c9324fc5468f0e37da8c1c1d35c3329 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 7 Dec 2018 10:29:58 +0100 Subject: [PATCH] Bugfix --- .../include/CGAL/Path_on_surface_with_rle.h | 66 ++++++++++++++----- .../CGAL/Surface_mesh_curve_topology.h | 3 + 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h b/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h index c991446357f..628b674cda2 100644 --- a/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h +++ b/Surface_mesh_topology/include/CGAL/Path_on_surface_with_rle.h @@ -651,8 +651,10 @@ public: /// @return the positive turn given two ids of darts (unsed for CGAL_PWRLE_TURN_V1) std::size_t compute_positive_turn_given_ids(std::size_t id1, - std::size_t id2) const + std::size_t id2) const { + if (id1==id2) { return 0; } + std::size_t number_of_edges=m_map.number_of_darts()/2; if (id1>=number_of_edges) { @@ -668,6 +670,8 @@ public: std::size_t compute_negative_turn_given_ids(std::size_t id1, std::size_t id2) const { + if (id1==id2) { return 0; } + std::size_t number_of_edges=m_map.number_of_darts()/2; if (id1>=number_of_edges) { @@ -693,6 +697,41 @@ public: #endif // CGAL_PWRLE_TURN_V2 } + /// @return the turn between the two given darts. + std::size_t positive_turn(Dart_const_handle dh1, + Dart_const_handle dh2) + { +#ifdef CGAL_PWRLE_TURN_V1 + return m_map.positive_turn(dh1, dh2); +#else // CGAL_PWRLE_TURN_V1 + unsigned int toto1=m_map.positive_turn(dh1, dh2); + unsigned int toto2=compute_positive_turn_given_ids(get_dart_id(m_map.template beta<2>(dh1)), + get_dart_id(dh2)); + // std::cout<<"toto1="<