30 this->SetInput(0, const_cast<mitk::Surface *>(surface));
35 if (this->GetInput(idx) != surface)
37 this->SetNthInput(idx, const_cast<mitk::Surface *>(surface));
38 this->CreateOutputForInput(idx);
45 if (this->GetNumberOfInputs() < 1)
48 return static_cast<const mitk::Surface *
>(this->ProcessObject::GetInput(0));
53 if (this->GetNumberOfInputs() < 1)
56 return static_cast<const mitk::Surface *
>(this->ProcessObject::GetInput(idx));
61 if (this->GetNumberOfIndexedInputs() < idx || this->GetInput(idx) ==
nullptr)
63 mitkThrow() <<
"Error creating output for input [" << idx <<
"]. Input does not exists!";
66 if (this->GetNumberOfIndexedOutputs() <= idx)
67 this->SetNumberOfIndexedOutputs(idx + 1);
69 if (this->GetOutput(idx) ==
nullptr)
72 this->SetNthOutput(idx, newOutput);
74 this->GetOutput(idx)->Graft(this->GetInput(idx));
80 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
81 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedInputs(); ++idx)
83 if (this->GetOutput(idx) ==
nullptr)
86 this->SetNthOutput(idx, newOutput);
88 this->GetOutput(idx)->Graft(this->GetInput(idx));
95 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedInputs(); ++idx)
97 if (this->GetInput(idx) == surface)
99 this->RemoveOutput(idx);
Superclass of all classes generating surfaces (instances of class Surface) as output.
Class for storing surfaces (vtkPolyData).
virtual ~SurfaceToSurfaceFilter()
virtual const mitk::Surface * GetInput()
virtual void RemoveInputs(mitk::Surface *surface)
virtual void CreateOutputsForAllInputs()
Creates outputs for all existing inputs.
virtual void CreateOutputForInput(unsigned int idx)
Create a new output for the input at idx.
itk::DataObject::Pointer DataObjectPointer
virtual void SetInput(const mitk::Surface *surface)