Next changeset
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@907 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -108,21 +108,21 @@ compute_new_positions_C0()
|
||||
{
|
||||
// compute umbrella
|
||||
u = zero;
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||
{
|
||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it)) * w;
|
||||
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it)) * w;
|
||||
}
|
||||
u *= this->weight(v_it);
|
||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||
|
||||
// damping
|
||||
u *= 0.5;
|
||||
|
||||
// store new position
|
||||
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(*v_it));
|
||||
p += u;
|
||||
this->set_new_position(v_it, p);
|
||||
this->set_new_position(*v_it, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,10 +146,10 @@ compute_new_positions_C1()
|
||||
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
{
|
||||
u = zero;
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||
{
|
||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it))*w;
|
||||
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(*vv_it))*w;
|
||||
}
|
||||
u *= this->weight(v_it);
|
||||
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
|
||||
@@ -165,11 +165,11 @@ compute_new_positions_C1()
|
||||
{
|
||||
uu = zero;
|
||||
diag = 0.0;
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
|
||||
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it)
|
||||
{
|
||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||
uu -= Base::mesh_.property(umbrellas_, vv_it);
|
||||
diag += (w * this->weight(vv_it) + 1.0) * w;
|
||||
w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
|
||||
uu -= Base::mesh_.property(umbrellas_, *vv_it);
|
||||
diag += (w * this->weight(*vv_it) + 1.0) * w;
|
||||
}
|
||||
uu *= this->weight(v_it);
|
||||
diag *= this->weight(v_it);
|
||||
|
||||
@@ -172,7 +172,7 @@ set_active_vertices()
|
||||
active = active && !mesh_.status(v_it).feature();
|
||||
|
||||
typename Mesh::VertexOHalfedgeIter voh_it(mesh_,v_it);
|
||||
for ( ; voh_it ; ++voh_it ) {
|
||||
for ( ; voh_it.is_valid() ; ++voh_it ) {
|
||||
|
||||
// If the edge is a feature edge, skip the current vertex while smoothing
|
||||
if ( mesh_.status(mesh_.edge_handle(*voh_it)).feature() )
|
||||
@@ -201,8 +201,8 @@ set_active_vertices()
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (mesh_.is_boundary(v_it))
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.property(is_active_, vv_it) = false;
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
mesh_.property(is_active_, *vv_it) = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -213,26 +213,26 @@ set_active_vertices()
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
{
|
||||
mesh_.status(v_it).set_tagged(false);
|
||||
mesh_.status(v_it).set_tagged2(false);
|
||||
mesh_.status(*v_it).set_tagged(false);
|
||||
mesh_.status(*v_it).set_tagged2(false);
|
||||
}
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (mesh_.is_boundary(v_it))
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.status(v_it).set_tagged(true);
|
||||
if (mesh_.is_boundary(*v_it))
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
mesh_.status(*v_it).set_tagged(true);
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
if (mesh_.status(v_it).tagged())
|
||||
for (vv_it=mesh_.vv_iter(v_it); vv_it; ++vv_it)
|
||||
mesh_.status(v_it).set_tagged2(true);
|
||||
if (mesh_.status(*v_it).tagged())
|
||||
for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it)
|
||||
mesh_.status(*v_it).set_tagged2(true);
|
||||
|
||||
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
|
||||
{
|
||||
if (mesh_.status(v_it).tagged2())
|
||||
mesh_.property(is_active_, vv_it) = false;
|
||||
mesh_.status(v_it).set_tagged(false);
|
||||
mesh_.status(v_it).set_tagged2(false);
|
||||
if (mesh_.status(*v_it).tagged2())
|
||||
mesh_.property(is_active_, *vv_it) = false;
|
||||
mesh_.status(*v_it).set_tagged(false);
|
||||
mesh_.status(*v_it).set_tagged2(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user