From 2bbdca32fb0cdb82afcec6ad8d9f2d634d672174 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 30 Apr 2021 17:02:56 +0200 Subject: [PATCH] fix nb of facets and cells in output_to_medit number_of_facets_in_complex() and number_of_cells_in_complex() are valid only after rescan_after_load_triangulation'), which is not const so let's count facets and cells using std::distance() --- MDS_3/include/CGAL/IO/File_medit.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MDS_3/include/CGAL/IO/File_medit.h b/MDS_3/include/CGAL/IO/File_medit.h index 35979a1838a..7754ad86a04 100644 --- a/MDS_3/include/CGAL/IO/File_medit.h +++ b/MDS_3/include/CGAL/IO/File_medit.h @@ -794,7 +794,9 @@ output_to_medit(std::ostream& os, //------------------------------------------------------- // Facets //------------------------------------------------------- - typename C3T3::size_type number_of_triangles = c3t3.number_of_facets_in_complex(); + typename C3T3::size_type number_of_triangles + = std::distance(c3t3.facets_in_complex_begin(), + c3t3.facets_in_complex_end()); if ( print_each_facet_twice ) number_of_triangles += number_of_triangles; @@ -839,8 +841,11 @@ output_to_medit(std::ostream& os, //------------------------------------------------------- // Tetrahedra //------------------------------------------------------- + typename C3T3::size_type number_of_cells + = std::distance(c3t3.cells_in_complex_begin(), + c3t3.cells_in_complex_end()); os << "Tetrahedra\n" - << c3t3.number_of_cells_in_complex() << '\n'; + << number_of_cells << '\n'; for( Cell_iterator cit = c3t3.cells_in_complex_begin() ; cit != c3t3.cells_in_complex_end() ;