Skip to content

Commit

Permalink
- animation tab
Browse files Browse the repository at this point in the history
  • Loading branch information
vwaurich committed Aug 18, 2016
1 parent ef5ae2c commit d67f06b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -156,6 +156,11 @@ MainWindow::MainWindow(QSplashScreen *pSplashScreen, bool debug, QWidget *parent
QShortcut *pAlgorithmicDebuggingShortcut = new QShortcut(QKeySequence("Ctrl+f5"), this);
connect(pAlgorithmicDebuggingShortcut, SIGNAL(activated()), SLOT(switchToAlgorithmicDebuggingPerspectiveSlot()));
mpPerspectiveTabbar->setTabToolTip(3, tr("Changes to debugging perspective (%1)").arg(pAlgorithmicDebuggingShortcut->key().toString()));
// 3d animation perspective
mpPerspectiveTabbar->addTab(QIcon(":/Resources/icons/debugger.svg"), tr("Animation"));
QShortcut *pAnimationShortcut = new QShortcut(QKeySequence("Ctrl+f6"), this);
connect(pAnimationShortcut, SIGNAL(activated()), SLOT(switchToAnimationPerspectiveSlot()));
mpPerspectiveTabbar->setTabToolTip(4, tr("Changes to animation perspective (%1)").arg(pAnimationShortcut->key().toString()));
// change the perspective when perspective tab bar selection is changed
connect(mpPerspectiveTabbar, SIGNAL(currentChanged(int)), SLOT(perspectiveTabChanged(int)));
// Create an object of QStatusBar
Expand Down Expand Up @@ -270,6 +275,7 @@ MainWindow::MainWindow(QSplashScreen *pSplashScreen, bool debug, QWidget *parent
mpCentralStackedWidget->addWidget(mpWelcomePageWidget);
mpCentralStackedWidget->addWidget(mpModelWidgetContainer);
mpCentralStackedWidget->addWidget(mpPlotWindowContainer);
mpCentralStackedWidget->addWidget(mpAnimationWindowContainer);
// set the layout
QGridLayout *pCentralgrid = new QGridLayout;
pCentralgrid->setVerticalSpacing(4);
Expand Down Expand Up @@ -2205,6 +2211,9 @@ void MainWindow::perspectiveTabChanged(int tabIndex)
case 3:
switchToAlgorithmicDebuggingPerspective();
break;
case 4:
switchToAnimationPerspective();
break;
default:
switchToWelcomePerspective();
break;
Expand Down Expand Up @@ -2279,6 +2288,16 @@ void MainWindow::switchToAlgorithmicDebuggingPerspectiveSlot()
mpPerspectiveTabbar->setCurrentIndex(3);
}

/*!
* \brief MainWindow::switchToAnimationPerspectiveSlot
* Slot activated when Ctrl+f6 is clicked.
* Switches to animation perspective.
*/
void MainWindow::switchToAnimationPerspectiveSlot()
{
mpPerspectiveTabbar->setCurrentIndex(4);
}

/*!
* \brief MainWindow::showConfigureDialog
* Slot activated when mpDebugConfigurationsAction triggered signal is raised.\n
Expand Down Expand Up @@ -3036,6 +3055,7 @@ void MainWindow::switchToPlottingPerspective()
mpGDBLoggerDockWidget->hide();
}


/*!
* \brief MainWindow::switchToAlgorithmicDebuggingPerspective
* Switches to algorithmic debugging perspective.
Expand All @@ -3060,6 +3080,17 @@ void MainWindow::switchToAlgorithmicDebuggingPerspective()
mpGDBLoggerDockWidget->show();
}


/*!
* \brief MainWindow::switchToAnimationPerspective
* Switches to animation perspective.
*/
void MainWindow::switchToAnimationPerspective()
{
storePlotWindowsStateAndGeometry();
mpCentralStackedWidget->setCurrentWidget(mpAnimationWindowContainer);
}

/*!
* \brief MainWindow::closeAllWindowsButThis
* Closes all windows except the active window.
Expand Down
6 changes: 6 additions & 0 deletions OMEdit/OMEditGUI/MainWindow.h
Expand Up @@ -67,6 +67,7 @@
#include "SimulationDialog.h"
#include "TLMCoSimulationDialog.h"
#include "Plotting/PlotWindowContainer.h"
#include "Animation/AnimationWindowContainer.h"
#include "ModelWidgetContainer.h"
#include "GDBAdapter.h"
#include "StackFramesWidget.h"
Expand All @@ -90,6 +91,7 @@ class GDBLoggerWidget;
class SimulationDialog;
class TLMCoSimulationDialog;
class PlotWindowContainer;
class AnimationWindowContainer;
class ModelWidgetContainer;
class InfoBar;
class WelcomePageWidget;
Expand Down Expand Up @@ -121,6 +123,7 @@ class MainWindow : public QMainWindow
SimulationDialog* getSimulationDialog() {return mpSimulationDialog;}
TLMCoSimulationDialog* getTLMCoSimulationDialog() {return mpTLMCoSimulationDialog;}
PlotWindowContainer* getPlotWindowContainer() {return mpPlotWindowContainer;}
AnimationWindowContainer* getAnimationWindowContainer() {return mpAnimationWindowContainer;}
ModelWidgetContainer* getModelWidgetContainer() {return mpModelWidgetContainer;}
WelcomePageWidget* getWelcomePageWidget() {return mpWelcomePageWidget;}
InfoBar* getInfoBar() {return mpInfoBar;}
Expand Down Expand Up @@ -232,6 +235,7 @@ class MainWindow : public QMainWindow
SimulationDialog *mpSimulationDialog;
TLMCoSimulationDialog *mpTLMCoSimulationDialog;
PlotWindowContainer *mpPlotWindowContainer;
AnimationWindowContainer *mpAnimationWindowContainer;
QList<Qt::WindowStates> mPlotWindowsStatesList;
QList<QByteArray> mPlotWindowsGeometriesList;
ModelWidgetContainer *mpModelWidgetContainer;
Expand Down Expand Up @@ -434,6 +438,7 @@ private slots:
void switchToModelingPerspectiveSlot();
void switchToPlottingPerspectiveSlot();
void switchToAlgorithmicDebuggingPerspectiveSlot();
void switchToAnimationPerspectiveSlot();
void showConfigureDialog();
void showAttachToProcessDialog();
private:
Expand All @@ -446,6 +451,7 @@ private slots:
void switchToModelingPerspective();
void switchToPlottingPerspective();
void switchToAlgorithmicDebuggingPerspective();
void switchToAnimationPerspective();
void closeAllWindowsButThis(QMdiArea *pMdiArea);
void tileSubWindows(QMdiArea *pMdiArea, bool horizontally);
void fetchInterfaceDataHelper(LibraryTreeItem *pLibraryTreeItem);
Expand Down

0 comments on commit d67f06b

Please sign in to comment.