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

Method extractTreesFromNodes

Engine/Project.cpp:2827–2871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2825}
2826
2827void
2828Project::extractTreesFromNodes(const NodesList& nodes,
2829 std::list<Project::NodesTree>& trees)
2830{
2831 NodesList markedNodes;
2832
2833 for (NodesList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
2834 bool isOutput = !hasNodeOutputsInList(nodes, *it);
2835 if (isOutput) {
2836 NodesTree tree;
2837 tree.output.node = *it;
2838 const NodesWList& outputs = (*it)->getGuiOutputs();
2839 for (NodesWList::const_iterator it2 = outputs.begin(); it2 != outputs.end(); ++it2) {
2840 NodePtr output = it2->lock();
2841 if (!output) {
2842 continue;
2843 }
2844 int idx = output->inputIndex(*it);
2845 tree.output.outputs.push_back( std::make_pair(idx, *it2) );
2846 }
2847
2848 const std::vector<NodeWPtr>& inputs = (*it)->getGuiInputs();
2849 for (U32 i = 0; i < inputs.size(); ++i) {
2850 NodePtr input = inputs[i].lock();
2851 if (input) {
2852 addTreeInputs(nodes, input, tree, markedNodes);
2853 }
2854 }
2855
2856 if ( tree.inputs.empty() ) {
2857 TreeInput input;
2858 input.node = *it;
2859
2860 const std::vector<NodeWPtr>& inputs = (*it)->getGuiInputs();
2861 input.inputs.resize( inputs.size() );
2862 for (std::size_t i = 0; i < inputs.size(); ++i) {
2863 input.inputs[i] = inputs[i].lock();
2864 }
2865 tree.inputs.push_back(input);
2866 }
2867
2868 trees.push_back(tree);
2869 }
2870 }
2871}
2872
2873bool
2874Project::addFormat(const std::string& formatSpec)

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected