| 1412 | } |
| 1413 | |
| 1414 | int Graph::findNode(const std::string& name, const std::string& type) |
| 1415 | { |
| 1416 | int count = 0; |
| 1417 | for (size_t i = 0; i < _state.nodes.size(); i++) |
| 1418 | { |
| 1419 | if (_state.nodes[i]->getName() == name) |
| 1420 | { |
| 1421 | if (type == "node" && _state.nodes[i]->getNode() != nullptr) |
| 1422 | { |
| 1423 | return count; |
| 1424 | } |
| 1425 | else if (type == "input" && _state.nodes[i]->getInput() != nullptr) |
| 1426 | { |
| 1427 | return count; |
| 1428 | } |
| 1429 | else if (type == "output" && _state.nodes[i]->getOutput() != nullptr) |
| 1430 | { |
| 1431 | return count; |
| 1432 | } |
| 1433 | else if (type == "nodegraph" && _state.nodes[i]->getNodeGraph() != nullptr) |
| 1434 | { |
| 1435 | return count; |
| 1436 | } |
| 1437 | } |
| 1438 | count++; |
| 1439 | } |
| 1440 | return -1; |
| 1441 | } |
| 1442 | |
| 1443 | int Graph::findUpstreamNode(mx::InputPtr input) |
| 1444 | { |