From 8e73a49cb4e743b09367dec12c0adc811d8c127e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Sat, 10 Feb 2018 10:52:36 +0100 Subject: [PATCH] Start method bracket_flattening() --- .../CGAL/Combinatorial_map_functionalities.h | 16 +++ .../include/CGAL/Path_on_surface.h | 102 +++++++++++++++++- .../Linear_cell_complex/compute_example.cpp | 9 +- 3 files changed, 122 insertions(+), 5 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_functionalities.h b/Combinatorial_map/include/CGAL/Combinatorial_map_functionalities.h index 632007fbdf8..9daf48a47d1 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_functionalities.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_functionalities.h @@ -132,6 +132,22 @@ namespace CGAL { m_original_map.free_mark(m_mark_L); } + Path_on_surface transform_original_path_into_quad_surface + (const Path_on_surface& path) + { + Path_on_surface res(m_map); + for (std::size_t i=0; i& diff --git a/Combinatorial_map/include/CGAL/Path_on_surface.h b/Combinatorial_map/include/CGAL/Path_on_surface.h index 7a6fec7a1e4..7a3ad1996a3 100644 --- a/Combinatorial_map/include/CGAL/Path_on_surface.h +++ b/Combinatorial_map/include/CGAL/Path_on_surface.h @@ -41,12 +41,21 @@ public: unsigned int length() const { return m_path.size(); } - Dart_const_handle get_ith_dart(unsigned int i) const + Dart_const_handle get_ith_dart(std::size_t i) const { - assert(i(d1)!=d2) + { + ++res; + d1=m_map.template beta<1, 2>(d1); + } + // std::cout<<"next_turn="<(m_path[i]); + Dart_const_handle d2=m_map.template beta<2>(m_path[i+1]); // Work also for the last dart. + assert(d1!=d2); + + std::size_t res=1; + while (m_map.template beta<0>(d1)!=d2) + { + ++res; + d1=m_map.template beta<0, 2>(d1); + } + // std::cout<<"next_negative_turn="< new_path; + + for (std::size_t i=0; i m_path; diff --git a/Linear_cell_complex/examples/Linear_cell_complex/compute_example.cpp b/Linear_cell_complex/examples/Linear_cell_complex/compute_example.cpp index 900a66e78ed..119dd21a91e 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/compute_example.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/compute_example.cpp @@ -44,13 +44,18 @@ int main(int argc, char** argv) v.push_back(&p1); v.push_back(&p2); v.push_back(&p3); - v.push_back(&p4); - + v.push_back(&p4); + #ifdef CGAL_USE_BASIC_VIEWER display(lcc, v); #endif // CGAL_USE_BASIC_VIEWER CGAL::Combinatorial_map_tools cmt(lcc); + CGAL::Path_on_surface + pp1=cmt.transform_original_path_into_quad_surface(p1); + + pp1.bracket_flattening(); + return EXIT_SUCCESS; }