Hi all,
I have an issue concerning thread usage inside paraview. I am using the vrpn
library to connect some controllers and manipulate paraview's objects. I am
running the connection routine of vrpn on a separate thread (so the main
thread of paraview keeps running smooth). However i can't seem to launch the
thread correctly... what i am doing is:
In the run method of my class(which i inherit from QThread)
void
myThread::run()
{
analog = new vrpn_Analog_Remote(name.c_str());
if(!analog)
{
cout << "Error opening device";
return;
}
else
{
std::cout<<"SUCCESS"<<std::endl;
analog->register_change_handler ( NULL, vrpnThread::handleAnalog );
while(true)
{
analog->mainloop();
}
}
}
In the paraview GUI i have a button when pressed launches a connection to a
vrpn server, as follows:
void SourceToolbarActions::connectVRPNServer(void)
{
vrpnThread theThread;
theThread.start();
}
So, when i click the GUI button a message appears saying the following:
QThread: Destroyed while thread is still running...
I have put the thread to wait also
theThread.wait()
but if i do this its obviously that Paraview's GUI will get blocked...
Any ideas how to work around this problem...
Thanks in advance.
Any idea what i am doing wrong?
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview