| 696 | } // ViewerInstance::renderViewer |
| 697 | |
| 698 | static bool |
| 699 | checkTreeCanRender_internal(Node* node, |
| 700 | std::list<Node*>& marked) |
| 701 | { |
| 702 | if ( std::find(marked.begin(), marked.end(), node) != marked.end() ) { |
| 703 | return true; |
| 704 | } |
| 705 | |
| 706 | marked.push_back(node); |
| 707 | |
| 708 | // check that the nodes upstream have all their nonoptional inputs connected |
| 709 | int maxInput = node->getNInputs(); |
| 710 | for (int i = 0; i < maxInput; ++i) { |
| 711 | NodePtr input = node->getInput(i); |
| 712 | bool optional = node->getEffectInstance()->isInputOptional(i); |
| 713 | if (optional) { |
| 714 | continue; |
| 715 | } |
| 716 | if (!input) { |
| 717 | return false; |
| 718 | } else { |
| 719 | bool ret = checkTreeCanRender_internal(input.get(), marked); |
| 720 | if (!ret) { |
| 721 | return false; |
| 722 | } |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | return true; |
| 727 | } |
| 728 | |
| 729 | /** |
| 730 | * @brief Returns false if the tree has unconnected mandatory inputs |
no test coverage detected