| 793 | typedef std::list< boost::shared_ptr<Tree> > TreeList; |
| 794 | |
| 795 | void |
| 796 | Tree::buildTreeInternal(const NodesGuiList& selectedNodes, |
| 797 | NodeGui* currentNode, |
| 798 | const QPointF & currentNodeScenePos, |
| 799 | std::list<NodeGui*> & usedNodes) |
| 800 | { |
| 801 | QSize nodeSize = currentNode->getSize(); |
| 802 | NodePtr internalNode = currentNode->getNode(); |
| 803 | const std::vector<Edge*> & inputs = currentNode->getInputsArrows(); |
| 804 | NodeGuiPtr firstNonMaskInput; |
| 805 | NodesGuiList otherNonMaskInputs; |
| 806 | NodesGuiList maskInputs; |
| 807 | |
| 808 | for (U32 i = 0; i < inputs.size(); ++i) { |
| 809 | NodeGuiPtr source = inputs[i]->getSource(); |
| 810 | |
| 811 | ///Check if the source is selected |
| 812 | NodesGuiList::const_iterator foundSelected = std::find(selectedNodes.begin(), selectedNodes.end(), source); |
| 813 | if ( foundSelected == selectedNodes.end() ) { |
| 814 | continue; |
| 815 | } |
| 816 | |
| 817 | if (source) { |
| 818 | bool isMask = internalNode->getEffectInstance()->isInputMask(i); |
| 819 | if (!firstNonMaskInput && !isMask) { |
| 820 | firstNonMaskInput = source; |
| 821 | for (std::list<TreeNode>::iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) { |
| 822 | if (it2->first == firstNonMaskInput) { |
| 823 | firstNonMaskInput.reset(); |
| 824 | break; |
| 825 | } |
| 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 | otherNonMaskInputs.push_back(source); |
| 837 | } |
| 838 | } else if (isMask) { |
| 839 | bool found = false; |
| 840 | for (std::list<TreeNode>::iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) { |
| 841 | if (it2->first == source) { |
| 842 | found = true; |
| 843 | break; |
| 844 | } |
| 845 | } |
| 846 | if (!found) { |
| 847 | maskInputs.push_back(source); |
| 848 | } |
| 849 | } else { |
| 850 | ///this can't be happening |
| 851 | assert(false); |
| 852 | } |
nothing calls this directly
no test coverage detected