WIP: When we delete a face we have to transfer its isolated vertices

This commit is contained in:
Andreas Fabri 2023-08-22 17:01:46 +01:00
parent e7198a0d65
commit 965d4fd48d
2 changed files with 17 additions and 6 deletions

View File

@ -434,9 +434,10 @@ check_integrity_and_topological_planarity(bool faces) const
/* check the source links of out edges and count isolated vertices */ /* check the source links of out edges and count isolated vertices */
for (vit = vertices_begin() ; vit != vend; ++vit) { for (vit = vertices_begin() ; vit != vend; ++vit) {
if ( is_isolated(vit) ) { if ( is_isolated(vit) ) {
if ( faces ) if (faces) {
CGAL_assertion_msg( vit->face() != Face_const_handle(), CGAL_assertion_msg(vit->face() != Face_const_handle(),
VI(vit).c_str()); VI(vit).c_str());
}
++iso_vert_num; ++iso_vert_num;
} else { } else {
CGAL_assertion_msg( vit->halfedge() != Halfedge_const_handle(), CGAL_assertion_msg( vit->halfedge() != Halfedge_const_handle(),

View File

@ -626,8 +626,11 @@ avoid the simplification for edge pairs referenced by |e|.}*/
for(v = this->vertices_begin(); v != vend; v=vn) { CGAL_NEF_TRACEN("at vertex "<<PV(v)); for(v = this->vertices_begin(); v != vend; v=vn) { CGAL_NEF_TRACEN("at vertex "<<PV(v));
vn=v; ++vn; vn=v; ++vn;
if ( is_isolated(v) ) { if ( is_isolated(v) ) {
if ( mark(v) == mark(face(v)) ) delete_vertex_only(v); if (mark(v) == mark(face(v))) {
else set_isolated_vertex(face(v),v); delete_vertex_only(v);
} else {
set_isolated_vertex(face(v), v);
}
} else { // v not isolated } else { // v not isolated
Halfedge_handle e2 = first_out_edge(v), e1 = previous(e2); Halfedge_handle e2 = first_out_edge(v), e1 = previous(e2);
Point p1 = point(source(e1)), p2 = point(v), Point p1 = point(source(e1)), p2 = point(v),
@ -643,7 +646,14 @@ avoid the simplification for edge pairs referenced by |e|.}*/
for (f = this->faces_begin(); f != fend; f=fn) { for (f = this->faces_begin(); f != fend; f=fn) {
fn=f; ++fn; fn=f; ++fn;
Union_find_handle pit = Pitem[f]; Union_find_handle pit = Pitem[f];
if ( unify_faces.find(pit) != pit ) delete_face(f); if (unify_faces.find(pit) != pit) {
Union_find_handle root = unify_faces.find(pit);
for(Isolated_vertex_iterator ivi = isolated_vertices_begin(f); ivi != isolated_vertices_end(f); ++ivi){
v->set_face(*root);
link_as_isolated_vertex(*root,v);
}
delete_face(f);
}
} }