Make the lighting preference affect the active viewer and remove unconnected action "Set Lighting..." from the viewers menu.

This commit is contained in:
Maxime Gimeno 2019-04-24 11:06:21 +02:00
parent bd00eed73b
commit cc8aa0ec41
1 changed files with 10 additions and 9 deletions

View File

@ -1133,7 +1133,7 @@ void MainWindow::open(QString filename)
default:
load_pair = File_loader_dialog::getItem(fileinfo.fileName(), selected_items, &ok);
}
viewer->makeCurrent();
//viewer->makeCurrent();
if(!ok || load_pair.first.isEmpty()) { return; }
if (load_pair.second)
@ -1856,7 +1856,8 @@ void MainWindow::on_actionLoad_triggered()
dialog.setFileMode(QFileDialog::ExistingFiles);
if(dialog.exec() != QDialog::Accepted) { return; }
viewer->update();
for(auto v : CGAL::QGLViewer::QGLViewerPool())
v->update();
FilterPluginMap::iterator it =
filterPluginMap.find(dialog.selectedNameFilter());
@ -2012,7 +2013,8 @@ void MainWindow::on_actionSaveAs_triggered()
{
filename = filename.append(filter_ext);
}
viewer->update();
for(auto v : CGAL::QGLViewer::QGLViewerPool())
v->update();
save(filename, item);
}
}
@ -2295,7 +2297,7 @@ void MainWindow::setBackgroundColor()
void MainWindow::setLighting_triggered()
{
viewer->setLighting();
qobject_cast<Viewer*>(CGAL::Three::Three::activeViewer())->setLighting();
}
void MainWindow::viewerShowObject()
@ -2544,7 +2546,8 @@ void MainWindow::setExpanded(QModelIndex index)
void MainWindow::setMaxTextItemsDisplayed(int val)
{
viewer->textRenderer()->setMax(val);
for(auto v : CGAL::QGLViewer::QGLViewerPool())
qobject_cast<CGAL::Three::Viewer_interface*>(v)->textRenderer()->setMax(val);
}
void MainWindow::resetHeader()
@ -2603,7 +2606,8 @@ void MainWindow::colorItems()
{
scene->item(id)->setColor(colors_[++nb_item]);
}
viewer->update();
for(auto v : CGAL::QGLViewer::QGLViewerPool())
v->update();
}
@ -3023,9 +3027,6 @@ SubViewer::SubViewer(QWidget *parent, MainWindow* mw, Viewer* mainviewer)
actionOrtho->setCheckable(true);
actionOrtho->setChecked(false);
viewMenu->addAction(actionOrtho);
QAction* actionLight = new QAction("L&ighting...",this);
actionLight->setObjectName("actionLight");
viewMenu->addAction(actionLight);
QAction* actionTotalPass = new QAction("Set Transparency Pass &Number...",this);
actionTotalPass->setObjectName("actionTotalPass");
viewMenu->addAction(actionTotalPass);