diff --git a/Doc/Tutorial/07-traits/smooth.cc b/Doc/Tutorial/07-traits/smooth.cc index 47d9480d..b35013e7 100644 --- a/Doc/Tutorial/07-traits/smooth.cc +++ b/Doc/Tutorial/07-traits/smooth.cc @@ -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; } diff --git a/Doc/Tutorial/09-persistence/fill_props.hh b/Doc/Tutorial/09-persistence/fill_props.hh index 22c7bc5c..da34e30a 100644 --- a/Doc/Tutorial/09-persistence/fill_props.hh +++ b/Doc/Tutorial/09-persistence/fill_props.hh @@ -15,7 +15,7 @@ fill_props( Mesh& _m, OpenMesh::VPropHandleT _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 _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 _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 _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 _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 diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc index d40077ba..1ec1a7ab 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc @@ -164,7 +164,7 @@ MeshViewerWidgetT::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(mesh_.point(fv_it)); v *= 1.0f/3.0f; mesh_.property( fp_normal_base_, f_it ) = v; @@ -372,11 +372,11 @@ MeshViewerWidgetT::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::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::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::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(); diff --git a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc index 4a78bec9..c40f5287 100644 --- a/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc +++ b/src/OpenMesh/Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc @@ -198,7 +198,7 @@ drawFaces(bool _send_normals, OpenMesh::GenProg::Bool2Type) { 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) 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) 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); diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc index d3d98500..cd55f2f1 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc @@ -327,11 +327,11 @@ MeshViewerWidgetT::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::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::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(); diff --git a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc index 094a0269..2e03dfb6 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc @@ -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; diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc b/src/OpenMesh/Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc index aa0ea520..660483d0 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc @@ -326,11 +326,11 @@ MeshViewerWidgetT::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::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::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(); diff --git a/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc b/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc index 7d03a07a..c60578d0 100644 --- a/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc +++ b/src/OpenMesh/Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc @@ -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; diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc index 166dd6d2..f04848dd 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc @@ -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) diff --git a/src/OpenMesh/Core/IO/exporter/ExporterT.hh b/src/OpenMesh/Core/IO/exporter/ExporterT.hh index e14ee93c..abb68408 100644 --- a/src/OpenMesh/Core/IO/exporter/ExporterT.hh +++ b/src/OpenMesh/Core/IO/exporter/ExporterT.hh @@ -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; diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc index b10fa9ca..db314d77 100644 --- a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc +++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc @@ -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; diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.cc b/src/OpenMesh/Core/Mesh/PolyMeshT.cc index aef6c5ec..9c8420f6 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.cc +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.cc @@ -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(calc_face_normal(p0, p1, p2)); diff --git a/src/OpenMesh/Core/Mesh/TriConnectivity.cc b/src/OpenMesh/Core/Mesh/TriConnectivity.cc index a3489db8..4013327b 100644 --- a/src/OpenMesh/Core/Mesh/TriConnectivity.cc +++ b/src/OpenMesh/Core/Mesh/TriConnectivity.cc @@ -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; diff --git a/src/OpenMesh/Examples/Tutorial07/smooth.cc b/src/OpenMesh/Examples/Tutorial07/smooth.cc index 47d9480d..b35013e7 100644 --- a/src/OpenMesh/Examples/Tutorial07/smooth.cc +++ b/src/OpenMesh/Examples/Tutorial07/smooth.cc @@ -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; } diff --git a/src/OpenMesh/Examples/Tutorial10/fill_props.hh b/src/OpenMesh/Examples/Tutorial10/fill_props.hh index e99ec3a7..461bba8a 100644 --- a/src/OpenMesh/Examples/Tutorial10/fill_props.hh +++ b/src/OpenMesh/Examples/Tutorial10/fill_props.hh @@ -15,7 +15,7 @@ fill_props( Mesh& _m, OpenMesh::VPropHandleT _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 _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 _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 _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 _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 diff --git a/src/OpenMesh/Tools/Decimater/DecimaterT.cc b/src/OpenMesh/Tools/Decimater/DecimaterT.cc index 7cb090d3..0e17aaae 100644 --- a/src/OpenMesh/Tools/Decimater/DecimaterT.cc +++ b/src/OpenMesh/Tools/Decimater/DecimaterT.cc @@ -102,7 +102,7 @@ void DecimaterT::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::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::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; diff --git a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh index 765ad86a..1252264f 100644 --- a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh +++ b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh @@ -128,14 +128,14 @@ class ModRoundnessT : public ModBaseT if ( min_r_ < 0.0 ) // continues mode { C = vector_cast(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(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 else // binary mode { C = vector_cast(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(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; diff --git a/src/OpenMesh/Tools/Smoother/SmootherT.cc b/src/OpenMesh/Tools/Smoother/SmootherT.cc index d4b20456..41db991f 100644 --- a/src/OpenMesh/Tools/Smoother/SmootherT.cc +++ b/src/OpenMesh/Tools/Smoother/SmootherT.cc @@ -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() ) diff --git a/src/OpenMesh/Tools/Smoother/smooth_mesh.hh b/src/OpenMesh/Tools/Smoother/smooth_mesh.hh index 5dd3df71..eaf0ec9f 100644 --- a/src/OpenMesh/Tools/Smoother/smooth_mesh.hh +++ b/src/OpenMesh/Tools/Smoother/smooth_mesh.hh @@ -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()]; } } } diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RuleInterfaceT.hh b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RuleInterfaceT.hh index aeb7dc88..008417be 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RuleInterfaceT.hh +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RuleInterfaceT.hh @@ -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() ) { diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc index 4b2d9763..13564932 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc @@ -110,7 +110,7 @@ Tvv3::raise(typename M::FaceHandle& _fh, state_t _target_state) int valence(0); // raise all adjacent vertices to level x-1 - for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) { + for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) { vertex_vector.push_back(fv_it.handle()); } @@ -140,7 +140,7 @@ Tvv3::raise(typename M::FaceHandle& _fh, state_t _target_state) // calculate display position for new vertex for (vv_it = Base::mesh_.vv_iter(vh); vv_it; ++vv_it) { - position += Base::mesh_.point(vv_it.handle()); + position += Base::mesh_.point(*vv_it); ++valence; } @@ -156,24 +156,24 @@ Tvv3::raise(typename M::FaceHandle& _fh, state_t _target_state) // check for edge flipping for (voh_it = Base::mesh_.voh_iter(vh); voh_it; ++voh_it) { - if (Base::mesh_.FH(voh_it.handle()).is_valid()) { + if (Base::mesh_.FH(*voh_it).is_valid()) { - MOBJ(Base::mesh_.FH(voh_it.handle())).set_state(_target_state); - MOBJ(Base::mesh_.FH(voh_it.handle())).set_not_final(); - MOBJ(Base::mesh_.FH(voh_it.handle())).set_position(_target_state - 1, face_position); + MOBJ(Base::mesh_.FH(*voh_it)).set_state(_target_state); + MOBJ(Base::mesh_.FH(*voh_it)).set_not_final(); + MOBJ(Base::mesh_.FH(*voh_it)).set_position(_target_state - 1, face_position); for (state_t j = 0; j < _target_state; ++j) { - MOBJ(Base::mesh_.FH(voh_it.handle())).set_position(j, MOBJ(_fh).position(j)); + MOBJ(Base::mesh_.FH(*voh_it)).set_position(j, MOBJ(_fh).position(j)); } - if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) { + if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) { - if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))).state() == _target_state) { + if (MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).state() == _target_state) { - if (Base::mesh_.is_flip_ok(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle())))) { + if (Base::mesh_.is_flip_ok(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it)))) { - edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))); + edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))); } } } @@ -346,7 +346,7 @@ Tvv4::raise(typename M::FaceHandle& _fh, state_t _target_state) std::vector halfedge_vector; // raise all adjacent vertices to level x-1 - for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) { + for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) { vertex_vector.push_back(fv_it.handle()); } @@ -824,7 +824,7 @@ void VF::raise(typename M::FaceHandle& _fh, state_t _target_state) if (_target_state > 1) { - for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) { + for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) { vertex_vector.push_back(fv_it.handle()); } @@ -842,7 +842,7 @@ void VF::raise(typename M::FaceHandle& _fh, state_t _target_state) typename M::Point position(0.0, 0.0, 0.0); int valence(0); - for (fv_it = Base::mesh_.fv_iter(_fh); fv_it; ++fv_it) { + for (fv_it = Base::mesh_.fv_iter(_fh); fv_it.is_valid(); ++fv_it) { ++valence; position += Base::mesh_.data(fv_it).position(_target_state - 1); @@ -1084,13 +1084,13 @@ void FVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - if (Base::mesh_.FH(voh_it.handle()).is_valid()) { + if (Base::mesh_.FH(*voh_it).is_valid()) { - face_vector.push_back(Base::mesh_.FH(voh_it.handle())); + face_vector.push_back(Base::mesh_.FH(*voh_it)); - if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) { + if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) { - face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))); + face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))); } } } @@ -1105,13 +1105,13 @@ void FVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - if (Base::mesh_.FH(voh_it.handle()).is_valid()) { + if (Base::mesh_.FH(*voh_it).is_valid()) { - face_vector.push_back(Base::mesh_.FH(voh_it.handle())); + face_vector.push_back(Base::mesh_.FH(*voh_it)); - if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) { + if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) { - face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))); + face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))); } } } @@ -1127,13 +1127,13 @@ void FVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - if (Base::mesh_.FH(voh_it.handle()).is_valid()) { + if (Base::mesh_.FH(*voh_it).is_valid()) { - face_vector.push_back(Base::mesh_.FH(voh_it.handle())); + face_vector.push_back(Base::mesh_.FH(*voh_it)); - if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) { + if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) { - face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))); + face_vector.push_back(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))); } } } @@ -1170,25 +1170,25 @@ void FVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - fh = Base::mesh_.FH(voh_it.handle()); + fh = Base::mesh_.FH(*voh_it); if (fh.is_valid()) Base::prev_rule()->raise(fh, _target_state - 1); - fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))); + fh = Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))); if (fh.is_valid()) Base::prev_rule()->raise(fh, _target_state - 1); - if (Base::mesh_.FH(voh_it.handle()).is_valid()) { + if (Base::mesh_.FH(*voh_it).is_valid()) { - if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle()))).is_valid()) { + if (Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it))).is_valid()) { - position += MOBJ(Base::mesh_.FH(voh_it.handle())).position(_target_state - 1) * c; + position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1) * c; - position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(voh_it.handle())))).position(_target_state - 1) * (1.0 - c); + position += MOBJ(Base::mesh_.FH(Base::mesh_.OHEH(Base::mesh_.NHEH(*voh_it)))).position(_target_state - 1) * (1.0 - c); } else { - position += MOBJ(Base::mesh_.FH(voh_it.handle())).position(_target_state - 1); + position += MOBJ(Base::mesh_.FH(*voh_it)).position(_target_state - 1); } } @@ -1256,7 +1256,7 @@ void VV::raise(typename M::VertexHandle& _vh, state_t _target_state) for (; vv_it; ++vv_it) { - vertex_vector.push_back(vv_it.handle()); + vertex_vector.push_back(*vv_it); } while (!vertex_vector.empty()) { @@ -1269,7 +1269,7 @@ void VV::raise(typename M::VertexHandle& _vh, state_t _target_state) for (; vv_it; ++vv_it) { - vertex_vector.push_back(vv_it.handle()); + vertex_vector.push_back(*vv_it); } while (!vertex_vector.empty()) { @@ -1326,7 +1326,7 @@ void VVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (; vv_it; ++vv_it) { - vertex_vector.push_back(vv_it.handle()); + vertex_vector.push_back(*vv_it); } while (!vertex_vector.empty()) { @@ -1339,7 +1339,7 @@ void VVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (; vv_it; ++vv_it) { - vertex_vector.push_back(vv_it.handle()); + vertex_vector.push_back(*vv_it); } while (!vertex_vector.empty()) { @@ -1673,7 +1673,7 @@ void EVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - face_vector.push_back(Base::mesh_.FH(voh_it.handle())); + face_vector.push_back(Base::mesh_.FH(*voh_it)); } while (!face_vector.empty()) { @@ -1687,9 +1687,9 @@ void EVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - edge_vector.push_back(Base::mesh_.EH(voh_it.handle())); + edge_vector.push_back(Base::mesh_.EH(*voh_it)); - edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))); + edge_vector.push_back(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))); } while (!edge_vector.empty()) { @@ -1714,18 +1714,18 @@ void EVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (voh_it = Base::mesh_.voh_iter(_vh); voh_it; ++voh_it) { - if (MOBJ(Base::mesh_.EH(voh_it.handle())).final()) + if (MOBJ(Base::mesh_.EH(*voh_it)).final()) { - position += MOBJ(Base::mesh_.EH(voh_it.handle())).position(_target_state-1)*c; + position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state-1)*c; - if ( Base::mesh_.FH(voh_it.handle()).is_valid() && - MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).final() && - MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).position(_target_state - 1) != zero_point) + if ( Base::mesh_.FH(*voh_it).is_valid() && + MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).final() && + MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state - 1) != zero_point) { - position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(voh_it.handle()))).position(_target_state-1) * (1.0-c); + position += MOBJ(Base::mesh_.EH(Base::mesh_.NHEH(*voh_it))).position(_target_state-1) * (1.0-c); } else { - position += MOBJ(Base::mesh_.EH(voh_it.handle())).position(_target_state - 1) * (1.0 - c); + position += MOBJ(Base::mesh_.EH(*voh_it)).position(_target_state - 1) * (1.0 - c); } } else { diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc index d509a7d9..fd61f144 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc @@ -297,7 +297,7 @@ void CompositeT::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::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::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::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::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 { - cog += mesh_.deref(mesh_.face_handle(voh_it.handle())).position(); + cog += mesh_.deref(mesh_.face_handle(*voh_it)).position(); } } else { --valence; @@ -897,8 +897,8 @@ void CompositeT::EVc(Coeff& _coeff) c = _coeff(valence); for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) { - cog += mesh_.data(mesh_.edge_handle(voh_it.handle())).position() * c; - cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).position() * (1.0 - c); + cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * c; + cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - c); } cog /= valence; @@ -927,8 +927,8 @@ void CompositeT::EVc(scalar_t _c) } for (voh_it = mesh_.voh_iter(v_it.handle()); voh_it; ++voh_it) { - cog += mesh_.data(mesh_.edge_handle(voh_it.handle())).position() * _c; - cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(voh_it.handle()))).position() * (1.0 - _c); + cog += mesh_.data(mesh_.edge_handle(*voh_it)).position() * _c; + cog += mesh_.data(mesh_.edge_handle(mesh_.next_halfedge_handle(*voh_it))).position() * (1.0 - _c); } cog /= valence; diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh index e1ad883f..bb43403b 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh @@ -183,7 +183,7 @@ protected: _m.split(a.first,newVertex); for ( typename MeshType::VertexOHalfedgeIter voh_it(_m,newVertex); voh_it; ++voh_it) { - typename MeshType::EdgeHandle eh = _m.edge_handle(voh_it.handle()); + typename MeshType::EdgeHandle eh = _m.edge_handle(*voh_it); const typename MeshType::Point to = _m.point(_m.to_vertex_handle(voh_it)); const typename MeshType::Point from = _m.point(_m.from_vertex_handle(voh_it)); real_t length = (to - from).sqrnorm();