From cdfd55582aef9ce2eefa2006b434c671aa773780 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 5 Mar 2021 15:35:15 +0100 Subject: [PATCH] old applyFilter removed, cleanups --- src/common/plugins/interfaces/filter_plugin.cpp | 14 -------------- src/common/plugins/interfaces/filter_plugin.h | 15 --------------- .../filter_img_patch_param.cpp | 1 - src/meshlabplugins/filter_layer/filter_layer.cpp | 3 --- 4 files changed, 33 deletions(-) diff --git a/src/common/plugins/interfaces/filter_plugin.cpp b/src/common/plugins/interfaces/filter_plugin.cpp index 40af20e36..16b23fdd0 100644 --- a/src/common/plugins/interfaces/filter_plugin.cpp +++ b/src/common/plugins/interfaces/filter_plugin.cpp @@ -8,20 +8,6 @@ QString FilterPlugin::pythonFilterName(MeshLabPlugin::ActionIDType f) const return pymeshlab::computePythonName(filterName(f)); } -//std::map FilterPlugin::applyFilter( -// const QAction* filter, -// const RichParameterList& par, -// MeshDocument& md, unsigned int& postConditionMask, -// vcg::CallBackPos* cb) -//{ -// std::map output; -// bool result = applyFilter(filter, md, output, postConditionMask, par, cb); -// if (!result) { -// throw MLException(errorMessage); -// } -// return output; -//} - bool FilterPlugin::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const { int preMask = getPreConditions(act); diff --git a/src/common/plugins/interfaces/filter_plugin.h b/src/common/plugins/interfaces/filter_plugin.h index 6d4c280ee..d137ee1ae 100644 --- a/src/common/plugins/interfaces/filter_plugin.h +++ b/src/common/plugins/interfaces/filter_plugin.h @@ -178,11 +178,6 @@ public: unsigned int& postConditionMask, vcg::CallBackPos* cb) = 0; - /** - * THIS FUNCTION IS GOING TO BE REMOVED. Please use the apply filter declared above. - */ - //virtual bool applyFilter(const QAction* filter, MeshDocument& md, std::map& outputValues, unsigned int& postConditionMask, const RichParameterList& par, vcg::CallBackPos* cb) = 0; - /** * \brief tests if a filter is applicable to a mesh. * This function is a handy wrapper used by the framework for the \a getPreConditions callback; @@ -214,12 +209,6 @@ public: initParameterList(filter, *(md.mm()), par); } - /** - * @brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure - * Filters \b must never use QMessageBox for reporting errors. - * Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter - */ - const QString& errorMsg() const { return this->errorMessage; } virtual QString filterInfo(const QAction* a) const { return this->filterInfo(ID(a)); } virtual QString filterName(const QAction* a) const { return this->filterName(ID(a)); } virtual QString pythonFilterName(const QAction* a) const {return this->pythonFilterName(ID(a)); } @@ -244,7 +233,6 @@ public: * BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! */ int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const; - QString generatedScriptCode; MLPluginGLContext* glContext; protected: @@ -256,9 +244,6 @@ protected: QList actionList; QList typeList; - - // this string is used to pass back to the framework error messages in case of failure of a filter apply. - QString errorMessage; }; #define FILTER_PLUGIN_IID "vcg.meshlab.FilterPlugin/1.0" diff --git a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp index 68df6252d..e072d256a 100644 --- a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp +++ b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp @@ -247,7 +247,6 @@ std::map FilterImgPatchParamPlugin::applyFilter( } if( activeRasters.empty() ) { - this->errorMessage="No active Raster"; { glContext->doneCurrent(); throw MLException("You need to have at least one valid raster layer in your project, to apply this filter"); // text diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 51ffa197d..1bed7f505 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -757,9 +757,7 @@ std::map FilterLayerPlugin::applyFilter( float k1 = node1.toElement().text().toFloat(); if (k1 != 0.0f) { - this->errorMessage = "Distortion is not supported"; log("Warning! Distortion parameters won't be imported! Please undistort the images in Photoscan before!"); // text - } } @@ -836,7 +834,6 @@ std::map FilterLayerPlugin::applyFilter( else { - this->errorMessage = "No file to open"; throw MLException("Unknown file type"); } } break;