| 738 | } |
| 739 | |
| 740 | void MainWindow::onRequestSubTreeExpand(GraphicContainer& container, |
| 741 | QtNodes::Node& node) |
| 742 | { |
| 743 | auto subtree = dynamic_cast< SubtreeNodeModel*>( node.nodeDataModel() ); |
| 744 | |
| 745 | if( !subtree ) |
| 746 | { |
| 747 | throw std::logic_error("passing to onRequestSubTreeExpand something that is not a SubTree"); |
| 748 | } |
| 749 | |
| 750 | if( subtree->expanded() ) |
| 751 | { |
| 752 | subTreeExpand( container, node, SUBTREE_COLLAPSE ); |
| 753 | } |
| 754 | else |
| 755 | { |
| 756 | subTreeExpand( container, node, SUBTREE_EXPAND ); |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | |
| 761 | void MainWindow::onAddToModelRegistry(const NodeModel &model) |