<!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&nbsp;my code is&nbsp;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-&gt;AddObserver(vtkCommand::ProgressEvent,&amp;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&nbsp;fraction between&nbsp;0 and 1).<BR>How do I get it? I tried "this-&gt;GetProgress()" but&nbsp;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>&nbsp;return new CProgressObserver;<BR>}<BR>virtual void Execute(vtkObject* caller, unsigned long, void *callData) {<BR>&nbsp;double* dProgress = (double*)(callData);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp; //The progressbar is in the MainFrame<BR>&nbsp; CMainFrame* pFrame = (CMainFrame*) AfxGetApp()-&gt;m_pMainWnd;<BR>&nbsp;&nbsp;&nbsp; CStatusProgress* setprogress = &amp;pFrame-&gt;progress;&nbsp;<BR><BR>&nbsp; //Here I'd like to set the progressbar to the actual progress of my processobject<BR>&nbsp; setprogress-&gt;SetPos(?????);<BR>}<BR>};<BR><BR>----------------------------------------------------------------<BR>Later in my code:<BR>----------------------------------------------------------------<BR>&nbsp;<BR>&nbsp;&nbsp;CProgressObserver Proc;<BR>&nbsp;&nbsp;CProgressObserverEnd ProcEnd;<BR>&nbsp; m_openclose-&gt;AddObserver(vtkCommand::ProgressEvent,&amp;Proc); <BR><BR><BR>Any help would be greatly appreciated,<BR>&nbsp;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>