MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / extractTreesFromNodes

Function extractTreesFromNodes

Gui/NodeGraphUndoRedo.cpp:1279–1319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1277}
1278
1279static void
1280extractTreesFromNodes(const std::list<NodeGuiPtr> & nodes,
1281 std::list<ExtractedTree>& trees)
1282{
1283 std::list<NodeGuiPtr> markedNodes;
1284
1285 for (std::list<NodeGuiPtr> ::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
1286 bool isOutput = !hasNodeOutputsInList(nodes, *it);
1287 if (isOutput) {
1288 ExtractedTree tree;
1289 tree.output.node = *it;
1290 NodePtr n = (*it)->getNode();
1291 const NodesWList& outputs = n->getGuiOutputs();
1292 for (NodesWList::const_iterator it2 = outputs.begin(); it2 != outputs.end(); ++it2) {
1293 NodePtr output = it2->lock();
1294 if (!output) {
1295 continue;
1296 }
1297 int idx = output->inputIndex(n);
1298 tree.output.outputs.push_back( std::make_pair(idx, output) );
1299 }
1300
1301 const std::vector<Edge*>& inputs = (*it)->getInputsArrows();
1302 for (U32 i = 0; i < inputs.size(); ++i) {
1303 NodeGuiPtr input = inputs[i]->getSource();
1304 if (input) {
1305 addTreeInputs(nodes, input, tree, markedNodes);
1306 }
1307 }
1308
1309 if ( tree.inputs.empty() ) {
1310 ExtractedInput input;
1311 input.node = *it;
1312 input.inputs = n->getGuiInputs();
1313 tree.inputs.push_back(input);
1314 }
1315
1316 trees.push_back(tree);
1317 }
1318 }
1319}
1320
1321///////////////
1322

Callers 4

redoMethod · 0.85

Calls 11

inputIndexMethod · 0.80
getSourceMethod · 0.80
emptyMethod · 0.80
hasNodeOutputsInListFunction · 0.70
addTreeInputsFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
getNodeMethod · 0.45
lockMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected