vtkPolyDataAlgorithm: how does Update() deal with return value of RequestData()?

void vtkPolyDataAlgorithm::Update() calls virtual int vtkPolyDataAlgorithm::RequestData(). MyAlgorithm is a subclass of vtkPolyDataAlgorithm, and overrides virtual int vtkPolyDataAlgorithm::RequestData(). But the Doxygen doesn’t describe what int value RequestData() should return in case of error. Based on some other example, I assumed a return value of ‘1’ means success, and return value of ‘0’ means error. But Update() returns void. So how can an application that calls Update() (which calls RequestData()), know that an error value was returned by RequestData()?
Thanks!

Hi, Tom,

vtkAlgorithm has a method called GetErrorCode(). Maybe you can try this one to test whether there was an error during the execution of the algorithm. I never implemented one myself though. Update() is just like saying “Algorithm, the data have changed, so you need to redo your computation.” Error checking during said computations must be done separately.

You can also attach an observer to any algorithm object with vtkAlgorithm::SetProgressObserver() to possibly monitor errors during the execution of the algorithm.

regards,

Paulo