diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 7df998e4964..c9ee0ce59e0 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -180,6 +180,18 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren shortcut = new QShortcut(QKeySequence(Qt::Key_F11), this); connect(shortcut, SIGNAL(activated()), this, SLOT(toggleFullScreen())); + shortcut = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_R), this); + connect(shortcut, &QShortcut::activated, + this, &MainWindow::recenterScene); + shortcut = new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_T), this); + connect(shortcut, &QShortcut::activated, + this, + [](){ + Viewer* viewer = qobject_cast(CGAL::Three::Three::activeViewer()); + bool b = viewer->property("draw_two_sides").toBool(); + viewer->setTwoSides(!b); + } + ); } proxyModel = new QSortFilterProxyModel(this); @@ -2397,7 +2409,7 @@ void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m) viewer->setAddKeyFrameKeyboardModifiers(m); } -void MainWindow::on_actionRecenterScene_triggered() +void MainWindow::recenterScene() { //force the recomputaion of the bbox bbox_need_update = true; @@ -3000,7 +3012,7 @@ QObject* MainWindow::getDirectChild(QObject* widget) return getDirectChild(widget->parent()); } -void MainWindow::on_action_Organize_Viewers_triggered() +void MainWindow::on_action_Rearrange_Viewers_triggered() { if(ui->mdiArea->subWindowList().size() == 1) ui->mdiArea->subWindowList().first()->showMaximized(); @@ -3051,7 +3063,7 @@ SubViewer::SubViewer(QWidget *parent, MainWindow* mw, Viewer* mainviewer) actionCopyCamera->setObjectName("actionCopyCamera"); QAction* actionPasteCamera = new QAction("&Paste Camera",this); actionPasteCamera->setObjectName("actionPasteCamera"); - QMenu* cameraMenu = new QMenu("Camera", mw); + QMenu* cameraMenu = new QMenu("Ca&mera", mw); cameraMenu->addAction(actionDumpCamera); cameraMenu->addAction(actionCopyCamera); cameraMenu->addAction(actionPasteCamera); @@ -3067,12 +3079,12 @@ SubViewer::SubViewer(QWidget *parent, MainWindow* mw, Viewer* mainviewer) actionDrawTwoSide->setCheckable(true); actionDrawTwoSide->setChecked(false); viewMenu->addAction(actionDrawTwoSide); - QAction* actionQuick = new QAction("Quick Camera Mode",this); + QAction* actionQuick = new QAction("&Quick Camera Mode",this); actionQuick->setObjectName("actionQuick"); actionQuick->setCheckable(true); actionQuick->setChecked(true); viewMenu->addAction(actionQuick); - QAction* actionOrtho = new QAction("Orthographic Projection",this); + QAction* actionOrtho = new QAction("&Orthographic Projection",this); actionOrtho->setObjectName("actionOrtho"); actionOrtho->setCheckable(true); actionOrtho->setChecked(false); @@ -3155,6 +3167,9 @@ void SubViewer::changeEvent(QEvent *event) //| Qt::WindowSystemMenuHint | Qt::WindowTitleHint ); + QAction* action = mw->findChild("action_Rearrange_Viewers"); + action->setVisible(false); + viewer->update(); } else { @@ -3170,6 +3185,10 @@ void SubViewer::changeEvent(QEvent *event) | Qt::WindowSystemMenuHint | Qt::WindowTitleHint ); + QAction* action = mw->findChild("action_Rearrange_Viewers"); + action->setVisible(true); + for(auto v : CGAL::QGLViewer::QGLViewerPool()) + v->update(); } } } diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 8ddb5611649..576eaac5e12 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -362,7 +362,7 @@ protected Q_SLOTS: //!menus. void filterOperations(); //!Updates the bounding box and moves the camera to fits the scene. - void on_actionRecenterScene_triggered(); + void recenterScene(); //!Resizes the header of the scene view void resetHeader(); //!apply an action named `name` to all selected items @@ -463,7 +463,7 @@ private: private Q_SLOTS: void on_actionAdd_Viewer_triggered(); - void on_action_Organize_Viewers_triggered(); + void on_action_Rearrange_Viewers_triggered(); void recenterViewer(); private: diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index 06257db41c7..a011dedab64 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -93,8 +93,7 @@ - - + @@ -449,17 +448,9 @@ Add &Viewer - + - &Organize Viewers - - - - - Recenter Scene - - - Ctrl+R + &Rearrange Viewers @@ -476,8 +467,6 @@ - -