Fixed deleting only the last newly-created cell during a periodic_remove abort

This commit is contained in:
Mael Rouxel-Labbé 2018-06-27 16:13:42 +02:00
parent c5fc0b6a4f
commit 4e256ef80e
2 changed files with 10 additions and 15 deletions

View File

@ -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<Cell_handle>& 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 ()

View File

@ -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