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

Function addTreeInputs

Engine/Project.cpp:2790–2825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2788}
2789
2790static void
2791addTreeInputs(const NodesList& nodes,
2792 const NodePtr& node,
2793 Project::NodesTree& tree,
2794 NodesList& markedNodes)
2795{
2796 if ( std::find(markedNodes.begin(), markedNodes.end(), node) != markedNodes.end() ) {
2797 return;
2798 }
2799
2800 if ( std::find(nodes.begin(), nodes.end(), node) == nodes.end() ) {
2801 return;
2802 }
2803
2804 if ( !hasNodeInputsInList(nodes, node) ) {
2805 Project::TreeInput input;
2806 input.node = node;
2807 const std::vector<NodeWPtr>& inputs = node->getGuiInputs();
2808 input.inputs.resize( inputs.size() );
2809 for (std::size_t i = 0; i < inputs.size(); ++i) {
2810 input.inputs[i] = inputs[i].lock();
2811 }
2812 tree.inputs.push_back(input);
2813 markedNodes.push_back(node);
2814 } else {
2815 tree.inbetweenNodes.push_back(node);
2816 markedNodes.push_back(node);
2817 const std::vector<NodeWPtr>& inputs = node->getGuiInputs();
2818 for (std::vector<NodeWPtr>::const_iterator it2 = inputs.begin(); it2 != inputs.end(); ++it2) {
2819 NodePtr input = it2->lock();
2820 if (input) {
2821 addTreeInputs(nodes, input, tree, markedNodes);
2822 }
2823 }
2824 }
2825}
2826
2827void
2828Project::extractTreesFromNodes(const NodesList& nodes,

Callers 1

extractTreesFromNodesMethod · 0.70

Calls 7

hasNodeInputsInListFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected