| 296 | } |
| 297 | |
| 298 | ed::PinId Graph::getOutputPin(UiNodePtr node, UiNodePtr upNode, UiPinPtr input) |
| 299 | { |
| 300 | if (upNode->getNodeGraph() != nullptr) |
| 301 | { |
| 302 | // For nodegraph need to get the correct output pin according to the names of the output nodes |
| 303 | mx::OutputPtr output; |
| 304 | if (input->getUiNode()->getNode()) |
| 305 | { |
| 306 | output = input->getUiNode()->getNode()->getConnectedOutput(input->getName()); |
| 307 | } |
| 308 | else if (input->getUiNode()->getNodeGraph()) |
| 309 | { |
| 310 | output = input->getUiNode()->getNodeGraph()->getConnectedOutput(input->getName()); |
| 311 | } |
| 312 | |
| 313 | if (output) |
| 314 | { |
| 315 | std::string outName = output->getName(); |
| 316 | for (UiPinPtr outputs : upNode->getOutputPins()) |
| 317 | { |
| 318 | if (outputs->getName() == outName) |
| 319 | { |
| 320 | return outputs->getPinId(); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | return ed::PinId(); |
| 325 | } |
| 326 | else |
| 327 | { |
| 328 | // For node need to get the correct output pin based on the output attribute |
| 329 | if (!upNode->getOutputPins().empty()) |
| 330 | { |
| 331 | std::string outputName = mx::EMPTY_STRING; |
| 332 | if (input->getInput()) |
| 333 | { |
| 334 | outputName = input->getInput()->getOutputString(); |
| 335 | } |
| 336 | else if (input->getOutput()) |
| 337 | { |
| 338 | outputName = input->getOutput()->getOutputString(); |
| 339 | } |
| 340 | |
| 341 | size_t pinIndex = 0; |
| 342 | if (!outputName.empty()) |
| 343 | { |
| 344 | for (size_t i = 0; i < upNode->getOutputPins().size(); i++) |
| 345 | { |
| 346 | if (upNode->getOutputPins()[i]->getName() == outputName) |
| 347 | { |
| 348 | pinIndex = i; |
| 349 | break; |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | return (upNode->getOutputPins()[pinIndex]->getPinId()); |
| 354 | } |
| 355 | return ed::PinId(); |
nothing calls this directly
no test coverage detected