diff --git a/Doc/Tutorial/07-traits/smooth.cc b/Doc/Tutorial/07-traits/smooth.cc index b35013e7..a68a1a33 100644 --- a/Doc/Tutorial/07-traits/smooth.cc +++ b/Doc/Tutorial/07-traits/smooth.cc @@ -100,7 +100,7 @@ int main(int argc, char **argv) { cog[0] = cog[1] = cog[2] = valence = 0.0; - for (vv_it=mesh.vv_iter(v_it.handle()); vv_it; ++vv_it) + for (vv_it=mesh.vv_iter(*v_it); vv_it; ++vv_it) { cog += mesh.point( *vv_it ); ++valence; @@ -110,8 +110,8 @@ int main(int argc, char **argv) } for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it) - if (!mesh.is_boundary(v_it.handle())) - mesh.set_point( v_it.handle(), mesh.data(v_it).cog()); + if (!mesh.is_boundary(*v_it)) + mesh.set_point( *v_it, mesh.data(*v_it).cog()); } diff --git a/Doc/mesh.docu b/Doc/mesh.docu index cd0f1755..98ee2a69 100644 --- a/Doc/mesh.docu +++ b/Doc/mesh.docu @@ -786,7 +786,7 @@ This example shows how to iterate over all faces of a mesh: MyMesh mesh; for(MyMesh::FaceIter f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) { - std::cout << "The face's valence is " << mesh.valence( f_it.handle() ) << std::endl; + std::cout << "The face's valence is " << mesh.valence( *f_it ) << std::endl; } \endcode @@ -890,7 +890,7 @@ MyMesh mesh; MyMesh::FaceHalfedgeIter fh_it = mesh.fh_iter(faceHandle); for(; fh_it; ++fh_it) { - std::cout << "Halfedge has handle " << fh_it.handle() << std::endl; + std::cout << "Halfedge has handle " << *fh_it << std::endl; } \endcode diff --git a/Doc/operations.docu b/Doc/operations.docu index 991d14e8..7d3db28e 100644 --- a/Doc/operations.docu +++ b/Doc/operations.docu @@ -50,9 +50,9 @@ mesh.add_face(face_vhandles); // Find this edge and then flip it for(TriMesh::EdgeIter it = mesh.edges_begin(); it != mesh.edges_end(); ++it) { - if(!mesh.is_boundary(it.handle())) { + if(!mesh.is_boundary(*it)) { // Flip edge - mesh.flip(it.handle()); + mesh.flip(*it); } } @@ -116,11 +116,11 @@ mesh.add_face(face_vhandles); // and vhandle[3] for(PolyMesh::HalfedgeIter it = mesh.halfedges_begin(); it != mesh.halfedges_end(); ++it) { - if(to_vertex_handle(it.handle()) == vhandle[3] && - from_vertex_handle(it.handle()) == vhandle[2]) { + if(to_vertex_handle(*it) == vhandle[3] && + from_vertex_handle(*it) == vhandle[2]) { // Collapse edge - mesh.collapse(it.handle()); + mesh.collapse(*it); break; } } diff --git a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc index 55e181e9..2fa470b3 100644 --- a/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc +++ b/src/OpenMesh/Apps/QtViewer/MeshViewerWidgetT.cc @@ -134,12 +134,12 @@ MeshViewerWidgetT::open_mesh(const char* _filename, IO::Options _opt) Vec3f bbMin, bbMax; - bbMin = bbMax = OpenMesh::vector_cast(mesh_.point(vIt)); + bbMin = bbMax = OpenMesh::vector_cast(mesh_.point(*vIt)); for (size_t count=0; vIt!=vEnd; ++vIt, ++count) { - bbMin.minimize( OpenMesh::vector_cast(mesh_.point(vIt))); - bbMax.maximize( OpenMesh::vector_cast(mesh_.point(vIt))); + bbMin.minimize( OpenMesh::vector_cast(mesh_.point(*vIt))); + bbMax.maximize( OpenMesh::vector_cast(mesh_.point(*vIt))); } @@ -164,10 +164,10 @@ 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.is_valid(); ++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; + mesh_.property( fp_normal_base_, *f_it ) = v; } t.stop(); std::clog << "Computed base point for displaying face normals [" @@ -337,7 +337,7 @@ MeshViewerWidgetT::draw_openmesh(const std::string& _draw_mode) glBegin(GL_TRIANGLES); for (; fIt!=fEnd; ++fIt) { - glNormal3fv( &mesh_.normal(fIt)[0] ); + glNormal3fv( &mesh_.normal(*fIt)[0] ); fvIt = mesh_.cfv_iter(*fIt); glVertex3fv( &mesh_.point(*fvIt)[0] ); @@ -665,8 +665,8 @@ MeshViewerWidgetT::draw_scene(const std::string& _draw_mode) glColor3f(1.000f, 0.803f, 0.027f); // orange for(vit=mesh_.vertices_begin(); vit!=mesh_.vertices_end(); ++vit) { - glVertex( vit ); - glVertex( mesh_.point( vit ) + normal_scale_*mesh_.normal( vit ) ); + glVertex( *vit ); + glVertex( mesh_.point( *vit ) + normal_scale_*mesh_.normal( *vit ) ); } glEnd(); } @@ -679,9 +679,9 @@ MeshViewerWidgetT::draw_scene(const std::string& _draw_mode) glColor3f(0.705f, 0.976f, 0.270f); // greenish for(fit=mesh_.faces_begin(); fit!=mesh_.faces_end(); ++fit) { - glVertex( mesh_.property(fp_normal_base_, fit) ); - glVertex( mesh_.property(fp_normal_base_, fit) + - normal_scale_*mesh_.normal( fit ) ); + glVertex( mesh_.property(fp_normal_base_, *fit) ); + glVertex( mesh_.property(fp_normal_base_, *fit) + + normal_scale_*mesh_.normal( *fit ) ); } glEnd(); } diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc index f04848dd..bac9e9ad 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc @@ -289,19 +289,19 @@ get_active_cuts(const VHierarchyNodeHandle _node_handle, vl = VDPMMesh::InvalidVertexHandle; vr = VDPMMesh::InvalidVertexHandle; - + for (vv_it=mesh_.vv_iter(vhierarchy_.vertex_handle(_node_handle)); - vv_it; ++vv_it) + vv_it.is_valid(); ++vv_it) { 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) + vhierarchy_.is_ancestor(nnode_index, fund_lcut_index) == true) vl = *vv_it; if (vr == VDPMMesh::InvalidVertexHandle && - vhierarchy_.is_ancestor(nnode_index, fund_rcut_index) == true) + vhierarchy_.is_ancestor(nnode_index, fund_rcut_index) == true) vr = *vv_it; /*if (vl == VDPMMesh::InvalidVertexHandle && nnode_index.is_ancestor_index(fund_lcut_index) == true) @@ -310,7 +310,7 @@ get_active_cuts(const VHierarchyNodeHandle _node_handle, vr = *vv_it;*/ if (vl != VDPMMesh::InvalidVertexHandle && - vr != VDPMMesh::InvalidVertexHandle) + vr != VDPMMesh::InvalidVertexHandle) break; } } diff --git a/src/OpenMesh/Tools/Decimater/DecimaterT.cc b/src/OpenMesh/Tools/Decimater/DecimaterT.cc index 4c1c41b0..ad29ea8b 100644 --- a/src/OpenMesh/Tools/Decimater/DecimaterT.cc +++ b/src/OpenMesh/Tools/Decimater/DecimaterT.cc @@ -167,7 +167,7 @@ size_t DecimaterT::decimate(size_t _n_collapses) { heap_->reserve(mesh_.n_vertices()); for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) { - heap_->reset_heap_position(v_it.handle()); + heap_->reset_heap_position(*v_it); if (!mesh_.status(*v_it).deleted()) heap_vertex(*v_it); } @@ -253,9 +253,9 @@ size_t DecimaterT::decimate_to_faces(size_t _nv, size_t _nf) { heap_->reserve(mesh_.n_vertices()); for (v_it = mesh_.vertices_begin(); v_it != v_end; ++v_it) { - heap_->reset_heap_position(v_it.handle()); + heap_->reset_heap_position(*v_it); if (!mesh_.status(v_it).deleted()) - heap_vertex(v_it.handle()); + heap_vertex(*v_it); } // process heap @@ -295,8 +295,8 @@ size_t DecimaterT::decimate_to_faces(size_t _nv, size_t _nf) { // update triangle normals vf_it = mesh_.vf_iter(ci.v1); for (; vf_it; ++vf_it) - if (!mesh_.status(vf_it).deleted()) - mesh_.set_normal(vf_it, mesh_.calc_face_normal(vf_it.handle())); + if (!mesh_.status(*vf_it).deleted()) + mesh_.set_normal(*vf_it, mesh_.calc_face_normal(*vf_it)); // post-process collapse this->postprocess_collapse(ci); diff --git a/src/OpenMesh/Tools/Decimater/ModQuadricT.cc b/src/OpenMesh/Tools/Decimater/ModQuadricT.cc index fea291b9..cbc95c9a 100644 --- a/src/OpenMesh/Tools/Decimater/ModQuadricT.cc +++ b/src/OpenMesh/Tools/Decimater/ModQuadricT.cc @@ -80,7 +80,7 @@ initialize() v_end = Base::mesh().vertices_end(); for (; v_it != v_end; ++v_it) - Base::mesh().property(quadrics_, v_it).clear(); + Base::mesh().property(quadrics_, *v_it).clear(); // calc (normal weighted) quadric typename Mesh::FaceIter f_it = Base::mesh().faces_begin(), diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc index a4cf5967..81fb590d 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.cc @@ -124,7 +124,7 @@ CatmullClarkT::subdivide( MeshType& _m , size_t _n , const bo // Commit changes in geometry v_itr = _m.vertices_begin(); for ( ; v_itr != v_end; ++v_itr) - _m.set_point(v_itr, _m.property( vp_pos_, v_itr ) ); + _m.set_point(*v_itr, _m.property( vp_pos_, *v_itr ) ); // Split each edge at midpoint stored in edge property ep_pos_; // Attention! Creating new edges, hence make sure the loop ends correctly. diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc index 0dfda712..4b276594 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.cc @@ -79,7 +79,7 @@ bool CompositeT::prepare( MeshType& _m ) typename MeshType::VertexIter v_it(_m.vertices_begin()); for (; v_it != _m.vertices_end(); ++v_it) - _m.data(v_it).set_position(_m.point(*v_it)); + _m.data(*v_it).set_position(_m.point(*v_it)); return true; } @@ -109,7 +109,7 @@ void CompositeT::Tvv3() // set new positions for vertices v_it = mesh_.vertices_begin(); for (j = 0; j < n_vertices; ++j) { - mesh_.data(v_it).set_position(mesh_.data(v_it).position() * 3.0); + mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * 3.0); ++v_it; } @@ -173,7 +173,7 @@ void CompositeT::Tvv4() // set new positions for vertices v_it = mesh_.vertices_begin(); for (j = 0; j < n_vertices; ++j) { - mesh_.data(v_it).set_position(mesh_.data(v_it).position() * 4.0); + mesh_.data(*v_it).set_position(mesh_.data(*v_it).position() * 4.0); ++v_it; } @@ -298,11 +298,11 @@ void CompositeT::VF() cog = zero_point; for (fv_it = mesh_.fv_iter(*f_it); fv_it.is_valid(); ++fv_it) { - cog += mesh_.data(fv_it).position(); + cog += mesh_.data(*fv_it).position(); ++valence; } cog /= valence; - mesh_.data(f_it).set_position(cog); + mesh_.data(*f_it).set_position(cog); } } @@ -441,7 +441,7 @@ void CompositeT::FF() for (ff_it = mesh_.ff_iter(*f_it); ff_it.is_valid(); ++ff_it) { - cog += mesh_.data(ff_it).position(); + cog += mesh_.data(*ff_it).position(); ++valence; } cog /= valence; @@ -451,7 +451,7 @@ void CompositeT::FF() for (f_it = mesh_.faces_end(); f_it != mesh_.faces_begin(); ) { --f_it; - mesh_.data(f_it).set_position(point_vector.back()); + mesh_.data(*f_it).set_position(point_vector.back()); point_vector.pop_back(); } } @@ -602,7 +602,7 @@ void CompositeT::FVc(Coeff& _coeff) if (valence > 0) cog /= valence; - mesh_.data(v_it).set_position(cog); + mesh_.data(*v_it).set_position(cog); } } @@ -614,7 +614,7 @@ void CompositeT::FVc(scalar_t _c) unsigned int valence; typename MeshType::Point cog, - zero_point(0.0, 0.0, 0.0); + zero_point(0.0, 0.0, 0.0); typename MeshType::VertexOHalfedgeIter voh_it; typename MeshType::VertexIter v_it; @@ -631,14 +631,14 @@ void CompositeT::FVc(scalar_t _c) if (mesh_.face_handle(*voh_it).is_valid()) { - 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)).position(); - } + 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)).position(); + } } else { - --valence; + --valence; } } @@ -683,7 +683,7 @@ void CompositeT::VdE() cog /= valence; - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -716,7 +716,7 @@ void CompositeT::VdEc(scalar_t _c) } } - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -776,7 +776,7 @@ void CompositeT::VdEg(scalar_t _gamma) cog += mesh_.data(mesh_.to_vertex_handle(heh)).position() * 2.0 * _gamma; } - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -839,7 +839,7 @@ void CompositeT::VdEg(Coeff& _coeff) cog += mesh_.data(mesh_.to_vertex_handle(heh)).position() * 2.0 * gamma; } - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -867,7 +867,7 @@ void CompositeT::EV() cog /= valence; - mesh_.data(v_it).set_position(cog); + mesh_.data(*v_it).set_position(cog); } } @@ -903,7 +903,7 @@ void CompositeT::EVc(Coeff& _coeff) cog /= valence; - mesh_.data(v_it).set_position(cog); + mesh_.data(*v_it).set_position(cog); } } @@ -933,7 +933,7 @@ void CompositeT::EVc(scalar_t _c) cog /= valence; - mesh_.data(v_it).set_position(cog); + mesh_.data(*v_it).set_position(cog); } } @@ -959,7 +959,7 @@ void CompositeT::EF() } cog /= valence; - mesh_.data(f_it).set_position(cog); + mesh_.data(*f_it).set_position(cog); } } @@ -989,7 +989,7 @@ void CompositeT::FE() } cog /= valence; - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -1007,7 +1007,7 @@ void CompositeT::VE() cog = mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 0))).position(); cog += mesh_.data(mesh_.to_vertex_handle(mesh_.halfedge_handle(*e_it, 1))).position(); cog /= 2.0; - mesh_.data(e_it).set_position(cog); + mesh_.data(*e_it).set_position(cog); } } @@ -1042,7 +1042,7 @@ void CompositeT::VV() for (v_it = mesh_.vertices_end(); v_it != mesh_.vertices_begin(); ) { --v_it; - mesh_.data(v_it).set_position(point_vector.back()); + mesh_.data(*v_it).set_position(point_vector.back()); point_vector.pop_back(); } } @@ -1073,13 +1073,13 @@ void CompositeT::VVc(Coeff& _coeff) } cog /= valence; c = _coeff(valence); - cog = cog * (1 - c) + mesh_.data(v_it).position() * c; + cog = cog * (1 - c) + mesh_.data(*v_it).position() * c; point_vector.push_back(cog); } for (v_it = mesh_.vertices_end(); v_it != mesh_.vertices_begin(); ) { --v_it; - mesh_.data(v_it).set_position(point_vector.back()); + mesh_.data(*v_it).set_position(point_vector.back()); point_vector.pop_back(); } } @@ -1116,7 +1116,7 @@ void CompositeT::VVc(scalar_t _c) for (v_it = mesh_.vertices_end(); v_it != mesh_.vertices_begin(); ) { --v_it; - mesh_.data(v_it).set_position(point_vector.back()); + mesh_.data(*v_it).set_position(point_vector.back()); point_vector.pop_back(); } @@ -1160,7 +1160,7 @@ void CompositeT::EdE() for (e_it = mesh_.edges_end(); e_it != mesh_.edges_begin(); ) { --e_it; - mesh_.data(e_it).set_position(point_vector.back()); + mesh_.data(*e_it).set_position(point_vector.back()); point_vector.pop_back(); } } @@ -1204,7 +1204,7 @@ void CompositeT::EdEc(scalar_t _c) for (e_it = mesh_.edges_end(); e_it != mesh_.edges_begin(); ) { --e_it; - mesh_.data(e_it).set_position(point_vector.back()); + mesh_.data(*e_it).set_position(point_vector.back()); point_vector.pop_back(); } } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh index b902a7b7..971be1d7 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeT.hh @@ -145,7 +145,7 @@ protected: typename MeshType::VertexIter v_it; for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it) - _m.set_point(*v_it, _m.data(v_it).position()); + _m.set_point(*v_it, _m.data(*v_it).position()); } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh index 92ed173a..30b21eb3 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/LoopT.hh @@ -187,7 +187,7 @@ protected: // Commit changes in geometry for ( vit = _m.vertices_begin(); vit != _m.vertices_end(); ++vit) { - _m.set_point(vit, _m.property( vp_pos_, vit ) ); + _m.set_point(*vit, _m.property( vp_pos_, *vit ) ); } } diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh index 1f76d19e..13e81c5b 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh @@ -217,7 +217,7 @@ protected: // Commit changes in geometry for ( vit = /*initialVerticesEnd;*/_m.vertices_begin(); vit != _m.vertices_end(); ++vit) - _m.set_point(vit, _m.property( vp_pos_, vit ) ); + _m.set_point(*vit, _m.property( vp_pos_, *vit ) ); #if defined(_DEBUG) || defined(DEBUG) // Now we have an consistent mesh! diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh index 3d8fb52b..54abc1ba 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh @@ -212,16 +212,16 @@ protected: // tag existing edges for (eit=_m.edges_begin(); eit != _m.edges_end();++eit) { - _m.status( eit ).set_tagged( true ); - if ( (gen%2) && _m.is_boundary(eit) ) - compute_new_boundary_points( _m, eit ); // *) creates new vertices + _m.status( *eit ).set_tagged( true ); + if ( (gen%2) && _m.is_boundary(*eit) ) + compute_new_boundary_points( _m, *eit ); // *) creates new vertices } // insert new vertices, and store pos in vp_pos_ typename MeshType::FaceIter fend = _m.faces_end(); for (fit = _m.faces_begin();fit != fend; ++fit) { - if (_m.is_boundary(fit)) + if (_m.is_boundary(*fit)) { if(gen%2) _m.property(fp_pos_, *fit).invalidate(); @@ -312,13 +312,13 @@ protected: int nOrdinary = 0; //check number of extraordinary vertices - for(fvit = _m.fv_iter( fit ); fvit.is_valid(); ++fvit) + for(fvit = _m.fv_iter( *fit ); fvit.is_valid(); ++fvit) if( (_m.valence(*fvit)) == 6 || _m.is_boundary(*fvit) ) ++nOrdinary; if(nOrdinary==3) { - for(fheit = _m.fh_iter( fit ); fheit.is_valid(); ++fheit) + for(fheit = _m.fh_iter( *fit ); fheit.is_valid(); ++fheit) { //one ring vertex has weight 32/81 heh = *fheit; @@ -346,9 +346,9 @@ protected: else { //only use irregular vertices: - for(fheit = _m.fh_iter( fit ); fheit.is_valid(); ++fheit) + for(fheit = _m.fh_iter( *fit ); fheit.is_valid(); ++fheit) { - vh = _m.to_vertex_handle(fheit); + vh = _m.to_vertex_handle(*fheit); if( (_m.valence(vh) != 6) && (!_m.is_boundary(vh)) ) { unsigned int K = _m.valence(vh); @@ -371,21 +371,21 @@ protected: //split faces for (fit = _m.faces_begin();fit != fend; ++fit) { - if ( _m.is_boundary(fit) && (gen%2)) + if ( _m.is_boundary(*fit) && (gen%2)) { - boundary_split( _m, fit ); + boundary_split( _m, *fit ); } else { assert(_m.property(fp_pos_, *fit).is_valid()); - _m.split( fit, _m.property(fp_pos_, *fit) ); + _m.split( *fit, _m.property(fp_pos_, *fit) ); } } // flip old edges for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit) - if ( _m.status( eit ).tagged() && !_m.is_boundary( eit ) ) - _m.flip(eit); + if ( _m.status( *eit ).tagged() && !_m.is_boundary( *eit ) ) + _m.flip(*eit); // Now we have an consistent mesh! ASSERT_CONSISTENCY( MeshType, _m ); @@ -455,7 +455,7 @@ private: typename MeshType::HalfedgeHandle heh; // find boundary edge - for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( fe_it ); ++fe_it ) {}; + for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( *fe_it ); ++fe_it ) {}; // use precomputed, already inserted but not linked vertices vhl = _m.property(ep_nv_, *fe_it).first; diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh index 46b8e4ba..4481dffb 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/Sqrt3T.hh @@ -175,20 +175,20 @@ protected: // tag existing edges for (eit=_m.edges_begin(); eit != _m.edges_end();++eit) { - _m.status( eit ).set_tagged( true ); - if ( (gen%2) && _m.is_boundary(eit) ) - compute_new_boundary_points( _m, eit ); // *) creates new vertices + _m.status( *eit ).set_tagged( true ); + if ( (gen%2) && _m.is_boundary(*eit) ) + compute_new_boundary_points( _m, *eit ); // *) creates new vertices } // do relaxation of old vertices, but store new pos in property vp_pos_ for (vit=_m.vertices_begin(); vit!=_m.vertices_end(); ++vit) { - if ( _m.is_boundary(vit) ) + if ( _m.is_boundary(*vit) ) { if ( gen%2 ) { - heh = _m.halfedge_handle(vit); + heh = _m.halfedge_handle(*vit); if (heh.is_valid()) // skip isolated newly inserted vertices *) { typename OpenMesh::HalfedgeHandle @@ -201,28 +201,28 @@ protected: pos += _m.point(_m.from_vertex_handle(prev_heh)); pos *= real_t(4.0); - pos += real_t(19.0) * _m.point( vit ); + pos += real_t(19.0) * _m.point( *vit ); pos *= _1over27; - _m.property( vp_pos_, vit ) = pos; + _m.property( vp_pos_, *vit ) = pos; } } else - _m.property( vp_pos_, vit ) = _m.point( vit ); + _m.property( vp_pos_, *vit ) = _m.point( *vit ); } else { size_t valence=0; pos = zero; - for ( vvit = _m.vv_iter(vit); vvit.is_valid(); ++vvit) + for ( vvit = _m.vv_iter(*vit); vvit.is_valid(); ++vvit) { - pos += _m.point( vvit ); + pos += _m.point( *vvit ); ++valence; } pos *= weights_[ valence ].second; - pos += weights_[ valence ].first * _m.point(vit); - _m.property( vp_pos_, vit ) = pos; + pos += weights_[ valence ].first * _m.point(*vit); + _m.property( vp_pos_, *vit ) = pos; } } @@ -230,7 +230,7 @@ protected: typename MeshType::FaceIter fend = _m.faces_end(); for (fit = _m.faces_begin();fit != fend; ++fit) { - if ( (gen%2) && _m.is_boundary(fit)) + if ( (gen%2) && _m.is_boundary(*fit)) { boundary_split( _m, *fit ); } @@ -238,23 +238,23 @@ protected: { fvit = _m.fv_iter( *fit ); pos = _m.point( *fvit); - pos += _m.point(++fvit); - pos += _m.point(++fvit); + pos += _m.point(*(++fvit)); + pos += _m.point(*(++fvit)); pos *= _1over3; vh = _m.add_vertex( zero ); _m.property( vp_pos_, vh ) = pos; - _m.split( fit, vh ); + _m.split( *fit, vh ); } } // commit new positions (now iterating over all vertices) for (vit=_m.vertices_begin();vit != _m.vertices_end(); ++vit) - _m.set_point(vit, _m.property( vp_pos_, vit ) ); + _m.set_point(*vit, _m.property( vp_pos_, *vit ) ); // flip old edges for (eit=_m.edges_begin(); eit != _m.edges_end(); ++eit) - if ( _m.status( eit ).tagged() && !_m.is_boundary( eit ) ) - _m.flip(eit); + if ( _m.status( *eit ).tagged() && !_m.is_boundary( *eit ) ) + _m.flip(*eit); // Now we have an consistent mesh! ASSERT_CONSISTENCY( MeshType, _m ); @@ -348,7 +348,7 @@ private: typename MeshType::HalfedgeHandle heh; // find boundary edge - for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( fe_it ); ++fe_it ) {}; + for( fe_it=_m.fe_iter( _fh ); fe_it.is_valid() && !_m.is_boundary( *fe_it ); ++fe_it ) {}; // use precomputed, already inserted but not linked vertices vhl = _m.property(ep_nv_, *fe_it).first; diff --git a/src/OpenMesh/Tools/Utils/MeshCheckerT.cc b/src/OpenMesh/Tools/Utils/MeshCheckerT.cc index a4178db3..d710f689 100644 --- a/src/OpenMesh/Tools/Utils/MeshCheckerT.cc +++ b/src/OpenMesh/Tools/Utils/MeshCheckerT.cc @@ -71,8 +71,7 @@ check(unsigned int _targets, std::ostream& _os) if (_targets & CHECK_VERTICES) { - typename Mesh::ConstVertexIter v_it(mesh_.vertices_begin()), - v_end(mesh_.vertices_end()); + typename Mesh::ConstVertexIter v_it(mesh_.vertices_begin()), v_end(mesh_.vertices_end()); typename Mesh::VertexHandle vh; typename Mesh::ConstVertexVertexIter vv_it; typename Mesh::HalfedgeHandle heh; @@ -82,57 +81,56 @@ check(unsigned int _targets, std::ostream& _os) for (; v_it != v_end; ++v_it) { - if (!is_deleted(v_it)) + if (!is_deleted(*v_it)) { - vh = *v_it; + vh = *v_it; - /* The outgoing halfedge of a boundary vertex has to be a - boundary halfedge */ - heh = mesh_.halfedge_handle(vh); - if (heh.is_valid() && !mesh_.is_boundary(heh)) - { - for (typename Mesh::ConstVertexOHalfedgeIter vh_it(mesh_, vh); - vh_it.is_valid(); ++vh_it) - { - if (mesh_.is_boundary(*vh_it)) - { - _os << "MeshChecker: vertex " << vh - << ": outgoing halfedge not on boundary error\n"; - ok = false; - } - } - } + /* The outgoing halfedge of a boundary vertex has to be a boundary halfedge */ + heh = mesh_.halfedge_handle(vh); + if (heh.is_valid() && !mesh_.is_boundary(heh)) + { + for (typename Mesh::ConstVertexOHalfedgeIter vh_it(mesh_, vh); + vh_it.is_valid(); ++vh_it) + { + if (mesh_.is_boundary(*vh_it)) + { + _os << "MeshChecker: vertex " << vh + << ": outgoing halfedge not on boundary error\n"; + ok = false; + } + } + } + - - // outgoing halfedge has to refer back to vertex - if (mesh_.halfedge_handle(vh).is_valid() && - mesh_.from_vertex_handle(mesh_.halfedge_handle(vh)) != vh) - { - _os << "MeshChecker: vertex " << vh - << ": outgoing halfedge does not reference vertex\n"; - ok = false; - } + // outgoing halfedge has to refer back to vertex + if (mesh_.halfedge_handle(vh).is_valid() && + mesh_.from_vertex_handle(mesh_.halfedge_handle(vh)) != vh) + { + _os << "MeshChecker: vertex " << vh + << ": outgoing halfedge does not reference vertex\n"; + ok = false; + } - // check whether circulators are still in order - vv_it = mesh_.cvv_iter(vh); - for (count=0; vv_it.is_valid() && (count < max_valence); ++vv_it, ++count) {}; - if (count == max_valence) - { - _os << "MeshChecker: vertex " << vh - << ": ++circulator problem, one ring corrupt\n"; - ok = false; - } - vv_it = mesh_.cvv_iter(vh); - for (count=0; vv_it.is_valid() && (count < max_valence); --vv_it, ++count) {}; - if (count == max_valence) - { - _os << "MeshChecker: vertex " << vh - << ": --circulator problem, one ring corrupt\n"; - ok = false; - } + // check whether circulators are still in order + vv_it = mesh_.cvv_iter(vh); + for (count=0; vv_it.is_valid() && (count < max_valence); ++vv_it, ++count) {}; + if (count == max_valence) + { + _os << "MeshChecker: vertex " << vh + << ": ++circulator problem, one ring corrupt\n"; + ok = false; + } + vv_it = mesh_.cvv_iter(vh); + for (count=0; vv_it.is_valid() && (count < max_valence); --vv_it, ++count) {}; + if (count == max_valence) + { + _os << "MeshChecker: vertex " << vh + << ": --circulator problem, one ring corrupt\n"; + ok = false; + } } } } @@ -204,7 +202,7 @@ check(unsigned int _targets, std::ostream& _os) for (; f_it != f_end; ++f_it) { - if (!is_deleted(f_it)) + if (!is_deleted(*f_it)) { fh = *f_it; diff --git a/src/OpenMesh/Tools/Utils/StripifierT.cc b/src/OpenMesh/Tools/Utils/StripifierT.cc index 9367552d..06ec3032 100644 --- a/src/OpenMesh/Tools/Utils/StripifierT.cc +++ b/src/OpenMesh/Tools/Utils/StripifierT.cc @@ -119,15 +119,15 @@ build_strips() if (mesh_.has_face_status()) { for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it) - if (mesh_.status(f_it).hidden() || mesh_.status(f_it).deleted()) - processed(f_it) = used(f_it) = true; + if (mesh_.status(*f_it).hidden() || mesh_.status(*f_it).deleted()) + processed(*f_it) = used(*f_it) = true; else - processed(f_it) = used(f_it) = false; + processed(*f_it) = used(*f_it) = false; } else { for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it) - processed(f_it) = used(f_it) = false; + processed(*f_it) = used(*f_it) = false; } @@ -136,7 +136,7 @@ build_strips() { // find start face for (; f_it!=f_end; ++f_it) - if (!processed(f_it)) + if (!processed(*f_it)) break; if (f_it==f_end) break; // stop if all have been processed diff --git a/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh b/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh index 05d672e1..68265a03 100644 --- a/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh +++ b/src/Unittests/unittests_trimesh_circulator_vertex_ihalfedge.hh @@ -219,19 +219,19 @@ TEST_F(OpenMeshTrimeshCirculatorVertexIHalfEdge, VertexOIncomingHalfedgeBoundary EXPECT_EQ(14, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter begin at initialization"; EXPECT_EQ(14, vih_end->idx() ) << "Index wrong in VertexIHalfedgeIter end at initialization"; - EXPECT_EQ(3, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter begin at initialization"; + EXPECT_EQ(3, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter begin at initialization"; EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at initialization"; ++vih_it ; EXPECT_EQ(2, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 1"; - EXPECT_EQ(0, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 1"; + EXPECT_EQ(0, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 1"; EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 1"; ++vih_it ; EXPECT_EQ(5, vih_it->idx() ) << "Index wrong in VertexIHalfedgeIter step 2"; - EXPECT_EQ(-1, mesh_.face_handle(vih_it.handle()).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 2"; + EXPECT_EQ(-1, mesh_.face_handle(*vih_it).idx() ) << "Corresponding face Index wrong in VertexIHalfedgeIter step 2"; EXPECT_TRUE(vih_it) << "Iterator invalid in VertexIHalfedgeIter at step 2"; ++vih_it ;