mirror of https://github.com/CGAL/cgal
Derecursify insert_constraint(Vhandle,Vhandle); Increment depth of propagating_flip()
This commit is contained in:
parent
09b3ed55fc
commit
029888f85c
|
|
@ -742,9 +742,9 @@ propagating_flip(Face_handle f,int i, int depth)
|
||||||
|
|
||||||
Face_handle ni = f->neighbor(i);
|
Face_handle ni = f->neighbor(i);
|
||||||
flip(f, i); // flip for constrained triangulations
|
flip(f, i); // flip for constrained triangulations
|
||||||
propagating_flip(f,i);
|
propagating_flip(f,i, depth+1);
|
||||||
i = ni->index(f->vertex(i));
|
i = ni->index(f->vertex(i));
|
||||||
propagating_flip(ni,i);
|
propagating_flip(ni,i, depth+1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -649,45 +649,53 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb)
|
||||||
// if a vertex vc of t lies on segment ab
|
// if a vertex vc of t lies on segment ab
|
||||||
// or if ab intersect some constrained edges
|
// or if ab intersect some constrained edges
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition( vaa != vbb);
|
std::stack<std::pair<Vertex_handle, Vertex_handle> > stack;
|
||||||
Vertex_handle vi;
|
stack.push(std::make_pair(vaa,vbb));
|
||||||
|
|
||||||
Face_handle fr;
|
while(! stack.empty()){
|
||||||
int i;
|
boost::tie(vaa,vbb) = stack.top();
|
||||||
if(includes_edge(vaa,vbb,vi,fr,i)) {
|
stack.pop();
|
||||||
mark_constraint(fr,i);
|
CGAL_triangulation_precondition( vaa != vbb);
|
||||||
if (vi != vbb) {
|
Vertex_handle vi;
|
||||||
insert_constraint(vi,vbb);
|
|
||||||
|
Face_handle fr;
|
||||||
|
int i;
|
||||||
|
if(includes_edge(vaa,vbb,vi,fr,i)) {
|
||||||
|
mark_constraint(fr,i);
|
||||||
|
if (vi != vbb) {
|
||||||
|
stack.push(std::make_pair(vi,vbb));
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List_faces intersected_faces;
|
List_faces intersected_faces;
|
||||||
List_edges conflict_boundary_ab, conflict_boundary_ba;
|
List_edges conflict_boundary_ab, conflict_boundary_ba;
|
||||||
|
|
||||||
bool intersection = find_intersected_faces( vaa, vbb,
|
bool intersection = find_intersected_faces( vaa, vbb,
|
||||||
intersected_faces,
|
intersected_faces,
|
||||||
conflict_boundary_ab,
|
conflict_boundary_ab,
|
||||||
conflict_boundary_ba,
|
conflict_boundary_ba,
|
||||||
vi);
|
vi);
|
||||||
if ( intersection) {
|
if ( intersection) {
|
||||||
if (vi != vaa && vi != vbb) {
|
if (vi != vaa && vi != vbb) {
|
||||||
insert_constraint(vaa,vi);
|
stack.push(std::make_pair(vaa,vi));
|
||||||
insert_constraint(vi,vbb);
|
stack.push(std::make_pair(vi,vbb));
|
||||||
}
|
}
|
||||||
else insert_constraint(vaa,vbb);
|
else{
|
||||||
return;
|
stack.push(std::make_pair(vaa,vbb));
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//no intersection
|
//no intersection
|
||||||
triangulate_hole(intersected_faces,
|
triangulate_hole(intersected_faces,
|
||||||
conflict_boundary_ab,
|
conflict_boundary_ab,
|
||||||
conflict_boundary_ba);
|
conflict_boundary_ba);
|
||||||
|
|
||||||
if (vi != vbb) {
|
if (vi != vbb) {
|
||||||
insert_constraint(vi,vbb);
|
stack.push(std::make_pair(vi,vbb));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue