Thanks Clint,<br><br>Just for future search purposes, works fine.<br><br>Wagner Sales<br><br><div><span class="gmail_quote">2006/5/4, Clinton Stimpson <<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>>:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Here's probably enough for you to work from:<br><br>========================<br> this->EventQtSlot = vtkEventQtSlotConnect::New();
<br> ....<br> vtkPExodusReader *exodusReader = vtkPExodusReader::New();<br><br> this->EventQtSlot->Connect(exodusReader,vtkCommand::ProgressEvent,<br> this,SLOT(ExodusReaderProgress(vtkObject *, unsigned long,
<br>void*,void*)));<br><br> exodusReader-> do some stuff and read the file<br><br> this->EventQtSlot->Disconnect(exodusReader,vtkCommand::ProgressEvent,<br> this,SLOT(ExodusReaderProgress(vtkObject *, unsigned long,
<br>void*,void*)));<br><br>=============================<br><br>void PMainWindow::ExodusReaderProgress(vtkObject *, unsigned long,<br>void*, void* progress)<br>{<br> double* amount=(double*)progress;<br> int step=(int)*amount*100;
<br> this->ProgressWidget->SetSubProgress(step);<br>}<br><br>Clint<br><br><br><br>Wagner Sales wrote:<br>> Hi VTK Developers,<br>><br>> I was posted this message at vtk-users, but unfortunatelly, no answer was sended back.
<br>> Then, i'm posting here and put more two considerations:<br>> 1 - I suggest to include an example about this topic in future vtk releases ( Examples/GUI/Qt/Events ).<br>><br>><br>> 2 - I was tried just with the vtkDICOMImageReader, not with others filters. In ITK this problem only occurs with readers, but I was gived the desired behaviour with others filters (
e.g segmentation filters). May be in VTK are the same?<br>><br>><br>><br>> Since I'm using Qt, i'm familiar with the slot/connection facilty, but not so familiar with the add observer pattern, just by I was readed in vtk books.
<br>><br>> Thks a lot by any suggestions, example...<br>><br>><br>> Wagner sales<br>><br>><br>> --- POSTED MESSAGE:<br>> Hi all,<br>><br>> I'm trying to use the progress event from a vtkDICOMImageReader to
<br>> change the status ( percent ) on a QProgressBar widget.<br>> I was readed the Examples/GUI/Qt, and based on this, StartEvent and<br>><br>><br>> EndEvent are working fine to me by using the following code:
<br>><br>> // my connections, based on vtkEventQtSlotConnect<br>> m_connector->Connect( m_dicomReader, vtkCommand::EndEvent, this,<br>> SLOT(slotEnded(vtkObject*)));<br>><br>><br>> m_connector->Connect( m_dicomReader, vtkCommand::StartEvent, this,
<br>> SLOT(slotStarted(vtkObject*)));<br>> // my slots:<br>> void MyWidget::slotStarted(vtkObject* obj)<br>> {<br>> std::cout << "---> Dicom reader started!" << endl;<br>>
<br>><br>> }<br>> void MyWidget::slotEnded(vtkObject* obj)<br>> {<br>> std::cout << "---> Dicom reader ended!" << endl;<br>> }<br>><br>> Well, before to set my QProgressBar progress I was just put some output
<br>><br>><br>> to std::cout ( code are at the end ).<br>> Then, I'm trying to do the same with the ProgressEvent, but only one<br>> time are showed to me the message:<br>> -- Progress: 0<br>> -- Progress Text:
<br>><br>> Someone have some help or example how to use?<br>><br>><br>> The code to understand are here:<br>><br>> //connection<br>> m_connector->Connect( m_dicomReader, vtkCommand::ProgressEvent, this,
<br>> SLOT(slotProgressChanged(vtkObject*)));<br>><br>> //slot<br>> void MyWidget::slotProgressChanged(vtkObject* obj)<br>><br>><br>> {<br>> vtkDICOMImageReader *r = vtkDICOMImageReader::SafeDownCast(obj);
<br>> std::cout << "-- Progress: " << r->GetProgress() << endl;<br>> std::cout << "-- Progress text: " << r->GetProgressText() << endl;<br>><br>
><br>> }<br>><br>> Thnks in advance,<br>><br>> Wagner Sales<br>><br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> vtk-developers mailing list<br>> <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers
</a><br>><br><br></blockquote></div><br>