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

First set of changes to the new circulators

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@898 fdac6126-5c0c-442c-9429-916003d36597
parent 1c8d4fb5
......@@ -102,7 +102,7 @@ int main(int argc, char **argv)
for (vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it)
{
cog += mesh.point( vv_it.handle() );
cog += mesh.point( *vv_it );
++valence;
}
......
......@@ -15,7 +15,7 @@ fill_props( Mesh& _m, OpenMesh::VPropHandleT<float> _ph, bool _check=false)
for(typename Mesh::VertexIter it=_m.vertices_begin();
it != _m.vertices_end(); ++it)
{
v = a[it.handle().idx()%9];
v = a[it->idx()%9];
if ( _check && !(_m.property( _ph, it ) == v) )
return false;
else
......@@ -34,7 +34,7 @@ fill_props( Mesh& _m, OpenMesh::EPropHandleT<bool> _ph, bool _check=false )
for( typename Mesh::EdgeIter it=_m.edges_begin();
it != _m.edges_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
v = ((n&(n-1))==0); // true for 0,1,2,4,8,..
if (_check && _m.property( _ph, it ) != v)
......@@ -62,7 +62,7 @@ fill_props(Mesh& _m, OpenMesh::FPropHandleT<std::string> _ph, bool _check=false)
for( typename Mesh::FaceIter it=_m.faces_begin();
it != _m.faces_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
_m.property( _ph, it ) = int2roman(++n);
}
return true;
......@@ -85,9 +85,9 @@ fill_props( Mesh& _m, OpenMesh::HPropHandleT<T> _ph, bool _check=false)
for( typename Mesh::HalfedgeIter it=_m.halfedges_begin();
it != _m.halfedges_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
v = it.handle().idx()+1; // ival
v = it->idx()+1; // ival
v = values[n%9]; // dval
v = ((n&(n-1))==0); // bval
v.vec4fval[0] = a[n%9];
......@@ -110,7 +110,7 @@ fill_props( Mesh& _m, OpenMesh::MPropHandleT<T> _ph, bool _check=false)
size_t idx;
for( typename Mesh::FaceIter it=_m.faces_begin(); it != _m.faces_end(); ++it)
{
idx = it.handle().idx();
idx = it->idx();
if ( _check && _m.property( _ph )[int2roman(idx+1)] != idx )
return false;
else
......
......@@ -164,7 +164,7 @@ MeshViewerWidgetT<M>::open_mesh(const char* _filename, IO::Options _opt)
for (;f_it != mesh_.faces_end(); ++f_it)
{
typename Mesh::Point v(0,0,0);
for( fv_it=mesh_.fv_iter(f_it); fv_it; ++fv_it)
for( fv_it=mesh_.fv_iter(f_it); fv_it.is_valid(); ++fv_it)
v += OpenMesh::vector_cast<typename Mesh::Normal>(mesh_.point(fv_it));
v *= 1.0f/3.0f;
mesh_.property( fp_normal_base_, f_it ) = v;
......@@ -372,11 +372,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -408,11 +408,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -436,11 +436,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glColor( fIt.handle() );
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -463,11 +463,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glMaterial( fIt.handle() );
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......
......@@ -198,7 +198,7 @@ drawFaces(bool _send_normals, OpenMesh::GenProg::Bool2Type<false>)
{
glBegin(GL_POLYGON);
glNormal(mesh_->normal(f_it));
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it; ++fv_it)
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it.is_valid() ++fv_it)
glVertex(mesh_->point(fv_it));
glEnd();
}
......@@ -208,7 +208,7 @@ drawFaces(bool _send_normals, OpenMesh::GenProg::Bool2Type<false>)
for (; f_it!=f_end; ++f_it)
{
glBegin(GL_POLYGON);
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it; ++fv_it)
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it.is_valid() ++fv_it)
glVertex(mesh_->point(fv_it));
glEnd();
}
......@@ -290,7 +290,7 @@ genPrimitives(SoAction* _action, OpenMesh::GenProg::Bool2Type<false>)
pv.setNormal(sbvec3f(mesh_->normal(f_it)));
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it; ++fv_it)
for (fv_it=mesh_->cfv_iter(f_it.handle()); fv_it.is_valid() ++fv_it)
{
pv.setPoint(sbvec3f(mesh_->point(fv_it)));
shapeVertex(&pv);
......
......@@ -327,11 +327,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -363,11 +363,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -391,11 +391,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glColor( fIt.handle() );
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......
......@@ -380,18 +380,18 @@ get_active_cuts(const VHierarchyNodeHandle _node_handle, MyMesh::VertexHandle &v
for (vv_it=mesh_.vv_iter(vhierarchy_.vertex_handle(_node_handle)); vv_it; ++vv_it)
{
nnode_handle = mesh_.data(vv_it.handle()).vhierarchy_node_handle();
nnode_handle = mesh_.data(*vv_it).vhierarchy_node_handle();
nnode_index = vhierarchy_.node_index(nnode_handle);
if (vl == MyMesh::InvalidVertexHandle && vhierarchy_.is_ancestor(nnode_index, fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == MyMesh::InvalidVertexHandle && vhierarchy_.is_ancestor(nnode_index, fund_rcut_index) == true)
vr = vv_it.handle();
vr = *vv_it;
/*if (vl == MyMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == MyMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_rcut_index) == true)
vr = vv_it.handle();*/
vr = *vv_it;*/
if (vl != MyMesh::InvalidVertexHandle && vr != MyMesh::InvalidVertexHandle)
break;
......
......@@ -326,11 +326,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -362,11 +362,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
for (; fIt!=fEnd; ++fIt)
{
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......@@ -390,11 +390,11 @@ MeshViewerWidgetT<M>::draw_openmesh(const std::string& _draw_mode)
glColor( fIt.handle() );
fvIt = mesh_.cfv_iter(fIt.handle());
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
++fvIt;
glArrayElement(fvIt.handle().idx());
glArrayElement(fvIt->idx());
}
glEnd();
......
......@@ -379,18 +379,18 @@ get_active_cuts(const VHierarchyNodeHandle _node_handle, MyMesh::VertexHandle &v
for (vv_it=mesh_.vv_iter(vhierarchy_.vertex_handle(_node_handle)); vv_it; ++vv_it)
{
nnode_handle = mesh_.data(vv_it.handle()).vhierarchy_node_handle();
nnode_handle = mesh_.data(*vv_it).vhierarchy_node_handle();
nnode_index = vhierarchy_.node_index(nnode_handle);
if (vl == MyMesh::InvalidVertexHandle && vhierarchy_.is_ancestor(nnode_index, fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == MyMesh::InvalidVertexHandle && vhierarchy_.is_ancestor(nnode_index, fund_rcut_index) == true)
vr = vv_it.handle();
vr = *vv_it;
/*if (vl == MyMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == MyMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_rcut_index) == true)
vr = vv_it.handle();*/
vr = *vv_it;*/
if (vl != MyMesh::InvalidVertexHandle && vr != MyMesh::InvalidVertexHandle)
break;
......
......@@ -293,21 +293,21 @@ get_active_cuts(const VHierarchyNodeHandle _node_handle,
for (vv_it=mesh_.vv_iter(vhierarchy_.vertex_handle(_node_handle));
vv_it; ++vv_it)
{
nnode_handle = mesh_.data(vv_it.handle()).vhierarchy_node_handle();
nnode_handle = mesh_.data(*vv_it).vhierarchy_node_handle();
nnode_index = vhierarchy_.node_index(nnode_handle);
if (vl == VDPMMesh::InvalidVertexHandle &&
vhierarchy_.is_ancestor(nnode_index, fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == VDPMMesh::InvalidVertexHandle &&
vhierarchy_.is_ancestor(nnode_index, fund_rcut_index) == true)
vr = vv_it.handle();
vr = *vv_it;
/*if (vl == VDPMMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_lcut_index) == true)
vl = vv_it.handle();
vl = *vv_it;
if (vr == VDPMMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_rcut_index) == true)
vr = vv_it.handle();*/
vr = *vv_it;*/
if (vl != VDPMMesh::InvalidVertexHandle &&
vr != VDPMMesh::InvalidVertexHandle)
......
......@@ -208,7 +208,7 @@ public:
{
unsigned int count(0);
_vhandles.clear();
for (typename Mesh::CFVIter fv_it=mesh_.cfv_iter(_fh); fv_it; ++fv_it)
for (typename Mesh::CFVIter fv_it=mesh_.cfv_iter(_fh); fv_it.is_valid(); ++fv_it)
{
_vhandles.push_back(fv_it.handle());
++count;
......
......@@ -401,8 +401,8 @@ bool PolyConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
{
if (status(vv_it).tagged() &&
!(vv_it.handle() == v_01_n && v0v1_triangle) &&
!(vv_it.handle() == v_10_n && v1v0_triangle)
!(*vv_it == v_01_n && v0v1_triangle) &&
!(*vv_it == v_10_n && v1v0_triangle)
)
{
return false;
......
......@@ -106,7 +106,7 @@ calc_face_normal(FaceHandle _fh) const
//calculate area-weighted average normal of polygon's ears
Normal n(0,0,0);
for(; fv_it; ++fv_it)
for(; fv_it.is_valid(); ++fv_it)
{
p2 = this->point(fv_it);
n += vector_cast<Normal>(calc_face_normal(p0, p1, p2));
......
......@@ -160,7 +160,7 @@ bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1)
status(vv_it).set_tagged(true);
for (vv_it = vv_iter(v0); vv_it; ++vv_it)
if (status(vv_it).tagged() && vv_it.handle() != vl && vv_it.handle() != vr)
if (status(vv_it).tagged() && *vv_it != vl && *vv_it != vr)
return false;
......
......@@ -102,7 +102,7 @@ int main(int argc, char **argv)
for (vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it)
{
cog += mesh.point( vv_it.handle() );
cog += mesh.point( *vv_it );
++valence;
}
......
......@@ -15,7 +15,7 @@ fill_props( Mesh& _m, OpenMesh::VPropHandleT<float> _ph, bool _check=false)
for(typename Mesh::VertexIter it=_m.vertices_begin();
it != _m.vertices_end(); ++it)
{
v = a[it.handle().idx()%9];
v = a[it->idx()%9];
if ( _check && !(_m.property( _ph, it ) == v) )
return false;
else
......@@ -34,7 +34,7 @@ fill_props( Mesh& _m, OpenMesh::EPropHandleT<bool> _ph, bool _check=false )
for( typename Mesh::EdgeIter it=_m.edges_begin();
it != _m.edges_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
v = ((n&(n-1))==0); // true for 0,1,2,4,8,..
if (_check && _m.property( _ph, it ) != v)
......@@ -62,7 +62,7 @@ fill_props(Mesh& _m, OpenMesh::FPropHandleT<std::string> _ph, bool _check=false)
for( typename Mesh::FaceIter it=_m.faces_begin();
it != _m.faces_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
_m.property( _ph, it ) = int2roman(++n);
}
return true;
......@@ -85,9 +85,9 @@ fill_props( Mesh& _m, OpenMesh::HPropHandleT<T> _ph, bool _check=false)
for( typename Mesh::HalfedgeIter it=_m.halfedges_begin();
it != _m.halfedges_end(); ++it)
{
n = it.handle().idx();
n = it->idx();
// v = it.handle().idx()+1; // ival
// v = it->idx()+1; // ival
// v = values[n%9]; // dval
v = ((n&(n-1))==0); // bval
v.vec4fval[0] = a[n%9];
......@@ -110,7 +110,7 @@ fill_props( Mesh& _m, OpenMesh::MPropHandleT<T> _ph, bool _check=false)
size_t idx;
for( typename Mesh::FaceIter it=_m.faces_begin(); it != _m.faces_end(); ++it)
{
idx = it.handle().idx();
idx = it->idx();
if ( _check && _m.property( _ph )[int2roman(idx+1)] != idx )
return false;
else
......
......@@ -102,7 +102,7 @@ void DecimaterT<Mesh>::heap_vertex(VertexHandle _vh) {
// find best target in one ring
typename Mesh::VertexOHalfedgeIter voh_it(mesh_, _vh);
for (; voh_it; ++voh_it) {
heh = voh_it.handle();
heh = *voh_it;
CollapseInfo ci(mesh_, heh);
if (this->is_collapse_legal(ci)) {
......@@ -190,7 +190,7 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
vv_it = mesh_.vv_iter(ci.v0);
support.clear();
for (; vv_it; ++vv_it)
support.push_back(vv_it.handle());
support.push_back(*vv_it);
// perform collapse
mesh_.collapse(v0v1);
......@@ -276,7 +276,7 @@ size_t DecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
vv_it = mesh_.vv_iter(ci.v0);
support.clear();
for (; vv_it; ++vv_it)
support.push_back(vv_it.handle());
support.push_back(*vv_it);
// adjust complexity in advance (need boundary status)
++n_collapses;
......
......@@ -128,14 +128,14 @@ class ModRoundnessT : public ModBaseT<MeshT>
if ( min_r_ < 0.0 ) // continues mode
{
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
fhC = Base::mesh().face_handle( voh_it.handle() );
fhC = Base::mesh().face_handle( *voh_it );
for (++voh_it; voh_it; ++voh_it)
{
B = C;
fhB = fhC;
C = vector_cast<Vec3f>(Base::mesh().point(Base::mesh().to_vertex_handle(voh_it)));
fhC = Base::mesh().face_handle( voh_it.handle() );
fhC = Base::mesh().face_handle( *voh_it );
if ( fhB == _ci.fl || fhB == _ci.fr )
continue;
......@@ -151,14 +151,14 @@ class ModRoundnessT : public ModBaseT<MeshT>
else // binary mode
{
C = vector_cast<Vec3f>(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it)));
fhC = Base::mesh().face_handle( voh_it.handle() );
fhC = Base::mesh().face_handle( *voh_it );
for (++voh_it; voh_it && (priority==Base::LEGAL_COLLAPSE); ++voh_it)
{
B = C;
fhB = fhC;
C = vector_cast<Vec3f>(Base::mesh().point(Base::mesh().to_vertex_handle(voh_it)));
fhC = Base::mesh().face_handle( voh_it.handle() );
fhC = Base::mesh().face_handle( *voh_it );
if ( fhB == _ci.fl || fhB == _ci.fr )
continue;
......
......@@ -175,11 +175,11 @@ set_active_vertices()
for ( ; voh_it ; ++voh_it ) {
// If the edge is a feature edge, skip the current vertex while smoothing
if ( mesh_.status(mesh_.edge_handle(voh_it.handle())).feature() )
if ( mesh_.status(mesh_.edge_handle(*voh_it)).feature() )
active = false;
typename Mesh::FaceHandle fh1 = mesh_.face_handle(voh_it.handle() );
typename Mesh::FaceHandle fh2 = mesh_.face_handle(mesh_.opposite_halfedge_handle(voh_it.handle() ) );
typename Mesh::FaceHandle fh1 = mesh_.face_handle(*voh_it );
typename Mesh::FaceHandle fh2 = mesh_.face_handle(mesh_.opposite_halfedge_handle(*voh_it ) );
// If one of the faces is a feature, lock current vertex
if ( fh1.is_valid() && mesh_.status( fh1 ).feature() )
......
......@@ -64,7 +64,7 @@ void smooth_mesh_property(unsigned int _n_iters, _Mesh& _m, _PropertyHandle _pph
{
unsigned int valence = 0;
Value& temp_value = temp_values[cv_it.handle().idx()];
Value& temp_value = temp_values[cv_it->idx()];
temp_value.vectorize(0);
......@@ -87,7 +87,7 @@ void smooth_mesh_property(unsigned int _n_iters, _Mesh& _m, _PropertyHandle _pph
for ( typename _Mesh::ConstVertexIter cv_it = _m.vertices_begin();
cv_it != _m.vertices_end(); ++cv_it)
{
_m.property(_pph,cv_it) = temp_values[cv_it.handle().idx()];
_m.property(_pph,cv_it) = temp_values[cv_it->idx()];
}
}
}
......
......@@ -243,7 +243,7 @@ public:
prev_rule()->raise(eh, _target_state - 1);
}
for (fv_it = mesh_.fv_iter(_fh); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) {
vh = fv_it.handle();
prev_rule()->raise(vh, _target_state - 1);
......@@ -305,7 +305,7 @@ public:
{
for (voh_it = mesh_.voh_iter(_vh); voh_it; ++voh_it) {
halfedge_vector.push_back(voh_it.handle());
halfedge_vector.push_back(*voh_it);
}
while ( !halfedge_vector.empty() ) {
......@@ -316,7 +316,7 @@ public:
}
for (voh_it = mesh_.voh_iter(_vh); voh_it; ++voh_it) {
halfedge_vector.push_back(voh_it.handle());
halfedge_vector.push_back(*voh_it);
}
while ( !halfedge_vector.empty() ) {
......
......@@ -297,7 +297,7 @@ void CompositeT<MeshType,RealType>::VF()
valence = 0;
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
cog += mesh_.data(fv_it).position();
++valence;
}
......@@ -352,7 +352,7 @@ void CompositeT<MeshType,RealType>::VFa(Coeff& _coeff)
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
if (fv_it.handle() == vh[i]) {
cog += fv_it->position() * alpha;
} else {
......@@ -407,7 +407,7 @@ void CompositeT<MeshType,RealType>::VFa(scalar_t _alpha)
cog = zero_point;
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it; ++fv_it) {
for (fv_it = mesh_.fv_iter(f_it.handle()); fv_it.is_valid(); ++fv_it) {
if (fv_it.handle() == vh[i]) {
cog += fv_it->position() * _alpha;
} else {
......@@ -586,13 +586,13 @@ void CompositeT<MeshType,RealType>::FVc(Coeff& _coeff)
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
if (mesh_.face_handle(voh_it.handle()).is_valid()) {
if (mesh_.face_handle(*voh_it).is_valid()) {
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).is_valid()) {
cog += mesh_.data(mesh_.face_handle(voh_it.handle())).position() * c;
cog += mesh_.data(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle())))).position() * (1.0 - c);
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it))).is_valid()) {
cog += mesh_.data(mesh_.face_handle(*voh_it)).position() * c;
cog += mesh_.data(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it)))).position() * (1.0 - c);
} else {
cog += mesh_.data(mesh_.face_handle(voh_it.handle())).position();
cog += mesh_.data(mesh_.face_handle(*voh_it)).position();
}
} else {
--valence;
......@@ -629,13 +629,13 @@ void CompositeT<MeshType,RealType>::FVc(scalar_t _c)
for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) {
if (mesh_.face_handle(voh_it.handle()).is_valid()) {
if (mesh_.face_handle(*voh_it).is_valid()) {
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).is_valid()) {
cog += mesh_.deref(mesh_.face_handle(voh_it.handle())).position() * _c;
cog += mesh_.deref(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(voh_it.handle())))).position() * (1.0 - _c);
if (mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it))).is_valid()) {
cog += mesh_.deref(mesh_.face_handle(*voh_it)).position() * _c;
cog += mesh_.deref(mesh_.face_handle(mesh_.opposite_halfedge_handle(mesh_.next_halfedge_handle(*voh_it)))).position() * (1.0 - _c);
} else {