<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
dynamic_cast&lt;vtkAlgorithm*&gt;(caller)-&gt;GetProgress();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>works....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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&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>
  <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>