Commit 073cfd74 authored by Jan Möbius's avatar Jan Möbius
Browse files

Avoid double next_halfedge_handle call in collapse_ok

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@723 fdac6126-5c0c-442c-9429-916003d36597
parent a1315c1d
......@@ -113,19 +113,19 @@ bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
if (status(v0).deleted() || status(v1).deleted())
return false;
VertexHandle vl, vr;
HalfedgeHandle h1, h2;
// the edges v1-vl and vl-v0 must not be both boundary edges
if (!is_boundary(v0v1))
{
vl = to_vertex_handle(next_halfedge_handle(v0v1));
h1 = next_halfedge_handle(v0v1);
h2 = next_halfedge_handle(h1);
if (is_boundary(opposite_halfedge_handle(h1)) &&
vl = to_vertex_handle(h1);
if (is_boundary(opposite_halfedge_handle(h1)) &&
is_boundary(opposite_halfedge_handle(h2)))
{
return false;
......@@ -136,23 +136,22 @@ bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
// the edges v0-vr and vr-v1 must not be both boundary edges
if (!is_boundary(v1v0))
{
vr = to_vertex_handle(next_halfedge_handle(v1v0));
h1 = next_halfedge_handle(v1v0);
h2 = next_halfedge_handle(h1);
vr = to_vertex_handle(h1);
if (is_boundary(opposite_halfedge_handle(h1)) &&
is_boundary(opposite_halfedge_handle(h2)))
return false;
}
// if vl and vr are equal or both invalid -> fail
if (vl == vr) return false;
VertexVertexIter vv_it;
// test intersection of the one-rings of v0 and v1
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
status(vv_it).set_tagged(false);
......@@ -165,7 +164,6 @@ bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
return false;
// edge between two boundary vertices should be a boundary edge
if ( is_boundary(v0) && is_boundary(v1) &&
!is_boundary(v0v1) && !is_boundary(v1v0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment