Commit fb1f93fc authored by Jan Möbius's avatar Jan Möbius

Fix cppcheck warning in Remesher

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18458 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cd688475
......@@ -119,31 +119,29 @@ compute_edge_weights()
typename Mesh::EdgeIter e_it, e_end(mesh_.edges_end());
typename Mesh::HalfedgeHandle heh0, heh1, heh2;
const typename Mesh::Point *p2;
typename Mesh::Point d0, d1;
typename Mesh::HalfedgeHandle heh2;
typename Mesh::Scalar weight;
for (e_it=mesh_.edges_begin(); e_it!=e_end; ++e_it)
{
heh0 = mesh_.halfedge_handle(*e_it, 0);
const typename Mesh::Point& p0 = mesh_.point(mesh_.to_vertex_handle(heh0));
const typename Mesh::HalfedgeHandle heh0 = mesh_.halfedge_handle(*e_it, 0);
const typename Mesh::Point& p0 = mesh_.point(mesh_.to_vertex_handle(heh0));
heh1 = mesh_.halfedge_handle(*e_it, 1);
const typename Mesh::Point& p1 = mesh_.point(mesh_.to_vertex_handle(heh1));
const typename Mesh::HalfedgeHandle heh1 = mesh_.halfedge_handle(*e_it, 1);
const typename Mesh::Point& p1 = mesh_.point(mesh_.to_vertex_handle(heh1));
heh2 = mesh_.next_halfedge_handle(heh0);
p2 = &mesh_.point(mesh_.to_vertex_handle(heh2));
d0 = (p0 - *p2).normalize();
d1 = (p1 - *p2).normalize();
const typename Mesh::Point& p2 = mesh_.point(mesh_.to_vertex_handle(heh2));
const typename Mesh::Point d0 = (p0 - p2).normalize();
const typename Mesh::Point d1 = (p1 - p2).normalize();
weight = 1.0 / tan(acos(d0|d1));
heh2 = mesh_.next_halfedge_handle(heh1);
p2 = &mesh_.point(mesh_.to_vertex_handle(heh2));
d0 = (p0 - *p2).normalize();
d1 = (p1 - *p2).normalize();
weight += 1.0 / tan(acos(d0|d1));
const typename Mesh::Point& p3 = mesh_.point(mesh_.to_vertex_handle(heh2));
const typename Mesh::Point d2 = (p0 - p3).normalize();
const typename Mesh::Point d3 = (p1 - p3).normalize();
weight += 1.0 / tan(acos(d2|d3));
mesh_.property(edge_weight_, *e_it) = weight;
}
......
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