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

OM 3.0 patch

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17220 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 77f49838
...@@ -98,15 +98,15 @@ project_to_reference(typename Mesh::VertexHandle _vh) const ...@@ -98,15 +98,15 @@ project_to_reference(typename Mesh::VertexHandle _vh) const
typename Mesh::CFVIter fv_it = Base::refmesh_->cfv_iter(fh); typename Mesh::CFVIter fv_it = Base::refmesh_->cfv_iter(fh);
const typename Mesh::Point& p0 = Base::refmesh_->point(fv_it); const typename Mesh::Point& p0 = Base::refmesh_->point(*fv_it);
typename Mesh::Normal n0 = Base::refmesh_->normal(fv_it); typename Mesh::Normal n0 = Base::refmesh_->normal(*fv_it);
typename Mesh::Scalar c0 = Base::refmesh_->property(refcurv_, fv_it); typename Mesh::Scalar c0 = Base::refmesh_->property(refcurv_, *fv_it);
const typename Mesh::Point& p1 = Base::refmesh_->point(++fv_it); const typename Mesh::Point& p1 = Base::refmesh_->point(*(++fv_it));
typename Mesh::Normal n1 = Base::refmesh_->normal(fv_it); typename Mesh::Normal n1 = Base::refmesh_->normal(*fv_it);
typename Mesh::Scalar c1 = Base::refmesh_->property(refcurv_, fv_it); typename Mesh::Scalar c1 = Base::refmesh_->property(refcurv_, *fv_it);
const typename Mesh::Point& p2 = Base::refmesh_->point(++fv_it); const typename Mesh::Point& p2 = Base::refmesh_->point(*(++fv_it));
typename Mesh::Normal n2 = Base::refmesh_->normal(fv_it); typename Mesh::Normal n2 = Base::refmesh_->normal(*fv_it);
typename Mesh::Scalar c2 = Base::refmesh_->property(refcurv_, fv_it); typename Mesh::Scalar c2 = Base::refmesh_->property(refcurv_, *fv_it);
// project // project
...@@ -152,7 +152,7 @@ compute_curvature(Mesh& _mesh, OpenMesh::VPropHandleT<Scalar> _ph) ...@@ -152,7 +152,7 @@ compute_curvature(Mesh& _mesh, OpenMesh::VPropHandleT<Scalar> _ph)
typename Mesh::VIter v_it, v_end(_mesh.vertices_end()); typename Mesh::VIter v_it, v_end(_mesh.vertices_end());
for (v_it=_mesh.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=_mesh.vertices_begin(); v_it!=v_end; ++v_it)
_mesh.property(_ph, v_it) = diffgeo.max_curvature(v_it); _mesh.property(_ph, *v_it) = diffgeo.max_curvature(*v_it);
} }
......
...@@ -112,8 +112,8 @@ init_reference() ...@@ -112,8 +112,8 @@ init_reference()
// tag non-locked vertices + one ring // tag non-locked vertices + one ring
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
mesh_.status(v_it).set_tagged(!mesh_.status(v_it).locked()); mesh_.status(*v_it).set_tagged(!mesh_.status(*v_it).locked());
MeshSelection::growVertexSelection(&mesh_); MeshSelection::growVertexSelection(&mesh_);
...@@ -124,26 +124,25 @@ init_reference() ...@@ -124,26 +124,25 @@ init_reference()
mesh_.add_property(vhandles); mesh_.add_property(vhandles);
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
if (mesh_.status(v_it).tagged()) if (mesh_.status(*v_it).tagged())
mesh_.property(vhandles, v_it) = mesh_.property(vhandles, *v_it) = refmesh_->add_vertex(mesh_.point(*v_it));
refmesh_->add_vertex(mesh_.point(v_it));
for (f_it=mesh_.faces_begin(), f_end=mesh_.faces_end(); for (f_it=mesh_.faces_begin(), f_end=mesh_.faces_end();
f_it!=f_end; ++f_it) f_it!=f_end; ++f_it)
{ {
fv_it = mesh_.cfv_iter(f_it); fv_it = mesh_.cfv_iter(*f_it);
v0 = fv_it.handle(); v0 = *fv_it;
v1 = (++fv_it).handle(); v1 = *(++fv_it);
v2 = (++fv_it).handle(); v2 = *(++fv_it);
if (mesh_.status(v0).tagged() && if (mesh_.status(v0).tagged() &&
mesh_.status(v1).tagged() && mesh_.status(v1).tagged() &&
mesh_.status(v2).tagged()) mesh_.status(v2).tagged())
{ {
refmesh_->add_face( mesh_.property(vhandles, v0), refmesh_->add_face( mesh_.property(vhandles, v0),
mesh_.property(vhandles, v1), mesh_.property(vhandles, v1),
mesh_.property(vhandles, v2) ); mesh_.property(vhandles, v2) );
} }
} }
...@@ -161,7 +160,7 @@ init_reference() ...@@ -161,7 +160,7 @@ init_reference()
bsp_->reserve(refmesh_->n_faces()); bsp_->reserve(refmesh_->n_faces());
for (f_it=refmesh_->faces_begin(), f_end=refmesh_->faces_end(); for (f_it=refmesh_->faces_begin(), f_end=refmesh_->faces_end();
f_it!=f_end; ++f_it) f_it!=f_end; ++f_it)
bsp_->push_back(f_it.handle()); bsp_->push_back(*f_it);
bsp_->build(10, 100); bsp_->build(10, 100);
} }
...@@ -196,12 +195,12 @@ project_to_reference(typename Mesh::VertexHandle _vh) const ...@@ -196,12 +195,12 @@ project_to_reference(typename Mesh::VertexHandle _vh) const
typename Mesh::CFVIter fv_it = refmesh_->cfv_iter(fh); typename Mesh::CFVIter fv_it = refmesh_->cfv_iter(fh);
const typename Mesh::Point& p0 = refmesh_->point(fv_it); const typename Mesh::Point& p0 = refmesh_->point(*fv_it);
typename Mesh::Normal n0 = refmesh_->normal(fv_it); typename Mesh::Normal n0 = refmesh_->normal(*fv_it);
const typename Mesh::Point& p1 = refmesh_->point(++fv_it); const typename Mesh::Point& p1 = refmesh_->point(*(++fv_it));
typename Mesh::Normal n1 = refmesh_->normal(fv_it); typename Mesh::Normal n1 = refmesh_->normal(*fv_it);
const typename Mesh::Point& p2 = refmesh_->point(++fv_it); const typename Mesh::Point& p2 = refmesh_->point(*(++fv_it));
typename Mesh::Normal n2 = refmesh_->normal(fv_it); typename Mesh::Normal n2 = refmesh_->normal(*fv_it);
// project // project
...@@ -277,27 +276,27 @@ prepare() ...@@ -277,27 +276,27 @@ prepare()
nothing_selected_ = true; nothing_selected_ = true;
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
if (mesh_.status(v_it).selected()) if (mesh_.status(*v_it).selected())
{ nothing_selected_ = false; break; } { nothing_selected_ = false; break; }
if (nothing_selected_) if (nothing_selected_)
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
mesh_.status(v_it).set_selected(true); mesh_.status(*v_it).set_selected(true);
// lock un-selected vertices & edges // lock un-selected vertices & edges
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
mesh_.status(v_it).set_locked(!mesh_.status(v_it).selected()); mesh_.status(*v_it).set_locked(!mesh_.status(*v_it).selected());
for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end(); for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end();
e_it!=e_end; ++e_it) e_it!=e_end; ++e_it)
{ {
v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it, 0)); v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 0));
v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it, 1)); v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 1));
mesh_.status(e_it).set_locked(mesh_.status(v0).locked() || mesh_.status(*e_it).set_locked(mesh_.status(v0).locked() ||
mesh_.status(v1).locked()); mesh_.status(v1).locked());
} }
...@@ -307,15 +306,15 @@ prepare() ...@@ -307,15 +306,15 @@ prepare()
// lock corner vertices (>2 feature edges) and endpoints // lock corner vertices (>2 feature edges) and endpoints
// of feature lines (1 feature edge) // of feature lines (1 feature edge)
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
{ {
if (mesh_.status(v_it).feature()) if (mesh_.status(*v_it).feature())
{ {
int c=0; int c=0;
for (vh_it=mesh_.cvoh_iter(v_it); vh_it; ++vh_it) for (vh_it=mesh_.cvoh_iter(*v_it); vh_it.is_valid(); ++vh_it)
if (mesh_.status(mesh_.edge_handle(vh_it.handle())).feature()) if (mesh_.status(mesh_.edge_handle(*vh_it)).feature())
++c; ++c;
if (c!=2) mesh_.status(v_it).set_locked(true); if (c!=2) mesh_.status(*v_it).set_locked(true);
} }
} }
...@@ -416,12 +415,12 @@ cleanup() ...@@ -416,12 +415,12 @@ cleanup()
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
{ {
mesh_.status(v_it).set_locked(false); mesh_.status(*v_it).set_locked(false);
} }
for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end(); for (e_it=mesh_.edges_begin(), e_end=mesh_.edges_end();
e_it!=e_end; ++e_it) e_it!=e_end; ++e_it)
{ {
mesh_.status(e_it).set_locked(false); mesh_.status(*e_it).set_locked(false);
} }
...@@ -429,7 +428,7 @@ cleanup() ...@@ -429,7 +428,7 @@ cleanup()
if (nothing_selected_) if (nothing_selected_)
for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end(); for (v_it=mesh_.vertices_begin(), v_end=mesh_.vertices_end();
v_it!=v_end; ++v_it) v_it!=v_end; ++v_it)
mesh_.status(v_it).set_selected(false); mesh_.status(*v_it).set_selected(false);
...@@ -459,7 +458,7 @@ split_long_edges() ...@@ -459,7 +458,7 @@ split_long_edges()
// un-tagg // un-tagg
for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it) for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it)
mesh_.status(v_it).set_tagged(false); mesh_.status(*v_it).set_tagged(false);
// handle Nastran PIDs during refinement // handle Nastran PIDs during refinement
OpenMesh::FPropHandleT<unsigned int> pids; OpenMesh::FPropHandleT<unsigned int> pids;
...@@ -470,18 +469,18 @@ split_long_edges() ...@@ -470,18 +469,18 @@ split_long_edges()
ok = true; ok = true;
for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) { for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it, 0)); v0 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 0));
v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(e_it, 1)); v1 = mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 1));
if (!mesh_.status(e_it).locked() && is_too_long(v0, v1)) { if (!mesh_.status(*e_it).locked() && is_too_long(v0, v1)) {
const typename Mesh::Point& p0 = mesh_.point(v0); const typename Mesh::Point& p0 = mesh_.point(v0);
const typename Mesh::Point& p1 = mesh_.point(v1); const typename Mesh::Point& p1 = mesh_.point(v1);
is_feature = mesh_.status(e_it).feature(); is_feature = mesh_.status(*e_it).feature();
is_boundary = mesh_.is_boundary(e_it); is_boundary = mesh_.is_boundary(*e_it);
vh = mesh_.add_vertex((p0 + p1) * 0.5); vh = mesh_.add_vertex((p0 + p1) * 0.5);
mesh_.split(e_it, vh); mesh_.split(*e_it, vh);
mesh_.status(vh).set_selected(true); mesh_.status(vh).set_selected(true);
...@@ -495,7 +494,7 @@ split_long_edges() ...@@ -495,7 +494,7 @@ split_long_edges()
} }
if (pids.is_valid()) { if (pids.is_valid()) {
e0 = e_it.handle(); e0 = *e_it;
e1 = (is_boundary ? mesh_.edge_handle(mesh_.n_edges() - 2) : mesh_.edge_handle(mesh_.n_edges() - 3)); e1 = (is_boundary ? mesh_.edge_handle(mesh_.n_edges() - 2) : mesh_.edge_handle(mesh_.n_edges() - 3));
f0 = mesh_.face_handle(mesh_.halfedge_handle(e0, 0)); f0 = mesh_.face_handle(mesh_.halfedge_handle(e0, 0));
...@@ -538,9 +537,9 @@ collapse_short_edges() ...@@ -538,9 +537,9 @@ collapse_short_edges()
ok = true; ok = true;
for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) { for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
if (!mesh_.status(e_it).deleted() && !mesh_.status(e_it).locked()) { if (!mesh_.status(*e_it).deleted() && !mesh_.status(*e_it).locked()) {
h10 = mesh_.halfedge_handle(e_it, 0); h10 = mesh_.halfedge_handle(*e_it, 0);
h01 = mesh_.halfedge_handle(e_it, 1); h01 = mesh_.halfedge_handle(*e_it, 1);
v0 = mesh_.to_vertex_handle(h10); v0 = mesh_.to_vertex_handle(h10);
v1 = mesh_.to_vertex_handle(h01); v1 = mesh_.to_vertex_handle(h01);
...@@ -554,12 +553,12 @@ collapse_short_edges() ...@@ -554,12 +553,12 @@ collapse_short_edges()
f1 = mesh_.status(v1).feature(); f1 = mesh_.status(v1).feature();
hcol01 = hcol10 = true; hcol01 = hcol10 = true;
if (mesh_.status(e_it).feature() && !f0 && !f1) if (mesh_.status(*e_it).feature() && !f0 && !f1)
std::cerr << "Bad luck" << std::endl; std::cerr << "Bad luck" << std::endl;
// boundary rules // boundary rules
if (b0 && b1) { if (b0 && b1) {
if (!mesh_.is_boundary(e_it)) if (!mesh_.is_boundary(*e_it))
continue; continue;
} else if (b0) } else if (b0)
hcol01 = false; hcol01 = false;
...@@ -588,7 +587,7 @@ collapse_short_edges() ...@@ -588,7 +587,7 @@ collapse_short_edges()
if (f0 && f1) { if (f0 && f1) {
// edge must be feature // edge must be feature
if (!mesh_.status(e_it).feature()) if (!mesh_.status(*e_it).feature())
continue; continue;
// the other two edges removed by collapse must not be features // the other two edges removed by collapse must not be features
...@@ -623,8 +622,8 @@ collapse_short_edges() ...@@ -623,8 +622,8 @@ collapse_short_edges()
if (hcol10) { if (hcol10) {
// don't create too long edges // don't create too long edges
skip = false; skip = false;
for (vv_it = mesh_.cvv_iter(v1); vv_it && !skip; ++vv_it) for (vv_it = mesh_.cvv_iter(v1); vv_it.is_valid() && !skip; ++vv_it)
if (is_too_long(v0, vv_it)) if (is_too_long(v0, *vv_it))
skip = true; skip = true;
if (!skip) { if (!skip) {
...@@ -637,8 +636,8 @@ collapse_short_edges() ...@@ -637,8 +636,8 @@ collapse_short_edges()
else if (hcol01) { else if (hcol01) {
// don't create too long edges // don't create too long edges
skip = false; skip = false;
for (vv_it = mesh_.cvv_iter(v0); vv_it && !skip; ++vv_it) for (vv_it = mesh_.cvv_iter(v0); vv_it.is_valid() && !skip; ++vv_it)
if (is_too_long(v1, vv_it)) if (is_too_long(v1, *vv_it))
skip = true; skip = true;
if (!skip) { if (!skip) {
...@@ -681,22 +680,22 @@ flip_edges() ...@@ -681,22 +680,22 @@ flip_edges()
// compute vertex valences // compute vertex valences
for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it) for (v_it = mesh_.vertices_begin(), v_end = mesh_.vertices_end(); v_it != v_end; ++v_it)
mesh_.property(valences_, v_it) = mesh_.valence(v_it); mesh_.property(valences_, *v_it) = mesh_.valence(*v_it);
// flip all edges // flip all edges
for (ok = false, i = 0; !ok && i < 100; ++i) { for (ok = false, i = 0; !ok && i < 100; ++i) {
ok = true; ok = true;
for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) { for (e_it = mesh_.edges_begin(), e_end = mesh_.edges_end(); e_it != e_end; ++e_it) {
if (!mesh_.status(e_it).locked() && !mesh_.status(e_it).feature()) { if (!mesh_.status(*e_it).locked() && !mesh_.status(*e_it).feature()) {
hh = mesh_.halfedge_handle(e_it, 0); hh = mesh_.halfedge_handle(*e_it, 0);
v0 = mesh_.to_vertex_handle(hh); v0 = mesh_.to_vertex_handle(hh);
v2 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh)); v2 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh));
if ( !mesh_.next_halfedge_handle(hh).is_valid() ) { if ( !mesh_.next_halfedge_handle(hh).is_valid() ) {
std::cerr << "Error v2" << std::endl; std::cerr << "Error v2" << std::endl;
continue; continue;
} }
hh = mesh_.halfedge_handle(e_it, 1); hh = mesh_.halfedge_handle(*e_it, 1);
v1 = mesh_.to_vertex_handle(hh); v1 = mesh_.to_vertex_handle(hh);
v3 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh)); v3 = mesh_.to_vertex_handle(mesh_.next_halfedge_handle(hh));
if ( !mesh_.next_halfedge_handle(hh).is_valid() ) { if ( !mesh_.next_halfedge_handle(hh).is_valid() ) {
...@@ -746,8 +745,8 @@ flip_edges() ...@@ -746,8 +745,8 @@ flip_edges()
ve_after = ve0 + ve1 + ve2 + ve3; ve_after = ve0 + ve1 + ve2 + ve3;
if (ve_before > ve_after && mesh_.is_flip_ok(e_it)) { if (ve_before > ve_after && mesh_.is_flip_ok(*e_it)) {
mesh_.flip(e_it); mesh_.flip(*e_it);
--mesh_.property(valences_, v0); --mesh_.property(valences_, v0);
--mesh_.property(valences_, v1); --mesh_.property(valences_, v1);
++mesh_.property(valences_, v2); ++mesh_.property(valences_, v2);
...@@ -780,9 +779,9 @@ tangential_smoothing(bool _use_projection) ...@@ -780,9 +779,9 @@ tangential_smoothing(bool _use_projection)
// tag active vertices // tag active vertices
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
mesh_.status(v_it).set_tagged( !mesh_.status(v_it).locked() && mesh_.status(*v_it).set_tagged( !mesh_.status(*v_it).locked() &&
!mesh_.status(v_it).feature() && !mesh_.status(*v_it).feature() &&
!mesh_.is_boundary(v_it) ); !mesh_.is_boundary(*v_it) );
// smooth // smooth
...@@ -790,46 +789,46 @@ tangential_smoothing(bool _use_projection) ...@@ -790,46 +789,46 @@ tangential_smoothing(bool _use_projection)
{ {
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{ {
if (mesh_.status(v_it).tagged()) if (mesh_.status(*v_it).tagged())
{ {
u.vectorize(0.0); u.vectorize(0.0);
valence = 0; valence = 0;
for (vv_it=mesh_.cvv_iter(v_it); vv_it; ++vv_it) for (vv_it=mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it)
{ {
u += mesh_.point(vv_it); u += mesh_.point(*vv_it);
++valence; ++valence;
} }
if (valence) if (valence)
{ {
u *= (1.0/valence); u *= (1.0/valence);
u -= mesh_.point(v_it); u -= mesh_.point(*v_it);
n = mesh_.normal(v_it); n = mesh_.normal(*v_it);
n *= (u | n); n *= (u | n);
u -= n; u -= n;
} }
mesh_.property(update_, v_it) = u; mesh_.property(update_, *v_it) = u;
} }
} }
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
if (mesh_.status(v_it).tagged()) if (mesh_.status(*v_it).tagged())
mesh_.point(v_it) += mesh_.property(update_, v_it); mesh_.point(*v_it) += mesh_.property(update_, *v_it);
} }
// reset tagged status // reset tagged status
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
mesh_.status(v_it).set_tagged(false); mesh_.status(*v_it).set_tagged(false);
// project // project
if (_use_projection) if (_use_projection)
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
if (!mesh_.status(v_it).locked() && !mesh_.status(v_it).feature()) if (!mesh_.status(*v_it).locked() && !mesh_.status(*v_it).feature())
project_to_reference(v_it); project_to_reference(*v_it);
} }
...@@ -853,29 +852,29 @@ balanace_area(unsigned int _iters, bool _use_projection) ...@@ -853,29 +852,29 @@ balanace_area(unsigned int _iters, bool _use_projection)
// tag active vertices // tag active vertices
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{ {
bool active = ( !mesh_.status(v_it).locked() && bool active = ( !mesh_.status(*v_it).locked() &&
!mesh_.status(v_it).feature() && !mesh_.status(*v_it).feature() &&
!mesh_.is_boundary(v_it) ); !mesh_.is_boundary(*v_it) );
// don't move neighbors of boundary vertices // don't move neighbors of boundary vertices
for (vv_it=mesh_.cvv_iter(v_it); active && vv_it; ++vv_it) for (vv_it=mesh_.cvv_iter(*v_it); active && vv_it.is_valid(); ++vv_it)
if (mesh_.is_boundary(vv_it)) if (mesh_.is_boundary(*vv_it))
active = false; active = false;
mesh_.status(v_it).set_tagged( active ); mesh_.status(*v_it).set_tagged( active );
} }
// tag2 vertices for which area has to be computed // tag2 vertices for which area has to be computed
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{ {
mesh_.status(v_it).set_tagged2(false); mesh_.status(*v_it).set_tagged2(false);
for (vv_it=mesh_.cvv_iter(v_it); vv_it; ++vv_it)