From 959d80bb07ccaea4ee062d718d99f9566fb188a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 7 Aug 2013 12:24:09 +0000 Subject: [PATCH] Finished except unittests git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@910 fdac6126-5c0c-442c-9429-916003d36597 --- .../Apps/ProgViewer/ProgViewerWidget.cc | 6 +-- .../Apps/Subdivider/adaptive_subdivider.cc | 8 ++-- .../Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc | 8 ++-- .../VDPMSynthesizerViewerWidget.cc | 6 +-- .../VDProgMesh/mkbalancedpm/mkbalancedpm.cc | 10 ++-- src/OpenMesh/Apps/mconvert/mconvert.cc | 12 ++--- .../Tools/Decimater/ModAspectRatioT.cc | 16 ++++--- src/OpenMesh/Tools/Decimater/ModHausdorffT.cc | 16 ++++--- .../Tools/Decimater/ModNormalDeviationT.hh | 6 +-- src/OpenMesh/Tools/Decimater/ModProgMeshT.cc | 14 +++--- src/OpenMesh/Tools/Decimater/ModRoundnessT.hh | 8 ++-- .../Tools/Smoother/JacobiLaplaceSmootherT.cc | 28 +++++------ .../Tools/Smoother/LaplaceSmootherT.cc | 8 ++-- src/OpenMesh/Tools/Smoother/SmootherT.cc | 46 +++++++++---------- .../Adaptive/Composite/CompositeT.cc | 18 ++++---- .../Subdivider/Adaptive/Composite/RulesT.cc | 20 ++++---- 16 files changed, 117 insertions(+), 113 deletions(-) diff --git a/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.cc b/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.cc index 0fb4bde9..8f6e3497 100644 --- a/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.cc +++ b/src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.cc @@ -150,11 +150,11 @@ ProgViewerWidget::open_prog_mesh(const char* _filename) MyMesh::Point bbMin, bbMax; - bbMin = bbMax = mesh_.point(vIt); + bbMin = bbMax = mesh_.point(*vIt); for (; vIt!=vEnd; ++vIt) { - bbMin.minimize(mesh_.point(vIt)); - bbMax.maximize(mesh_.point(vIt)); + bbMin.minimize(mesh_.point(*vIt)); + bbMax.maximize(mesh_.point(*vIt)); } // set center and radius diff --git a/src/OpenMesh/Apps/Subdivider/adaptive_subdivider.cc b/src/OpenMesh/Apps/Subdivider/adaptive_subdivider.cc index 05adf607..f12d9afb 100644 --- a/src/OpenMesh/Apps/Subdivider/adaptive_subdivider.cc +++ b/src/OpenMesh/Apps/Subdivider/adaptive_subdivider.cc @@ -306,7 +306,7 @@ int main(int argc, char **argv) for (f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) { - if (mesh.data(f_it).state() < target1) { + if (mesh.data(*f_it).state() < target1) { ++i; fh = *f_it; timer2.start(); @@ -317,7 +317,7 @@ int main(int argc, char **argv) for (v_it = mesh.vertices_begin(); v_it != mesh.vertices_end(); ++v_it) { - if (mesh.data(v_it).state() < target2) { + if (mesh.data(*v_it).state() < target2) { vh = *v_it; timer2.cont(); subdivider.refine(vh); @@ -420,8 +420,8 @@ int main(int argc, char **argv) for (MyMesh::VertexIter v_it = mesh.vertices_begin(); v_it != mesh.vertices_end(); ++v_it) { - if (mesh.data(v_it).state() > max_level) - max_level = mesh.data(v_it).state(); + if (mesh.data(*v_it).state() > max_level) + max_level = mesh.data(*v_it).state(); } diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc index 82d4feca..e7895d48 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc +++ b/src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc @@ -430,11 +430,11 @@ open_prog_mesh(const std::string& _filename) Mesh::Point bbMin, bbMax; - bbMin = bbMax = mesh_.point(vIt); + bbMin = bbMax = mesh_.point(*vIt); for (; vIt!=vEnd; ++vIt) { - bbMin.minimize(mesh_.point(vIt)); - bbMax.maximize(mesh_.point(vIt)); + bbMin.minimize(mesh_.point(*vIt)); + bbMax.maximize(mesh_.point(*vIt)); } // info @@ -661,7 +661,7 @@ vdpm_analysis() for (h_it=mesh_.halfedges_begin(); h_it!=mesh_.halfedges_end(); ++h_it) { vh = mesh_.to_vertex_handle(*h_it); - mesh_.data(h_it).set_vhierarchy_leaf_node_handle(mesh_.data(vh).vhierarchy_node_handle()); + mesh_.data(*h_it).set_vhierarchy_leaf_node_handle(mesh_.data(vh).vhierarchy_node_handle()); } for (v_it=mesh_.vertices_begin(); v_it!=mesh_.vertices_end(); ++v_it) diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc index bac9e9ad..89b0b760 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc @@ -539,11 +539,11 @@ open_vd_prog_mesh(const char* _filename) VDPMMesh::Point bbMin, bbMax; - bbMin = bbMax = mesh_.point(vIt); + bbMin = bbMax = mesh_.point(*vIt); for (; vIt!=vEnd; ++vIt) { - bbMin.minimize(mesh_.point(vIt)); - bbMax.maximize(mesh_.point(vIt)); + bbMin.minimize(mesh_.point(*vIt)); + bbMax.maximize(mesh_.point(*vIt)); } // set center and radius diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc index 56d36895..124b4cb5 100644 --- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc +++ b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc @@ -321,14 +321,14 @@ int main(int argc, char **argv) Mesh::FaceIter f_it; for (f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) - if ( !mesh.status(f_it).deleted() ) - mesh.update_normal(f_it); + if ( !mesh.status(*f_it).deleted() ) + mesh.update_normal(*f_it); for (v_it = mesh.vertices_begin(); v_it != mesh.vertices_end(); ++v_it) - if ( !mesh.status(v_it).deleted() ) + if ( !mesh.status(*v_it).deleted() ) { - mesh.status(v_it).set_locked(false); - mesh.update_normal(v_it); + mesh.status(*v_it).set_locked(false); + mesh.update_normal(*v_it); } } diff --git a/src/OpenMesh/Apps/mconvert/mconvert.cc b/src/OpenMesh/Apps/mconvert/mconvert.cc index f91596c7..9ad53ef1 100644 --- a/src/OpenMesh/Apps/mconvert/mconvert.cc +++ b/src/OpenMesh/Apps/mconvert/mconvert.cc @@ -293,7 +293,7 @@ int main(int argc, char *argv[] ) timer.start(); MyMesh::VertexIter vit = mesh.vertices_begin(); for (; vit != mesh.vertices_end(); ++vit) - cog += mesh.point( vit ); + cog += mesh.point( *vit ); timer.stop(); nv = mesh.n_vertices(); cog *= 1.0f/mesh.n_vertices(); @@ -303,7 +303,7 @@ int main(int argc, char *argv[] ) vit = mesh.vertices_begin(); timer.cont(); for (; vit != mesh.vertices_end(); ++vit) - mesh.set_point( vit , mesh.point( vit )-cog ); + mesh.set_point( *vit , mesh.point( *vit )-cog ); timer.stop(); nv += mesh.n_vertices(); } @@ -323,7 +323,7 @@ int main(int argc, char *argv[] ) timer.start(); MyMesh::VertexIter vit = mesh.vertices_begin(); for (; vit != mesh.vertices_end(); ++vit) - mesh.set_point( vit , mesh.point( vit ) + tvec.first ); + mesh.set_point( *vit , mesh.point( *vit ) + tvec.first ); timer.stop(); std::cout << " moved " << mesh.n_vertices() << " vertices in " << timer.as_string() << std::endl; @@ -342,9 +342,9 @@ int main(int argc, char *argv[] ) MyMesh::VertexIter vit = mesh.vertices_begin(); for (; vit != mesh.vertices_end(); ++vit) { - mesh.set_color( vit , MyMesh::Color( std::min((int)(r+0.5),255), - std::min((int)(g+0.5),255), - std::max((int)(b+0.5),0) ) ); + mesh.set_color( *vit , MyMesh::Color( std::min((int)(r+0.5),255), + std::min((int)(g+0.5),255), + std::max((int)(b+0.5),0) ) ); r += d; g += d2; b -= d; diff --git a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.cc b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.cc index 48ea3652..1ce5ea61 100644 --- a/src/OpenMesh/Tools/Decimater/ModAspectRatioT.cc +++ b/src/OpenMesh/Tools/Decimater/ModAspectRatioT.cc @@ -97,11 +97,12 @@ void ModAspectRatioT::initialize() { typename Mesh::FVIter fv_it; for (f_it = mesh_.faces_begin(); f_it != f_end; ++f_it) { - typename Mesh::Point& p0 = mesh_.point(fv_it = mesh_.fv_iter(f_it)); - typename Mesh::Point& p1 = mesh_.point(++fv_it); - typename Mesh::Point& p2 = mesh_.point(++fv_it); + fv_it = mesh_.fv_iter(*f_it); + typename Mesh::Point& p0 = mesh_.point(*fv_it); + typename Mesh::Point& p1 = mesh_.point(*(++fv_it)); + typename Mesh::Point& p2 = mesh_.point(*(++fv_it)); - mesh_.property(aspect_, f_it) = 1.0 / aspectRatio(p0, p1, p2); + mesh_.property(aspect_, *f_it) = 1.0 / aspectRatio(p0, p1, p2); } } @@ -115,9 +116,10 @@ void ModAspectRatioT::preprocess_collapse(const CollapseInfo& _ci) { for (typename Mesh::VFIter vf_it = mesh_.vf_iter(_ci.v0); vf_it.is_valid(); ++vf_it) { fh = *vf_it; if (fh != _ci.fl && fh != _ci.fr) { - typename Mesh::Point& p0 = mesh_.point(fv_it = mesh_.fv_iter(fh)); - typename Mesh::Point& p1 = mesh_.point(++fv_it); - typename Mesh::Point& p2 = mesh_.point(++fv_it); + fv_it = mesh_.fv_iter(fh); + typename Mesh::Point& p0 = mesh_.point(*fv_it); + typename Mesh::Point& p1 = mesh_.point(*(++fv_it)); + typename Mesh::Point& p2 = mesh_.point(*(++fv_it)); mesh_.property(aspect_, fh) = 1.0 / aspectRatio(p0, p1, p2); } diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc index 976dc2f3..cea8dfbf 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT.cc @@ -191,7 +191,7 @@ initialize() typename Mesh::FIter f_it(mesh_.faces_begin()), f_end(mesh_.faces_end()); for (; f_it!=f_end; ++f_it) - mesh_.property(points_, f_it).clear(); + mesh_.property(points_, *f_it).clear(); } @@ -242,9 +242,10 @@ collapse_priority(const CollapseInfo& _ci) ok = false; for (fh_it=faces.begin(); !ok && fh_it!=fh_end; ++fh_it) { - const Point& p0 = mesh_.point(fv_it=mesh_.cfv_iter(*fh_it)); - const Point& p1 = mesh_.point(++fv_it); - const Point& p2 = mesh_.point(++fv_it); + fv_it=mesh_.cfv_iter(*fh_it); + const Point& p0 = mesh_.point(*fv_it); + const Point& p1 = mesh_.point(*(++fv_it)); + const Point& p2 = mesh_.point(*(++fv_it)); if ( distPointTriangleSquared(*p_it, p0, p1, p2) <= sqr_tolerace) ok = true; @@ -328,9 +329,10 @@ postprocess_collapse(const CollapseInfo& _ci) emin = FLT_MAX; for (fh_it=faces.begin(); fh_it!=fh_end; ++fh_it) { - const Point& p0 = mesh_.point(fv_it=mesh_.cfv_iter(*fh_it)); - const Point& p1 = mesh_.point(++fv_it); - const Point& p2 = mesh_.point(++fv_it); + fv_it=mesh_.cfv_iter(*fh_it); + const Point& p0 = mesh_.point(*fv_it); + const Point& p1 = mesh_.point(*(++fv_it)); + const Point& p2 = mesh_.point(*(++fv_it)); e = distPointTriangleSquared(*p_it, p0, p1, p2); if (e < emin) { diff --git a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh index 3fda7f83..fb573ece 100644 --- a/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh +++ b/src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh @@ -137,7 +137,7 @@ public: f_end = mesh_.faces_end(); for (; f_it != f_end; ++f_it) - mesh_.property(normal_cones_, f_it) = NormalCone(mesh_.normal(f_it)); + mesh_.property(normal_cones_, *f_it) = NormalCone(mesh_.normal(*f_it)); } /** \brief Control normals when Decimating @@ -208,8 +208,8 @@ public: // account for changed normals typename Mesh::VertexFaceIter vf_it(mesh_, _ci.v1); for (; vf_it.is_valid(); ++vf_it) - mesh_.property(normal_cones_, vf_it). - merge(NormalCone(mesh_.normal(vf_it))); + mesh_.property(normal_cones_, *vf_it). + merge(NormalCone(mesh_.normal(*vf_it))); // normal cones of deleted triangles diff --git a/src/OpenMesh/Tools/Decimater/ModProgMeshT.cc b/src/OpenMesh/Tools/Decimater/ModProgMeshT.cc index 82ad9765..c86d0ed4 100644 --- a/src/OpenMesh/Tools/Decimater/ModProgMeshT.cc +++ b/src/OpenMesh/Tools/Decimater/ModProgMeshT.cc @@ -90,10 +90,10 @@ write( const std::string& _ofname ) v_end=Base::mesh().vertices_end(); for (; v_it != v_end; ++v_it) - if (!Base::mesh().status(v_it).deleted()) + if (!Base::mesh().status(*v_it).deleted()) { vhandles[i] = *v_it; - Base::mesh().property( idx_, v_it ) = i; + Base::mesh().property( idx_, *v_it ) = i; ++i; } n_base_vertices = i; @@ -115,7 +115,7 @@ write( const std::string& _ofname ) typename Mesh::ConstFaceIter f_it = Base::mesh().faces_begin(), f_end = Base::mesh().faces_end(); for (; f_it != f_end; ++f_it) - if (!Base::mesh().status(f_it).deleted()) + if (!Base::mesh().status(*f_it).deleted()) ++n_base_faces; // ---------------------------------------- write progressive mesh @@ -149,13 +149,13 @@ write( const std::string& _ofname ) // write base faces for (f_it=Base::mesh().faces_begin(); f_it != f_end; ++f_it) { - if (!Base::mesh().status(f_it).deleted()) + if (!Base::mesh().status(*f_it).deleted()) { typename Mesh::ConstFaceVertexIter fv_it(Base::mesh(), *f_it); - IO::store( out, Base::mesh().property( idx_, fv_it ) ); - IO::store( out, Base::mesh().property( idx_, ++fv_it ) ); - IO::store( out, Base::mesh().property( idx_, ++fv_it ) ); + IO::store( out, Base::mesh().property( idx_, *fv_it ) ); + IO::store( out, Base::mesh().property( idx_, *(++fv_it )) ); + IO::store( out, Base::mesh().property( idx_, *(++fv_it )) ); } } diff --git a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh index e29b1afd..32acad35 100644 --- a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh +++ b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh @@ -127,14 +127,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))); + C = vector_cast(Base::mesh().point( Base::mesh().to_vertex_handle(*voh_it))); fhC = Base::mesh().face_handle( *voh_it ); for (++voh_it; voh_it.is_valid(); ++voh_it) { B = C; fhB = fhC; - C = vector_cast(Base::mesh().point(Base::mesh().to_vertex_handle(voh_it))); + C = vector_cast(Base::mesh().point(Base::mesh().to_vertex_handle(*voh_it))); fhC = Base::mesh().face_handle( *voh_it ); if ( fhB == _ci.fl || fhB == _ci.fr ) @@ -150,14 +150,14 @@ class ModRoundnessT : public ModBaseT } else // binary mode { - C = vector_cast(Base::mesh().point( Base::mesh().to_vertex_handle(voh_it))); + C = vector_cast(Base::mesh().point( Base::mesh().to_vertex_handle(*voh_it))); fhC = Base::mesh().face_handle( *voh_it ); for (++voh_it; voh_it.is_valid() && (priority==Base::LEGAL_COLLAPSE); ++voh_it) { B = C; fhB = fhC; - C = vector_cast(Base::mesh().point(Base::mesh().to_vertex_handle(voh_it))); + C = vector_cast(Base::mesh().point(Base::mesh().to_vertex_handle(*voh_it))); fhC = Base::mesh().face_handle( *voh_it ); if ( fhB == _ci.fl || fhB == _ci.fr ) diff --git a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc index 33cc1add..31c1697a 100644 --- a/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc +++ b/src/OpenMesh/Tools/Smoother/JacobiLaplaceSmootherT.cc @@ -104,16 +104,16 @@ compute_new_positions_C0() for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) { - if (this->is_active(v_it)) + if (this->is_active(*v_it)) { // compute umbrella u = zero; - for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it) + for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it) { w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); u += vector_cast(Base::mesh_.point(*vv_it)) * w; } - u *= this->weight(v_it); + u *= this->weight(*v_it); u -= vector_cast(Base::mesh_.point(*v_it)); // damping @@ -146,43 +146,43 @@ compute_new_positions_C1() for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) { u = zero; - for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it) + for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it) { w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); u -= vector_cast(Base::mesh_.point(*vv_it))*w; } - u *= this->weight(v_it); - u += vector_cast(Base::mesh_.point(v_it)); + u *= this->weight(*v_it); + u += vector_cast(Base::mesh_.point(*v_it)); - Base::mesh_.property(umbrellas_, v_it) = u; + Base::mesh_.property(umbrellas_, *v_it) = u; } // 2nd pass: compute updates for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) { - if (this->is_active(v_it)) + if (this->is_active(*v_it)) { uu = zero; diag = 0.0; - for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it.is_valid(); ++vv_it) + for (vv_it=Base::mesh_.cvv_iter(*v_it); vv_it.is_valid(); ++vv_it) { w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); uu -= Base::mesh_.property(umbrellas_, *vv_it); diag += (w * this->weight(*vv_it) + 1.0) * w; } - uu *= this->weight(v_it); - diag *= this->weight(v_it); - uu += Base::mesh_.property(umbrellas_, v_it); + uu *= this->weight(*v_it); + diag *= this->weight(*v_it); + uu += Base::mesh_.property(umbrellas_, *v_it); if (diag) uu *= 1.0/diag; // damping uu *= 0.25; // store new position - p = vector_cast(Base::mesh_.point(v_it)); + p = vector_cast(Base::mesh_.point(*v_it)); p -= uu; - this->set_new_position(v_it, p); + this->set_new_position(*v_it, p); } } } diff --git a/src/OpenMesh/Tools/Smoother/LaplaceSmootherT.cc b/src/OpenMesh/Tools/Smoother/LaplaceSmootherT.cc index 3652b5c8..840d8b44 100644 --- a/src/OpenMesh/Tools/Smoother/LaplaceSmootherT.cc +++ b/src/OpenMesh/Tools/Smoother/LaplaceSmootherT.cc @@ -140,7 +140,7 @@ compute_weights(LaplaceWeighting _weighting) // init vertex weights for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) - Base::mesh_.property(vertex_weights_, v_it) = 0.0; + Base::mesh_.property(vertex_weights_, *v_it) = 0.0; @@ -156,9 +156,9 @@ compute_weights(LaplaceWeighting _weighting) v0 = Base::mesh_.to_vertex_handle(heh0); v1 = Base::mesh_.to_vertex_handle(heh1); - Base::mesh_.property(edge_weights_, e_it) = 1.0; - Base::mesh_.property(vertex_weights_, v0) += 1.0; - Base::mesh_.property(vertex_weights_, v1) += 1.0; + Base::mesh_.property(edge_weights_, *e_it) = 1.0; + Base::mesh_.property(vertex_weights_, v0) += 1.0; + Base::mesh_.property(vertex_weights_, v1) += 1.0; } break; diff --git a/src/OpenMesh/Tools/Smoother/SmootherT.cc b/src/OpenMesh/Tools/Smoother/SmootherT.cc index 316ad244..2eae406d 100644 --- a/src/OpenMesh/Tools/Smoother/SmootherT.cc +++ b/src/OpenMesh/Tools/Smoother/SmootherT.cc @@ -135,8 +135,8 @@ initialize(Component _comp, Continuity _cont) // store original points & normals for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) { - mesh_.property(original_positions_, v_it) = mesh_.point(v_it); - mesh_.property(original_normals_, v_it) = mesh_.normal(v_it); + mesh_.property(original_positions_, *v_it) = mesh_.point(*v_it); + mesh_.property(original_normals_, *v_it) = mesh_.normal(*v_it); } } @@ -155,7 +155,7 @@ set_active_vertices() // is something selected? bool nothing_selected(true); for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) - if (mesh_.status(v_it).selected()) + if (mesh_.status(*v_it).selected()) { nothing_selected = false; break; } @@ -163,15 +163,15 @@ set_active_vertices() bool active; for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) { - active = ((nothing_selected || mesh_.status(v_it).selected()) - && !mesh_.is_boundary(v_it) - && !mesh_.status(v_it).locked()); + active = ((nothing_selected || mesh_.status(*v_it).selected()) + && !mesh_.is_boundary(*v_it) + && !mesh_.status(*v_it).locked()); if ( skip_features_ ) { - active = active && !mesh_.status(v_it).feature(); + active = active && !mesh_.status(*v_it).feature(); - typename Mesh::VertexOHalfedgeIter voh_it(mesh_,v_it); + typename Mesh::VertexOHalfedgeIter voh_it(mesh_,*v_it); for ( ; voh_it.is_valid() ; ++voh_it ) { // If the edge is a feature edge, skip the current vertex while smoothing @@ -190,7 +190,7 @@ set_active_vertices() } } - mesh_.property(is_active_, v_it) = active; + mesh_.property(is_active_, *v_it) = active; } @@ -200,7 +200,7 @@ set_active_vertices() typename Mesh::VVIter vv_it; for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) - if (mesh_.is_boundary(v_it)) + if (mesh_.is_boundary(*v_it)) for (vv_it=mesh_.vv_iter(*v_it); vv_it.is_valid(); ++vv_it) mesh_.property(is_active_, *vv_it) = false; } @@ -360,14 +360,14 @@ project_to_tangent_plane() for (; v_it != v_end; ++v_it) { - if (is_active(v_it)) + if (is_active(*v_it)) { - translation = new_position(v_it)-orig_position(v_it); - normal = orig_normal(v_it); + translation = new_position(*v_it)-orig_position(*v_it); + normal = orig_normal(*v_it); normal *= dot(translation, normal); translation -= normal; - translation += vector_cast(orig_position(v_it)); - set_new_position(v_it, translation); + translation += vector_cast(orig_position(*v_it)); + set_new_position(*v_it, translation); } } } @@ -390,17 +390,17 @@ local_error_check() for (; v_it != v_end; ++v_it) { - if (is_active(v_it)) + if (is_active(*v_it)) { - translation = new_position(v_it) - orig_position(v_it); + translation = new_position(*v_it) - orig_position(*v_it); - s = fabs(dot(translation, orig_normal(v_it))); + s = fabs(dot(translation, orig_normal(*v_it))); if (s > tolerance_) { - translation *= (tolerance_ / s); - translation += vector_cast(orig_position(v_it)); - set_new_position(v_it, translation); + translation *= (tolerance_ / s); + translation += vector_cast(orig_position(*v_it)); + set_new_position(*v_it, translation); } } } @@ -419,8 +419,8 @@ move_points() v_end(mesh_.vertices_end()); for (; v_it != v_end; ++v_it) - if (is_active(v_it)) - mesh_.set_point(v_it, mesh_.property(new_positions_, v_it)); + if (is_active(*v_it)) + mesh_.set_point(*v_it, mesh_.property(new_positions_, *v_it)); } diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.cc index 963552aa..cf361fb6 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.cc @@ -83,25 +83,25 @@ initialize( void ) // ---------------------------------------- Init Vertices for (v_it = mesh_.vertices_begin(); v_it != mesh_.vertices_end(); ++v_it) { - mesh_.data(v_it).set_state(0); - mesh_.data(v_it).set_final(); - mesh_.data(v_it).set_position(0, mesh_.point(*v_it)); + mesh_.data(*v_it).set_state(0); + mesh_.data(*v_it).set_final(); + mesh_.data(*v_it).set_position(0, mesh_.point(*v_it)); } // ---------------------------------------- Init Faces for (f_it = mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it) { - mesh_.data(f_it).set_state(0); - mesh_.data(f_it).set_final(); - mesh_.data(f_it).set_position(0, zero_point); + mesh_.data(*f_it).set_state(0); + mesh_.data(*f_it).set_final(); + mesh_.data(*f_it).set_position(0, zero_point); } // ---------------------------------------- Init Edges for (e_it = mesh_.edges_begin(); e_it != mesh_.edges_end(); ++e_it) { - mesh_.data(e_it).set_state(0); - mesh_.data(e_it).set_final(); - mesh_.data(e_it).set_position(0, zero_point); + mesh_.data(*e_it).set_state(0); + mesh_.data(*e_it).set_final(); + mesh_.data(*e_it).set_position(0, zero_point); } diff --git a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc index d980deb9..6f6ef6e5 100644 --- a/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc +++ b/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/RulesT.cc @@ -845,7 +845,7 @@ void VF::raise(typename M::FaceHandle& _fh, state_t _target_state) 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); + position += Base::mesh_.data(*fv_it).position(_target_state - 1); } position /= valence; @@ -917,7 +917,7 @@ void FF::raise(typename M::FaceHandle& _fh, state_t _target_state) { ++valence; - position += Base::mesh_.data(ff_it).position(_target_state - 1); + position += Base::mesh_.data(*ff_it).position(_target_state - 1); } position /= valence; @@ -975,7 +975,7 @@ void FFc::raise(typename M::FaceHandle& _fh, state_t _target_state) for (ff_it = Base::mesh_.ff_iter(_fh); ff_it.is_valid(); ++ff_it) { ++valence; - position += Base::mesh_.data(ff_it).position(_target_state - 1); + position += Base::mesh_.data(*ff_it).position(_target_state - 1); } position /= valence; @@ -1045,7 +1045,7 @@ void FV::raise(typename M::VertexHandle& _vh, state_t _target_state) for (vf_it = Base::mesh_.vf_iter(_vh); vf_it.is_valid(); ++vf_it) { ++valence; - position += Base::mesh_.data(vf_it).position(_target_state - 1); + position += Base::mesh_.data(*vf_it).position(_target_state - 1); } position /= valence; @@ -1289,7 +1289,7 @@ void VV::raise(typename M::VertexHandle& _vh, state_t _target_state) ++valence; - position += Base::mesh_.data(vv_it).position(_target_state - 1); + position += Base::mesh_.data(*vv_it).position(_target_state - 1); } position /= valence; @@ -1359,7 +1359,7 @@ void VVc::raise(typename M::VertexHandle& _vh, state_t _target_state) for (vv_it = Base::mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it) { ++valence; - position += Base::mesh_.data(vv_it).position(_target_state - 1); + position += Base::mesh_.data(*vv_it).position(_target_state - 1); } position /= valence; @@ -1627,11 +1627,11 @@ void EV::raise(typename M::VertexHandle& _vh, state_t _target_state) for (ve_it = Base::mesh_.ve_iter(_vh); ve_it.is_valid(); ++ve_it) { - if (Base::mesh_.data(ve_it).final()) { + if (Base::mesh_.data(*ve_it).final()) { ++valence; - position += Base::mesh_.data(ve_it).position(_target_state - 1); + position += Base::mesh_.data(*ve_it).position(_target_state - 1); } } @@ -1825,11 +1825,11 @@ EF::raise(typename M::FaceHandle& _fh, state_t _target_state) { for (fe_it = Base::mesh_.fe_iter(_fh); fe_it.is_valid(); ++fe_it) { - if (Base::mesh_.data(fe_it).final()) { + if (Base::mesh_.data(*fe_it).final()) { ++valence; - position += Base::mesh_.data(fe_it).position(_target_state - 1); + position += Base::mesh_.data(*fe_it).position(_target_state - 1); } }