diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index bacfa2142..ef87699ed 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -54,9 +54,7 @@ CleanFilter::CleanFilter() FP_REMOVE_DUPLICATED_VERTEX, FP_REMOVE_FACE_ZERO_AREA, FP_MERGE_CLOSE_VERTEX, - FP_MERGE_WEDGE_TEX, - FP_COMPACT_FACE, - FP_COMPACT_VERT + FP_MERGE_WEDGE_TEX }; for(ActionIDType tt : types()) @@ -96,8 +94,6 @@ QString CleanFilter::filterName(ActionIDType filter) const case FP_REMOVE_UNREFERENCED_VERTEX: return QString("Remove Unreferenced Vertices"); case FP_REMOVE_DUPLICATED_VERTEX: return QString("Remove Duplicate Vertices"); case FP_REMOVE_FACE_ZERO_AREA: return QString("Remove Zero Area Faces"); - case FP_COMPACT_VERT: return QString("Compact vertices"); - case FP_COMPACT_FACE: return QString("Compact faces"); default: assert(0); } return QString("error!"); @@ -133,8 +129,6 @@ QString CleanFilter::filterInfo(ActionIDType filterId) const case FP_REMOVE_UNREFERENCED_VERTEX: return QString("Check for every vertex on the mesh: if it is NOT referenced by a face, removes it"); case FP_REMOVE_DUPLICATED_VERTEX: return QString("Check for every vertex on the mesh: if there are two vertices with same coordinates they are merged into a single one."); case FP_REMOVE_FACE_ZERO_AREA: return QString("Remove null faces (the one with area equal to zero)"); - case FP_COMPACT_VERT: return QString("Compact all the vertices that have been deleted and put them to the end of the vector"); - case FP_COMPACT_FACE: return QString("Compact all the faces that have been deleted and put them to the end of the vector"); default: assert(0); } return QString("error!"); @@ -159,8 +153,6 @@ CleanFilter::FilterClass CleanFilter::getClass(const QAction *a) const case FP_REMOVE_FACE_ZERO_AREA: case FP_REMOVE_UNREFERENCED_VERTEX: case FP_REMOVE_DUPLICATED_VERTEX: - case FP_COMPACT_VERT: - case FP_COMPACT_FACE: return FilterPlugin::Cleaning; case FP_BALL_PIVOTING: return FilterPlugin::Remeshing; case FP_MERGE_WEDGE_TEX: return FilterPlugin::FilterClass(FilterPlugin::Cleaning + FilterPlugin::Texture); default : assert(0); @@ -172,8 +164,6 @@ int CleanFilter::getRequirements(const QAction *action) { switch(ID(action)) { - case FP_COMPACT_FACE: - case FP_COMPACT_VERT: case FP_REMOVE_WRT_Q: case FP_BALL_PIVOTING: return MeshModel::MM_VERTMARK; case FP_REMOVE_ISOLATED_COMPLEXITY: @@ -217,8 +207,6 @@ int CleanFilter::postCondition(const QAction* action) const case FP_REMOVE_DUPLICATED_VERTEX: case FP_REMOVE_FACE_ZERO_AREA: case FP_REMOVE_NON_MANIF_EDGE_SPLIT: return MeshModel::MM_GEOMETRY_AND_TOPOLOGY_CHANGE; - case FP_COMPACT_VERT: - case FP_COMPACT_FACE: return MeshModel::MM_NONE; // only internal vector storage should change, nothing more } return MeshModel::MM_ALL; } @@ -468,16 +456,6 @@ std::map CleanFilter::applyFilter(const QAction *filter, m.clearDataMask(MeshModel::MM_VERTFACETOPO); } break; - case FP_COMPACT_FACE : - { - vcg::tri::Allocator::CompactFaceVector(m.cm); - } break; - - case FP_COMPACT_VERT : - { - vcg::tri::Allocator::CompactVertexVector(m.cm); - } break; - default : wrongActionCalled(filter); // unknown filter; } diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index 58d522b36..e6374e0a9 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -55,9 +55,7 @@ class CleanFilter : public QObject, public FilterPlugin FP_REMOVE_DUPLICATED_VERTEX, FP_REMOVE_FACE_ZERO_AREA, FP_MERGE_CLOSE_VERTEX, - FP_MERGE_WEDGE_TEX, - FP_COMPACT_VERT, - FP_COMPACT_FACE + FP_MERGE_WEDGE_TEX } ; CleanFilter(); diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index f874dac41..0fc38151f 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -476,9 +476,8 @@ std::map FilterUnsharp::applyFilter( float alpha = 1; switch (stepNum) { - case 0: // ***** Storing Vertex Data ***** - { - if(tri::HasPerVertexAttribute(m.cm,AttribName)) { + case 0: { // ***** Storing Vertex Data ***** + if(tri::HasPerVertexAttribute(m.cm,AttribName)) { vcg::tri::Allocator::DeletePerVertexAttribute(m.cm,AttribName); } CMeshO::PerVertexAttributeHandle h = tri::Allocator::AddPerVertexAttribute (m.cm,AttribName); @@ -490,27 +489,26 @@ std::map FilterUnsharp::applyFilter( log( "Stored Position %d vertices", m.cm.vn); break; } - case 1: // ***** Recovering and Projection Vertex Data ***** - { - if(!tri::HasPerVertexAttribute(m.cm,AttribName)) { + case 1: { // ***** Recovering and Projection Vertex Data ***** + if(!tri::HasPerVertexAttribute(m.cm,AttribName)) { throw MLException("Failed to retrieve the stored vertex position. First Store than recover."); } CMeshO::PerVertexAttributeHandle h = tri::Allocator::GetPerVertexAttribute (m.cm,AttribName); CMeshO::VertexIterator vi; - for(vi= m.cm.vert.begin();vi!= m.cm.vert.end();++vi) - { - Point3m d = h[vi] - viewpoint; d.Normalize(); - float s = d * ( (*vi).cP() - h[vi] ); + for(vi= m.cm.vert.begin();vi!= m.cm.vert.end();++vi) { + Point3m d = h[vi] - viewpoint; + d.Normalize(); + Scalarm s = d * ( (*vi).cP() - h[vi] ); (*vi).P() = h[vi] + d * (s*alpha); } m.updateBoxAndNormals(); - log( "Projected smoothed Position %d vertices", m.cm.vn); - } + log("Projected smoothed Position %d vertices", m.cm.vn); break; } - } + } break; + } case FP_SD_LAPLACIAN_SMOOTH: { tri::UpdateFlags::FaceBorderFromNone(m.cm);