| 360 | } |
| 361 | |
| 362 | void |
| 363 | Gui::createViewerGui(NodePtr viewer) |
| 364 | { |
| 365 | TabWidget* where = _imp->_nextViewerTabPlace; |
| 366 | |
| 367 | if (!where) { |
| 368 | where = getAnchor(); |
| 369 | } else { |
| 370 | _imp->_nextViewerTabPlace = NULL; // < resetting next viewer anchor to default |
| 371 | } |
| 372 | assert(where); |
| 373 | |
| 374 | ViewerInstance* v = viewer->isEffectViewer(); |
| 375 | assert(v); |
| 376 | |
| 377 | ViewerTab* tab = addNewViewerTab(v, where); |
| 378 | NodeGraph* graph = 0; |
| 379 | NodeCollectionPtr collection = viewer->getGroup(); |
| 380 | if (!collection) { |
| 381 | return; |
| 382 | } |
| 383 | NodeGroup* isGrp = dynamic_cast<NodeGroup*>( collection.get() ); |
| 384 | if (isGrp) { |
| 385 | NodeGraphI* graph_i = isGrp->getNodeGraph(); |
| 386 | assert(graph_i); |
| 387 | graph = dynamic_cast<NodeGraph*>(graph_i); |
| 388 | } else { |
| 389 | graph = getNodeGraph(); |
| 390 | } |
| 391 | assert(graph); |
| 392 | if (!graph) { |
| 393 | throw std::logic_error(""); |
| 394 | } |
| 395 | graph->setLastSelectedViewer(tab); |
| 396 | } |
| 397 | |
| 398 | const NodesGuiList & |
| 399 | Gui::getSelectedNodes() const |
no test coverage detected