[vtkusers] Getting the progress state of a process object - What's wrong with this?

Bocsi Esseigaz bocsiesseigaz at citromail.hu
Wed Dec 1 11:10:38 EST 2004

Hi all,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.What my code does:I created a class (derived from vtkCommand) and overrode the virtual Execute() method.In my code I use ProcessObject->AddObserver(vtkCommand::ProgressEvent,&Proc) method (where Proc is an instance of the class derived from vtkCommand).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).How do I get it? I tried "this->GetProgress()" but didn't compile...Here's the code:----------------------------------------------------------------The header file of the class CProgressObserver:----------------------------------------------------------------class CProgressObserver : public vtkCommand {public:static CProgressObserver* New() { return new CProgressObserver;}virtual void Execute(vtkObject* caller, unsigned long, void *callData) { double* dProgress = (double*)(callData);      //The progressbar is in the MainFrame  CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;    CStatusProgress* setprogress = &pFrame->progress;   //Here I'd like to set the progressbar to the actual progress of my processobject  setprogress->SetPos(?????);}};----------------------------------------------------------------Later in my code:----------------------------------------------------------------   CProgressObserver Proc;  CProgressObserverEnd ProcEnd;  m_openclose->AddObserver(vtkCommand::ProgressEvent,&Proc); Any help would be greatly appreciated, Esseigaz

Free vagy, de ez nem elég?
Szabadulj meg a kéretlen reklámlevelektől!
Nyiss egy kényelmes 20MB-os postafiókot ingyen!
CitroMail.hu - Stabil, gyors, kedves

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041201/a13ea371/attachment.htm>

More information about the vtkusers mailing list