MCPcopy Create free account
hub / github.com/Kitware/VTK / SetNumberOfInputConnections

Method SetNumberOfInputConnections

Common/ExecutionModel/vtkAlgorithm.cxx:1486–1517  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1484
1485//------------------------------------------------------------------------------
1486void vtkAlgorithm::SetNumberOfInputConnections(int port, int n)
1487{
1488 // Get the consumer executive and port number.
1489 vtkExecutive* consumer = this->GetExecutive();
1490 int consumerPort = port;
1491
1492 // Get the vector of connected input information objects.
1493 vtkInformationVector* inputs = consumer->GetInputInformation(consumerPort);
1494
1495 // If the number of connections has not changed, do nothing.
1496 if (n == inputs->GetNumberOfInformationObjects())
1497 {
1498 return;
1499 }
1500
1501 // Remove connections beyond the new number.
1502 for (int i = n; i < inputs->GetNumberOfInformationObjects(); ++i)
1503 {
1504 // Remove each input's reference to this consumer.
1505 if (vtkInformation* oldInfo = inputs->GetInformationObject(i))
1506 {
1507 vtkExecutive::CONSUMERS()->Remove(oldInfo, consumer, consumerPort);
1508 }
1509 }
1510
1511 // Set the number of connected inputs. Non-existing inputs will be
1512 // empty information objects.
1513 inputs->SetNumberOfInformationObjects(n);
1514
1515 // This algorithm has been modified.
1516 this->Modified();
1517}
1518
1519//------------------------------------------------------------------------------
1520vtkAlgorithmOutput* vtkAlgorithm::GetOutputPort(int port)

Callers 6

SetNumberOfInputPortsMethod · 0.95
SetSourceTableTreeMethod · 0.80
SetNumberOfInputsMethod · 0.80
SetNumberOfInputsMethod · 0.80

Calls 6

GetExecutiveMethod · 0.95
GetInformationObjectMethod · 0.80
GetInputInformationMethod · 0.45
RemoveMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected