<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2"></HEAD><BODY bgColor=#ffffff><P>Hi all,<BR>I'd like to link my VTK processes to a progressbar which in the statusbar. I think my code is almost OK, hopefully there shouldn't be much to change.<BR>What my code does:<BR>I created a class (derived from vtkCommand) and overrode the virtual Execute() method.<BR>In my code I use ProcessObject->AddObserver(vtkCommand::ProgressEvent,&Proc) method (where Proc is an instance of the class derived from vtkCommand).<BR>This works fine, because the overridden Execute() method gets called every time the process object starts but I don't know how to get the current state of progress (it should be a fraction between 0 and 1).<BR>How do I get it? I tried "this->GetProgress()" but didn't compile...<BR><BR>Here's the code:<BR><BR>----------------------------------------------------------------<BR>The header file of the class CProgressObserver:<BR>----------------------------------------------------------------<BR><BR>class CProgressObserver : public vtkCommand {<BR>public:<BR>static CProgressObserver* New() {<BR> return new CProgressObserver;<BR>}<BR>virtual void Execute(vtkObject* caller, unsigned long, void *callData) {<BR> double* dProgress = (double*)(callData);<BR> <BR> //The progressbar is in the MainFrame<BR> CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;<BR> CStatusProgress* setprogress = &pFrame->progress; <BR><BR> //Here I'd like to set the progressbar to the actual progress of my processobject<BR> setprogress->SetPos(?????);<BR>}<BR>};<BR><BR>----------------------------------------------------------------<BR>Later in my code:<BR>----------------------------------------------------------------<BR> <BR> CProgressObserver Proc;<BR> CProgressObserverEnd ProcEnd;<BR> m_openclose->AddObserver(vtkCommand::ProgressEvent,&Proc); <BR><BR><BR>Any help would be greatly appreciated,<BR> Esseigaz</P>
<p>--------------------------------------------------------------------------------<br>
Free vagy, de ez nem elég?<br>
Szabadulj meg a kéretlen reklámlevelektől!<br>
Nyiss egy kényelmes 20MB-os postafiókot ingyen!<br><br>
<a href="http://www.citromail.hu">CitroMail.hu</a> - Stabil, gyors, kedves<br>
</p></BODY></HTML>