| 782 | typedef std::list<TreePtr> TreePtrList; |
| 783 | |
| 784 | void |
| 785 | Tree::buildTreeInternal(const NodesGuiList& selectedNodes, |
| 786 | NodeGui* currentNode, |
| 787 | const QPointF & currentNodeScenePos, |
| 788 | std::list<NodeGui*> & usedNodes) |
| 789 | { |
| 790 | QSize nodeSize = currentNode->getSize(); |
| 791 | NodePtr internalNode = currentNode->getNode(); |
| 792 | const std::vector<Edge*> & inputs = currentNode->getInputsArrows(); |
| 793 | NodeGuiPtr firstNonMaskInput; |
| 794 | NodesGuiList otherNonMaskInputs; |
| 795 | NodesGuiList maskInputs; |
| 796 | |
| 797 | for (U32 i = 0; i < inputs.size(); ++i) { |
| 798 | NodeGuiPtr source = inputs[i]->getSource(); |
| 799 | |
| 800 | ///Check if the source is selected |
| 801 | NodesGuiList::const_iterator foundSelected = std::find(selectedNodes.begin(), selectedNodes.end(), source); |
| 802 | if ( foundSelected == selectedNodes.end() ) { |
| 803 | continue; |
| 804 | } |
| 805 | |
| 806 | if (source) { |
| 807 | bool isMask = internalNode->getEffectInstance()->isInputMask(i); |
| 808 | if (!firstNonMaskInput && !isMask) { |
| 809 | firstNonMaskInput = source; |
| 810 | for (std::list<TreeNode>::iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) { |
| 811 | if (it2->first == firstNonMaskInput) { |
| 812 | firstNonMaskInput.reset(); |
| 813 | break; |
| 814 | } |
| 815 | } |
| 816 | } else if (!isMask) { |
| 817 | bool found = false; |
| 818 | for (std::list<TreeNode>::iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) { |
| 819 | if (it2->first == source) { |
| 820 | found = true; |
| 821 | break; |
| 822 | } |
| 823 | } |
| 824 | if (!found) { |
| 825 | otherNonMaskInputs.push_back(source); |
| 826 | } |
| 827 | } else if (isMask) { |
| 828 | bool found = false; |
| 829 | for (std::list<TreeNode>::iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) { |
| 830 | if (it2->first == source) { |
| 831 | found = true; |
| 832 | break; |
| 833 | } |
| 834 | } |
| 835 | if (!found) { |
| 836 | maskInputs.push_back(source); |
| 837 | } |
| 838 | } else { |
| 839 | ///this can't be happening |
| 840 | assert(false); |
| 841 | } |
nothing calls this directly
no test coverage detected