1 #ifndef FILTERTHREAD_H
2 #define FILTERTHREAD_H
3 
4 #include <QThread>
5 #include "mainwindow.h"
6 
7 class FilterThread : public QThread
8 {
9     Q_OBJECT
10 public:
11     //Ideally PluginManager parameter should be const
12     //and MainWindow parameter should not exist!
13 	FilterThread(const QString& fname,const QMap<QString,QString>& parexpval,PluginManager& pm, MeshDocument& md,MainWindow* mw);
14     ~FilterThread();
succeed()15     inline bool succeed() const {return _success;}
filterName()16     inline QString filterName() const {return _fname;}
17     static bool localCallBack(const int pos, const char * str);
18 
19 protected:
20     void run();
21 
22 signals:
23     void threadCB(const int pos,const QString& str);
24 private:
25     static FilterThread* _cur;
26     QString _fname;
27     QMap<QString,QString> _parexpval;
28     //ideally this should be const
29     PluginManager& _pm;
30     MeshDocument& _md;
31     QGLWidget* _glwid;
32     bool _success;
33 
34 	//WARNING!!!!!!!!!!!!!!!MainWindow parameter should not exist at all! it has been introduced only to give access to global parameters to the script environment
35     MainWindow* _mw;
36 	/*****************************************************************************************************************************************************************/
37 };
38 
39 #endif // FILTERTHREAD_H