From 55bbde79a5eefc1bf4fc37efa616900efdadd804 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Tue, 25 Sep 2018 13:29:49 +0200 Subject: [PATCH] Change method for path generator --- .../include/CGAL/Path_generators.h | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Path_generators.h b/Combinatorial_map/include/CGAL/Path_generators.h index 84fa1ea660c..15f36fc1055 100644 --- a/Combinatorial_map/include/CGAL/Path_generators.h +++ b/Combinatorial_map/include/CGAL/Path_generators.h @@ -278,7 +278,26 @@ template void push_around_face(Path& p, std::size_t i, bool update_isclosed=true) { std::size_t begin=i, end=i; - while (p.get_map().template beta<1>(p.get_prev_dart(begin))== + + Path p2(p.get_map()); + typename Path::Dart_const_handle + dh=p.get_map().template beta<0>(p.get_ith_dart(begin)); + do + { + p2.push_back(p.get_map().template beta<2>(dh)); + dh=p.get_map().template beta<0>(dh); + } + while(dh!=p.get_ith_dart(begin)); + for (std::size_t i=begin+1; i(p.get_prev_dart(begin))== p.get_ith_dart(begin)) { begin=p.prev_index(begin); @@ -308,14 +327,15 @@ void push_around_face(Path& p, std::size_t i, bool update_isclosed=true) p.cut(begin, false); for (std::size_t i=0; i void update_path_randomly(Path& p, std::size_t nb, CGAL::Random& random, bool update_isclosed=true) { + if (p.is_empty()) return; + for (unsigned int i=0; i void update_path_randomly(Path& p, CGAL::Random& random, bool update_isclosed=true) -{ update_path_randomly(p, random.get_int(0, 10000), random, update_isclosed); } +{ update_path_randomly(p, random.get_int(1, 100), random, update_isclosed); } template void update_path_randomly(Path& p, std::size_t nb, bool update_isclosed=true)