From 1c19c4530741c67081ff655adb8c141844563acc Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Thu, 16 Jun 2011 14:51:12 +0000 Subject: [PATCH] Added callback to snapvertex function. --- src/meshlabplugins/filter_clean/cleanfilter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 6010509c1..7031de4e8 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -39,7 +39,7 @@ using namespace std; using namespace vcg; -int SnapVertexBorder(CMeshO &m, float threshold); +int SnapVertexBorder(CMeshO &m, float threshold,vcg::CallBackPos * cb); CleanFilter::CleanFilter() { @@ -319,7 +319,7 @@ bool CleanFilter::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe case FP_SNAP_MISMATCHED_BORDER : { float threshold = par.getFloat("EdgeDistRatio"); - int total = SnapVertexBorder(m.cm, threshold); + int total = SnapVertexBorder(m.cm, threshold,cb); Log("Successfully Splitted %d faces to snap", total); } break; @@ -329,7 +329,7 @@ bool CleanFilter::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe } -int SnapVertexBorder(CMeshO &m, float threshold) +int SnapVertexBorder(CMeshO &m, float threshold, vcg::CallBackPos * cb) { tri::Allocator::CompactVertexVector(m); tri::Allocator::CompactFaceVector(m); @@ -358,6 +358,8 @@ int SnapVertexBorder(CMeshO &m, float threshold) for(CMeshO::VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD() && (*vi).IsB()) { + int percPos = (tri::Index(m,*vi) *100) / m.vn; + cb(percPos,"Snapping vertices"); vector faceVec; vector distVec; vector pointVec; @@ -424,7 +426,7 @@ int SnapVertexBorder(CMeshO &m, float threshold) // V0 ------------------V2 V0 -------fv---------V2 // i - for(int i=0;iP() = splitVertVec[i]; int eInd = splitEdgeVec[i];