void QViewWidget::addScene(osg::Group * sceneRoot, QString name) { bool showGrid = true; bool showAxes = true; if (name.toStdString() == "dummy") showGrid = showAxes = false; ViewWidget * viewWidget = splitter-> addViewWidget(splitter->createCamera(0,0,100,100), sceneRoot, showGrid, showAxes); if (viewWidget) { if (name.toStdString() != "dummy") sceneSelection.addItem(name); sceneStack->addWidget(viewWidget->getWidget()); if (viewMap.count() == 1) sceneStack->setCurrentWidget(viewWidget->getWidget()); viewMap.insert(name, viewWidget); } }
void QViewWidget::setSelectedScene(int index) { ViewWidget * viewWidget = viewMap.value(sceneSelection.itemText(index)); sceneStack->setCurrentWidget(viewWidget->getWidget()); viewWidget->getView()->requestRedraw(); }