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

Method GetInputConnection

Common/ExecutionModel/vtkAlgorithm.cxx:1622–1648  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1620
1621//------------------------------------------------------------------------------
1622vtkAlgorithmOutput* vtkAlgorithm::GetInputConnection(int port, int index)
1623{
1624 if (port < 0 || port >= this->GetNumberOfInputPorts())
1625 {
1626 vtkErrorMacro("Attempt to get connection index " << index << " for input port " << port
1627 << ", for an algorithm with "
1628 << this->GetNumberOfInputPorts() << " ports.");
1629 return nullptr;
1630 }
1631 if (index < 0 || index >= this->GetNumberOfInputConnections(port))
1632 {
1633 return nullptr;
1634 }
1635 if (vtkInformation* info = this->GetExecutive()->GetInputInformation(port, index))
1636 {
1637 // Get the executive producing this input. If there is none, then
1638 // it is a nullptr input.
1639 vtkExecutive* producer;
1640 int producerPort;
1641 vtkExecutive::PRODUCER()->Get(info, producer, producerPort);
1642 if (producer)
1643 {
1644 return producer->GetAlgorithm()->GetOutputPort(producerPort);
1645 }
1646 }
1647 return nullptr;
1648}
1649
1650//------------------------------------------------------------------------------
1651void vtkAlgorithm::Update()

Callers 5

RemoveInputConnectionMethod · 0.95
GetInputAlgorithmMethod · 0.95
SetInputDataObjectMethod · 0.95
GetInputExecutiveMethod · 0.45
ForwardUpstreamMethod · 0.45

Calls 7

GetNumberOfInputPortsMethod · 0.95
GetExecutiveMethod · 0.95
GetAlgorithmMethod · 0.80
GetInputInformationMethod · 0.45
GetMethod · 0.45
GetOutputPortMethod · 0.45

Tested by

no test coverage detected