[vtkusers] vtkXMLImageDataReader ProgressEvent

David Cole david.cole at kitware.com
Wed Apr 13 06:32:41 EDT 2005


Looks to me from the code in *IO/vtkXMLDataParser.cxx* like you should 
receive this event whenever UpdateProgress is called. From the various 
read routines, UpdateProgress gets called at the beginning with 0, at 
the end with 1 and in between with some fraction between 0 and 1 each 
time through the loop. If your data size is small enough, it will only 
go through the loop once and you'll just see a "1". If your data is 
large enough that it gets read in chunks, you should see a ProgressEvent 
for each chunk that gets read in.

Set a breakpoint in your Execute method and trace back up the call stack 
to the caller of UpdateProgress: maybe your data size is just small and 
things are working as they should.

Also: I'm looking at yesterday's CVS source code to answer this; perhaps 
there was a different issue in 4.2 that I'm unaware of?


Hope this helps,
David


Slobodan Miskovic wrote:

>Hallo folks,
>I'm having troubles geting progress update from vtkXMLImageDataReader.
>I've defined an observer class as
>
>class ProgressObserver : public vtkCommand {
>public:
>	static ProgressObserver* New() {
>		return new ProgressObserver;
>	}
>
>	virtual void Execute(vtkObject* caller, unsigned long, void *callData) {
>		std::cout << "!" << std::endl;
>	}
>};
>
>and have it connected to the reader as
>
>reader->AddObserver(vtkCommand::ProgressEvent, ProgressObserver::New());
>
>but i only get one call of the execute method, conciding with the end
>of file loading. Is xml reader supposed to dispatch progress events?
>And if so, how may i get the current progress in the Execute method
>(presumably some trickery with callData). This is happening on VTK4.2
>
>Thanks in advance, Slobodan
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050413/4911327a/attachment.htm>


More information about the vtkusers mailing list