- MeshLabFilterInterface creation and initialization temporary moved inside FilterThread

This commit is contained in:
Guido Ranzuglia granzuglia 2013-07-16 09:12:00 +00:00
parent 2c4d2c600c
commit 3e4cc3dbce
5 changed files with 476 additions and 467 deletions

View File

@ -7,8 +7,9 @@
#include "filterthread.h"
FilterThread::FilterThread(QString fname,MeshLabXMLFilterContainer *mfc, MeshDocument& md,EnvWrap& env,QObject *parent)
:QThread(parent), _mfc(mfc), _fname(fname),_md(md),_env(env)
:QThread(parent), _mfc(mfc), _fname(fname),_md(md),_env(env),_glwid(NULL)
{
_glwid = new QGLWidget();
}
FilterThread *cur=0;
@ -26,7 +27,16 @@ bool FilterThread::QCallBackLocal(const int pos, const char * str)
void FilterThread::run()
{
/*assert(cur==0)*/
QGLFormat defForm = QGLFormat::defaultFormat();
_mfc->filterInterface->glContext = new QGLContext(defForm,_glwid->context()->device());
_mfc->filterInterface->glContext->create(_glwid->context());
cur=this;
_ret = _mfc->filterInterface->applyFilter(_fname, _md, _env, QCallBackLocal);
cur=0;
}
FilterThread::~FilterThread()
{
delete _glwid;
}

View File

@ -9,8 +9,7 @@ class FilterThread : public QThread
Q_OBJECT
public:
explicit FilterThread(QString fname,MeshLabXMLFilterContainer *mfc, MeshDocument& md,EnvWrap& env, QObject *parent = 0);
~FilterThread();
MeshLabXMLFilterContainer *_mfc;
QString _fname;
MeshDocument& _md;
@ -23,10 +22,8 @@ protected:
signals:
void ThreadCB(const int pos,const QString& str);
public slots:
private:
QGLWidget* _glwid;
};
#endif // FILTERTHREAD_H

View File

@ -1970,9 +1970,11 @@ void GLArea::showInterruptButton( const bool& show )
void GLArea::completeUpdateRequested()
{
makeCurrent();
if ((this->md() != NULL) && (this->md()->rm() != NULL))
loadRaster(this->md()->rm()->id());
//if (md()->mm() != NULL)
// trackball.center = md()->mm()->cm.bbox.Center();
update();
doneCurrent();
}

View File

@ -234,7 +234,6 @@ private:
PluginGeneratorGUI* plugingui;
QSignalMapper *windowMapper;
PluginManager PM;
/*

File diff suppressed because it is too large Load Diff