vtkImageAlgorithm::GetInput() doesn't return vtkImageData* but vtkDataObject*
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I think vtkImageAlgorithm::GetInput() should return a pointer to vtkImageData. I found the same error in another class, vtkDataSetAlgorithm, too. Is this an intended API change for VTK5?
Index: Filtering/vtkImageAlgorithm.h
--- Filtering/vtkImageAlgorithm.h.orig +++ Filtering/vtkImageAlgorithm.h @@ -54,8 +54,8 @@ // methods because they are not the only way to connect a pipeline void SetInput(vtkDataObject ); void SetInput(int, vtkDataObject);
- vtkDataObject *GetInput(int port);
- vtkDataObject *GetInput() { return this->GetInput(0); };
-
vtkImageData *GetInput(int port);
-
vtkImageData *GetInput() { return this->GetInput(0); };
// Description: // Add an input of this algorithm. Index: Filtering/vtkImageAlgorithm.cxx =================================================================== --- Filtering/vtkImageAlgorithm.cxx.orig +++ Filtering/vtkImageAlgorithm.cxx @@ -375,13 +375,13 @@ }
//---------------------------------------------------------------------------- -vtkDataObject* vtkImageAlgorithm::GetInput(int port) +vtkImageData* vtkImageAlgorithm::GetInput(int port) { if (this->GetNumberOfInputConnections(port) < 1) { return 0; }
- return this->GetExecutive()->GetInputData(port, 0);
- return vtkImageData::SafeDownCast(this->GetExecutive()->GetInputData(port, 0)); }
//----------------------------------------------------------------------------