Commit 57907496 authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

ExecuteInformation / ExecuteData should return on error

Need also to make sure error is cleared out before Execute

Change-Id: I9319a36f432472f8ad240371118183a1014a6906
parent 51afa1c4
......@@ -21,6 +21,7 @@
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkErrorCode.h"
#include "vtkStreamingDemandDrivenPipeline.h"
......@@ -72,6 +73,7 @@ int vtkImageAlgorithm::RequestData(
vtkInformation *outInfo =
outputVector->GetInformationObject(outputPort);
// call ExecuteData
this->SetErrorCode( vtkErrorCode::NoError );
if (outInfo)
{
this->ExecuteData( outInfo->Get(vtkDataObject::DATA_OBJECT()) );
......@@ -80,6 +82,12 @@ int vtkImageAlgorithm::RequestData(
{
this->ExecuteData(NULL);
}
// Check for any error set by downstream filter (IO in most case)
if ( this->GetErrorCode() )
{
return 0;
}
return 1;
}
......
......@@ -21,6 +21,7 @@
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkErrorCode.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkStringArray.h"
......@@ -508,9 +509,15 @@ int vtkImageReader2::RequestInformation (
vtkInformationVector** vtkNotUsed( inputVector ),
vtkInformationVector * outputVector)
{
this->SetErrorCode( vtkErrorCode::NoError );
// call for backwards compatibility
this->ExecuteInformation();
// Check for any error set by downstream filter (IO in most case)
if ( this->GetErrorCode() )
{
return 0;
}
// get the info objects
vtkInformation* outInfo = outputVector->GetInformationObject(0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment