<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>hmmm, maybe </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
dynamic_cast<vtkAlgorithm*>(caller)->GetProgress();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>works....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Toon Huysmans.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=bocsiesseigaz@citromail.hu
href="mailto:bocsiesseigaz@citromail.hu">Bocsi Esseigaz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, December 01, 2004 5:10
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Getting the progress
state of a process object - What'swrong with this?</DIV>
<DIV><BR></DIV>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>This is the private
VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></BODY></HTML>