------------------------------------------------------------------------------
| 993 | |
| 994 | //------------------------------------------------------------------------------ |
| 995 | void vtkAlgorithm::SetNumberOfInputPorts(int n) |
| 996 | { |
| 997 | // Sanity check. |
| 998 | if (n < 0) |
| 999 | { |
| 1000 | vtkErrorMacro("Attempt to set number of input ports to " << n); |
| 1001 | n = 0; |
| 1002 | } |
| 1003 | |
| 1004 | // We must remove all connections from ports that are removed. |
| 1005 | for (int i = n; i < this->GetNumberOfInputPorts(); ++i) |
| 1006 | { |
| 1007 | this->SetNumberOfInputConnections(i, 0); |
| 1008 | } |
| 1009 | |
| 1010 | // Set the number of input port information objects. |
| 1011 | this->InputPortInformation->SetNumberOfInformationObjects(n); |
| 1012 | } |
| 1013 | |
| 1014 | //------------------------------------------------------------------------------ |
| 1015 | int vtkAlgorithm::GetNumberOfOutputPorts() |