From 975fd90cbc0e450ec0e603ea0d2e4f7f7f1e430a Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 7 Oct 2021 15:26:17 +0200 Subject: [PATCH] remove "change visibility of layers" filter --- .../filter_layer/filter_layer.cpp | 45 +------------------ .../filter_layer/filter_layer.h | 1 - 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 4151dbcfb..1deae0694 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -40,7 +40,6 @@ FilterLayerPlugin::FilterLayerPlugin() { typeList = { FP_FLATTEN, - FP_MESH_VISIBILITY, FP_DELETE_MESH, FP_DELETE_NON_VISIBLE_MESH, FP_DELETE_RASTER, @@ -80,7 +79,6 @@ QString FilterLayerPlugin::filterName(ActionIDType filterId) const case FP_FLATTEN: return QString("Flatten Visible Layers"); case FP_RENAME_MESH: return QString("Rename Current Mesh"); case FP_RENAME_RASTER: return QString("Rename Current Raster"); - case FP_MESH_VISIBILITY: return QString("Change Visibility of layer(s)"); case FP_EXPORT_CAMERAS: return QString("Export active rasters cameras to file"); case FP_IMPORT_CAMERAS: return QString("Import cameras for active rasters from file"); default: assert(0); @@ -115,8 +113,6 @@ QString FilterLayerPlugin::filterInfo(ActionIDType filterId) const "are preserved. Existing layers can be optionally deleted"); case FP_RENAME_MESH: return QString("Explicitly change the label shown for a given mesh"); case FP_RENAME_RASTER: return QString("Explicitly change the label shown for a given raster"); - case FP_MESH_VISIBILITY: - return QString("Make layer(s) visible/invisible. Useful for scripting."); case FP_EXPORT_CAMERAS: return QString("Export active cameras to file, in the .out or Agisoft .xml formats"); case FP_IMPORT_CAMERAS: @@ -175,27 +171,6 @@ FilterLayerPlugin::initParameterList(const QAction* action, const MeshDocument& parlst.addParam( RichString("newName", rm ? rm->label() : "", "New Label", "New Label for the raster.")); break; - case FP_MESH_VISIBILITY: - parlst.addParam(RichMesh( - "layer", - md.mm()->id(), - &md, - "Layer Name", - "The name of the layer that has to change visibility. If second parameter is not " - "empty, this parameter is ignored.")); - parlst.addParam(RichString( - "lName", - "", - "Substring match", - "Apply visibility to all layers with name substring matching the entered string. If " - "not empty, the first parameter is ignored.")); - parlst.addParam(RichBool( - "isMeshVisible", - true, - "Visible", - "It makes the selected layer(s) visible or invisible.")); - break; - case FP_EXPORT_CAMERAS: parlst.addParam(RichEnum( "ExportFile", @@ -249,21 +224,6 @@ std::map FilterLayerPlugin::applyFilter( } break; - case FP_MESH_VISIBILITY: { - QString match = par.getString("lName"); - if (match == "") { - MeshModel* mm = md.getMesh(par.getMeshId("layer")); - if (mm) - md.setVisible(mm->id(), par.getBool("isMeshVisible")); - } - else { - for (const MeshModel& mmp : md.meshIterator()) { - if (mmp.label().contains(match)) - md.setVisible(mmp.id(), par.getBool("isMeshVisible")); - } - } - } break; - case FP_DELETE_MESH: { if (md.mm()) md.delMesh(md.mm()->id()); @@ -930,7 +890,6 @@ FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(const QAction* a) con case FP_SPLITSELECTEDVERTICES: case FP_DUPLICATE: case FP_FLATTEN: - case FP_MESH_VISIBILITY: case FP_SPLITCONNECTED: case FP_DELETE_MESH: case FP_DELETE_NON_VISIBLE_MESH: return FilterPlugin::Layer; @@ -948,7 +907,6 @@ FilterPlugin::FilterArity FilterLayerPlugin::filterArity(const QAction* filter) { switch (ID(filter)) { case FP_RENAME_MESH: - case FP_MESH_VISIBILITY: case FP_SPLITSELECTEDFACES: case FP_SPLITSELECTEDVERTICES: case FP_DUPLICATE: @@ -978,8 +936,7 @@ int FilterLayerPlugin::postCondition(const QAction* filter) const case FP_DELETE_NON_SELECTED_RASTER: case FP_EXPORT_CAMERAS: case FP_IMPORT_CAMERAS: - case FP_SPLITCONNECTED: - case FP_MESH_VISIBILITY: return MeshModel::MM_NONE; + case FP_SPLITCONNECTED: return MeshModel::MM_NONE; case FP_SPLITSELECTEDFACES: case FP_SPLITSELECTEDVERTICES: return MeshModel::MM_GEOMETRY_AND_TOPOLOGY_CHANGE; diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 29c5d1ffa..e828b9f7c 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -37,7 +37,6 @@ class FilterLayerPlugin : public QObject, public FilterPlugin public: enum { FP_FLATTEN, - FP_MESH_VISIBILITY, FP_SPLITSELECTEDFACES, FP_SPLITSELECTEDVERTICES, FP_SPLITCONNECTED,