------------------------------------------------------------------------------ This is the superclasses style of Execute method. Convert it into an imaging style Execute method.
| 37 | // This is the superclasses style of Execute method. Convert it into |
| 38 | // an imaging style Execute method. |
| 39 | int vtkImageAlgorithm::RequestData(vtkInformation* request, |
| 40 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 41 | { |
| 42 | // the default implementation is to do what the old pipeline did find what |
| 43 | // output is requesting the data, and pass that into ExecuteData |
| 44 | |
| 45 | // which output port did the request come from |
| 46 | int outputPort = request->Get(vtkDemandDrivenPipeline::FROM_OUTPUT_PORT()); |
| 47 | |
| 48 | // if output port is negative then that means this filter is calling the |
| 49 | // update directly, in that case just assume port 0 |
| 50 | if (outputPort == -1) |
| 51 | { |
| 52 | outputPort = 0; |
| 53 | } |
| 54 | |
| 55 | // get the data object |
| 56 | vtkInformation* outInfo = outputVector->GetInformationObject(outputPort); |
| 57 | // call ExecuteData |
| 58 | this->SetErrorCode(vtkErrorCode::NoError); |
| 59 | if (outInfo) |
| 60 | { |
| 61 | this->ExecuteDataWithInformation(outInfo->Get(vtkDataObject::DATA_OBJECT()), outInfo); |
| 62 | } |
| 63 | else |
| 64 | { |
| 65 | this->ExecuteData(nullptr); |
| 66 | } |
| 67 | // Check for any error set by downstream filter (IO in most case) |
| 68 | if (this->GetErrorCode()) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | return 1; |
| 74 | } |
| 75 | |
| 76 | //------------------------------------------------------------------------------ |
| 77 | vtkTypeBool vtkImageAlgorithm::ProcessRequest( |
no test coverage detected