From 125eceb0b5ec93d00a172afafe31433b5c114178 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 15 Mar 2021 13:24:16 +0100 Subject: [PATCH] removed declared edit interface - the only plugin is the factory --- src/common/plugins/interfaces/decorate_plugin.cpp | 4 ++-- src/common/plugins/interfaces/edit_plugin.h | 10 ---------- src/common/plugins/interfaces/filter_plugin.cpp | 6 +++--- src/common/plugins/interfaces/meshlab_plugin.h | 6 ------ src/common/plugins/interfaces/meshlab_plugin_file.h | 6 ++++++ src/meshlabplugins/edit_align/edit_align.h | 4 +--- .../edit_manipulators/edit_manipulators.h | 2 -- src/meshlabplugins/edit_measure/edit_measure.h | 2 -- src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h | 4 +--- src/meshlabplugins/edit_paint/edit_paint.h | 2 -- src/meshlabplugins/edit_pickpoints/editpickpoints.h | 4 +--- src/meshlabplugins/edit_point/edit_point.h | 4 +--- src/meshlabplugins/edit_quality/qualitymapper.h | 2 -- src/meshlabplugins/edit_referencing/edit_referencing.h | 4 +--- src/meshlabplugins/edit_sample/edit_sample.h | 4 +--- src/meshlabplugins/edit_select/edit_select.h | 2 -- 16 files changed, 17 insertions(+), 49 deletions(-) diff --git a/src/common/plugins/interfaces/decorate_plugin.cpp b/src/common/plugins/interfaces/decorate_plugin.cpp index b4288f19f..e2021bd64 100644 --- a/src/common/plugins/interfaces/decorate_plugin.cpp +++ b/src/common/plugins/interfaces/decorate_plugin.cpp @@ -43,7 +43,7 @@ QAction* DecoratePlugin::action(QString name) const return 0; } -MeshLabPlugin::ActionIDType DecoratePlugin::ID(const QAction* a) const +MeshLabPluginFile::ActionIDType DecoratePlugin::ID(const QAction* a) const { QString aa=a->text(); foreach(ActionIDType tt, types()) @@ -57,7 +57,7 @@ MeshLabPlugin::ActionIDType DecoratePlugin::ID(const QAction* a) const return -1; } -MeshLabPlugin::ActionIDType DecoratePlugin::ID(QString name) const +MeshLabPluginFile::ActionIDType DecoratePlugin::ID(QString name) const { QString n = name; foreach(ActionIDType tt, types()) diff --git a/src/common/plugins/interfaces/edit_plugin.h b/src/common/plugins/interfaces/edit_plugin.h index 7c654351c..7f083e39c 100644 --- a/src/common/plugins/interfaces/edit_plugin.h +++ b/src/common/plugins/interfaces/edit_plugin.h @@ -121,17 +121,7 @@ protected: std::list actionList; }; -#define MESHLAB_EDIT_PLUGIN \ - public: \ - virtual std::pair getMLVersion() const { \ - return std::make_pair(meshlab::meshlabVersion(), meshlab::builtWithDoublePrecision()); \ - } \ - private: - -#define EDIT_TOOL_IID "vcg.meshlab.EditTool/1.0" #define EDIT_PLUGIN_FACTORY_IID "vcg.meshlab.EditPluginFactory/1.0" - -Q_DECLARE_INTERFACE(EditTool, EDIT_TOOL_IID) Q_DECLARE_INTERFACE(EditPluginFactory, EDIT_PLUGIN_FACTORY_IID) diff --git a/src/common/plugins/interfaces/filter_plugin.cpp b/src/common/plugins/interfaces/filter_plugin.cpp index 16b23fdd0..8e0a2055a 100644 --- a/src/common/plugins/interfaces/filter_plugin.cpp +++ b/src/common/plugins/interfaces/filter_plugin.cpp @@ -3,7 +3,7 @@ #include -QString FilterPlugin::pythonFilterName(MeshLabPlugin::ActionIDType f) const +QString FilterPlugin::pythonFilterName(ActionIDType f) const { return pymeshlab::computePythonName(filterName(f)); } @@ -47,7 +47,7 @@ bool FilterPlugin::isFilterApplicable(const QAction* act, const MeshModel& m, QS return MissingItems.isEmpty(); } -MeshLabPlugin::ActionIDType FilterPlugin::ID(const QAction* a) const +MeshLabPluginFile::ActionIDType FilterPlugin::ID(const QAction* a) const { QString aa=a->text(); for(ActionIDType tt : qAsConst(typeList)) @@ -61,7 +61,7 @@ MeshLabPlugin::ActionIDType FilterPlugin::ID(const QAction* a) const return -1; } -QAction* FilterPlugin::getFilterAction(MeshLabPlugin::ActionIDType filterID) +QAction* FilterPlugin::getFilterAction(ActionIDType filterID) { QString idName = this->filterName(filterID); return getFilterAction(idName); diff --git a/src/common/plugins/interfaces/meshlab_plugin.h b/src/common/plugins/interfaces/meshlab_plugin.h index e358e95ad..389da3700 100644 --- a/src/common/plugins/interfaces/meshlab_plugin.h +++ b/src/common/plugins/interfaces/meshlab_plugin.h @@ -52,12 +52,6 @@ class MeshLabPlugin { public: - /** - * @brief the type used to identify plugin actions; - * there is a one-to-one relation between an ID and an Action. - */ - typedef int ActionIDType; - MeshLabPlugin(); virtual ~MeshLabPlugin() {} diff --git a/src/common/plugins/interfaces/meshlab_plugin_file.h b/src/common/plugins/interfaces/meshlab_plugin_file.h index 270647cc3..854fcfdda 100644 --- a/src/common/plugins/interfaces/meshlab_plugin_file.h +++ b/src/common/plugins/interfaces/meshlab_plugin_file.h @@ -44,6 +44,12 @@ public: MeshLabPluginFile() : enabled(true) {}; virtual ~MeshLabPluginFile() {} + /** + * @brief the type used to identify plugin actions; + * there is a one-to-one relation between an ID and an Action. + */ + typedef int ActionIDType; + /** * This function will be automatically defined in your plugin class * when you use the MESHLAB_PLUGIN_IID_EXPORTER macro. diff --git a/src/meshlabplugins/edit_align/edit_align.h b/src/meshlabplugins/edit_align/edit_align.h index 4ab7925b7..5f76e423e 100644 --- a/src/meshlabplugins/edit_align/edit_align.h +++ b/src/meshlabplugins/edit_align/edit_align.h @@ -34,10 +34,8 @@ class EditAlignPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - enum + enum { ALIGN_IDLE = 0x01, ALIGN_INSPECT_ARC = 0x02, diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.h b/src/meshlabplugins/edit_manipulators/edit_manipulators.h index 405a5f780..9bf80677f 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.h +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.h @@ -32,8 +32,6 @@ class EditManipulatorsPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) public: diff --git a/src/meshlabplugins/edit_measure/edit_measure.h b/src/meshlabplugins/edit_measure/edit_measure.h index 308a123e5..4b6d094b6 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.h +++ b/src/meshlabplugins/edit_measure/edit_measure.h @@ -50,8 +50,6 @@ public: class EditMeasurePlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) public: EditMeasurePlugin(); diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h index 0e0dcf50f..94fda95bf 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h @@ -36,9 +36,7 @@ class EditMutualCorrsPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - + public: EditMutualCorrsPlugin(); virtual ~EditMutualCorrsPlugin() {} diff --git a/src/meshlabplugins/edit_paint/edit_paint.h b/src/meshlabplugins/edit_paint/edit_paint.h index bc85fabd5..e0394971a 100644 --- a/src/meshlabplugins/edit_paint/edit_paint.h +++ b/src/meshlabplugins/edit_paint/edit_paint.h @@ -51,8 +51,6 @@ enum PaintOptions { */ class EditPaintPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) public: EditPaintPlugin(); diff --git a/src/meshlabplugins/edit_pickpoints/editpickpoints.h b/src/meshlabplugins/edit_pickpoints/editpickpoints.h index f26ebf295..6317b1678 100644 --- a/src/meshlabplugins/edit_pickpoints/editpickpoints.h +++ b/src/meshlabplugins/edit_pickpoints/editpickpoints.h @@ -36,9 +36,7 @@ class EditPickPointsPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - + public: //constructor EditPickPointsPlugin(); diff --git a/src/meshlabplugins/edit_point/edit_point.h b/src/meshlabplugins/edit_point/edit_point.h index 55b77cbd1..9d8bbb39c 100644 --- a/src/meshlabplugins/edit_point/edit_point.h +++ b/src/meshlabplugins/edit_point/edit_point.h @@ -30,9 +30,7 @@ class EditPointPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - + public: enum {SELECT_DEFAULT_MODE, SELECT_FITTING_PLANE_MODE}; diff --git a/src/meshlabplugins/edit_quality/qualitymapper.h b/src/meshlabplugins/edit_quality/qualitymapper.h index f32cc62f3..1e97acb17 100644 --- a/src/meshlabplugins/edit_quality/qualitymapper.h +++ b/src/meshlabplugins/edit_quality/qualitymapper.h @@ -41,8 +41,6 @@ FIRST RELEASE class QualityMapperPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) private: QualityMapperDialog *_qualityMapperDialog; diff --git a/src/meshlabplugins/edit_referencing/edit_referencing.h b/src/meshlabplugins/edit_referencing/edit_referencing.h index 094f575a2..11b7e1c30 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing.h +++ b/src/meshlabplugins/edit_referencing/edit_referencing.h @@ -35,9 +35,7 @@ class EditReferencingPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - + public: enum refModeType {REF_ABSOLUTE, REF_SCALE}; diff --git a/src/meshlabplugins/edit_sample/edit_sample.h b/src/meshlabplugins/edit_sample/edit_sample.h index 3233fd6ab..7c98faf47 100644 --- a/src/meshlabplugins/edit_sample/edit_sample.h +++ b/src/meshlabplugins/edit_sample/edit_sample.h @@ -30,9 +30,7 @@ class SampleEditPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) - + public: SampleEditPlugin(); virtual ~SampleEditPlugin() {} diff --git a/src/meshlabplugins/edit_select/edit_select.h b/src/meshlabplugins/edit_select/edit_select.h index 3de1d978a..a5993dbca 100644 --- a/src/meshlabplugins/edit_select/edit_select.h +++ b/src/meshlabplugins/edit_select/edit_select.h @@ -28,8 +28,6 @@ class EditSelectPlugin : public QObject, public EditTool { Q_OBJECT - MESHLAB_EDIT_PLUGIN - Q_INTERFACES(EditTool) public: