diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index 4b41ece8f23..403cfaca69b 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -394,22 +394,23 @@ public: return cells_with_too_big_orthoball.empty(); } + // returns 'true/false' depending on whether the cover would (or has, if 'abort_if_cover_change' + // is set to 'false') change. bool update_cover_data_during_management (Cell_handle new_ch, const std::vector& new_cells, const bool abort_if_cover_change) { - bool result = false; - if(compare_orthsphere_radius_to_threshold(new_ch, orthosphere_radius_threshold) != CGAL::SMALLER) { if(is_1_cover()) { - if(abort_if_cover_change) - return true; - + // Whether we are changing the cover or simply aborting, we need to get rid of the new cells tds().delete_cells(new_cells.begin(), new_cells.end()); - this->convert_to_27_sheeted_covering(); - result = true; + + if(!abort_if_cover_change) + this->convert_to_27_sheeted_covering(); + + return true; } else { @@ -417,7 +418,7 @@ public: } } - return result; + return false; } virtual void update_cover_data_after_converting_to_27_sheeted_covering () diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index b7223efef7e..9103e88afb2 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -3247,14 +3247,8 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana if(cover_manager.update_cover_data_during_management(new_ch, new_cells, abort_if_cover_change)) { - // If we have switched to 27-sheet, 'new_ch' has already been cleaned up, - // but we must clean it if we have aborted a 27-sheet conversion. - if(is_1_cover() && abort_if_cover_change) - _tds.delete_cell(new_ch); - CGAL_triangulation_expensive_postcondition(_tds.is_valid()); - - return false; // removing would cause / caused a cover change + return false; // removing would cause / has caused a cover change } // The neighboring relation needs to be stored temporarily in