[Paraview] troubles with pipeline asynchronous update

Nadir Raimondo raimondo at ismb.it
Tue Feb 7 11:12:48 EST 2012


Hi all,

I'm developing a GUI based on Qt+ParaView 3.10.0 to control a CNC 
acquisition system using Paraview builtin server. I have written a 
plugin that waits until new data is available, this process may require 
a lot of time; to avoid to block the entire interface I update the 
pipeline, which contains the plugin, from a QThread like so:

*** SourceUpdateTask.h ***

class SourceUpdateTask : public QRunnable{
public:
     SourceUpdateTask(const QString& id, pqPipelineSource* source);
     virtual ~SourceUpdateTask();

     void run();
protected:
     QString m_id;
     pqPipelineSource *m_source;
};

*** SourceUpdateTask.cpp ***

SourceUpdateTask::SourceUpdateTask(const QString& id, pqPipelineSource* 
source): m_id(id), m_source(source) {}
SourceUpdateTask::~SourceUpdateTask() {}

void SourceUpdateTask::run(){
     m_source->updatePipeline();
}

In this way the interface remains functional (it is possible to resize 
and repaint it and the pqStatusBar receives the progress event 
correctly) but it seems that each other qt signals are not processed 
(all qt widgets are blocked) as if the updatePipeline function locked 
the qt event loop. At the end of the function the interface return to 
work correctly.

Can anyone tell me if it is "safe" to update pipelines in this way. Is 
there another way to do an asynchronous update?

Thanks in advance,
Nadir


More information about the ParaView mailing list