Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
omni::ui::MainWindow Class Reference

#include <MainWindow.h>

Inheritance diagram for omni::ui::MainWindow:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::MainWindow:
Collaboration graph
[legend]

Public Slots

void newProjection ()
 Initiaties a new session after dialog was confirmed. More...
 
void saveProjection ()
 Save current session. More...
 
void saveProjectionAs ()
 Set current session under a new filename. More...
 
void openProjection ()
 Open a new session. More...
 
bool openProjection (const QString &_filename)
 Open a new session from filename. More...
 
void editAsNew ()
 Edit current session with a new filename. More...
 
void updateAllViews ()
 Update all OpenGL views. More...
 
void modified ()
 Sets modified flag to true. More...
 

Public Member Functions

 MainWindow (QMainWindow *parent=nullptr)
 
 ~MainWindow ()
 

Protected Member Functions

void closeEvent (QCloseEvent *_event)
 
void showEvent (QShowEvent *_event)
 

Private Slots

void buttonState ()
 Sets enabled state of toolbar buttons. More...
 
void setTuningIndex ()
 Set current tuning index. More...
 
void addProjector (QAction *_action)
 
void setMode ()
 Sets session mode. More...
 

Private Member Functions

void readSettings ()
 
void setupSession (std::shared_ptr< Session > &_session)
 Makes a new session. More...
 
QMessageBox::StandardButton saveChangesPrompt ()
 Message Box for changing changes. More...
 

Private Attributes

QString filename_
 Current filename. More...
 
std::shared_ptr< Sessionsession_
 Current projection session. More...
 
bool modified_ = false
 Modified flag. More...
 
bool locked_
 Locked flag. More...
 
QUniquePtr< ScreenSetupscreenSetup_
 Screen Setup page. More...
 
QUniquePtr< SceneViewersceneViewer_
 ProjectionSetup/Canvas arrangement and live view page. More...
 
QUniquePtr< TuningGLViewtuningView_
 Page for warp grid, blend mask and color correction. More...
 
QUniquePtr< Exportexport_
 Page for exporting projection. More...
 
QUniquePtr< RecentSessionsrecentSessions_
 Store recent sessions. More...
 
QUniquePtr< ToolBartoolBar_
 MainWindow toolbar. More...
 
std::unique_ptr< Ui::MainWindow > ui_
 UI containing designed widgets of this window. More...
 

Constructor & Destructor Documentation

MainWindow::MainWindow ( QMainWindow *  parent = nullptr)

Set dock widget tabs

Handle scene scale and unit events

53  :
54  QMainWindow(parent),
55  session_(new Session()),
56  modified_(false),
57  ui_(new Ui::MainWindow)
58 {
59  ui_->setupUi(this);
60  setTabPosition(Qt::AllDockWidgetAreas,QTabWidget::North);
61 
62  // Remove title bars from dock widgets
63  {
64  for (auto& _dockWidget : {
65  ui_->dockCanvas,
66  ui_->dockWarp,
67  ui_->dockScene,
68  ui_->dockMapping,
69  ui_->dockInputs,
70  ui_->dockBlend
71  }) {
72  _dockWidget->widget()->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
73  }
74  }
75 
76 
77  // Setup toolbar
78  {
79  toolBar_.reset(new ToolBar(this));
80  this->addToolBar(Qt::TopToolBarArea, toolBar_.get());
81  connect(toolBar_.get(), SIGNAL(dataModelChanged()),
82  this, SLOT(setMode()));
83  }
84 
85  // Make and setup pages
86  {
87  QLayout *_layout = new QHBoxLayout();
88  screenSetup_.reset(new ScreenSetup(this));
89  _layout->addWidget(screenSetup_.get());
90 
91  sceneViewer_.reset(new SceneViewer(this));
92  _layout->addWidget(sceneViewer_.get());
93  sceneViewer_->view()->setUpdateFrequency(60.0);
94 
95  tuningView_.reset(new TuningGLView(this));
96  _layout->addWidget(tuningView_.get());
97  tuningView_->setBorder(0.5);
98  tuningView_->setKeepAspectRatio(true);
99 
100  export_.reset(new Export(this));
101  _layout->addWidget(export_.get());
102 
103  _layout->setContentsMargins(0, 0, 0, 0);
104  ui_->pages->setLayout(_layout);
105  }
106 
107  ui_->statusbar->showMessage(QString("Omnidome VR") +
108  QString(OMNIDOME_VERSION_STRING));
109 
110  // Setup add projector template menu
111  {
112  QMenu *_menu = new QMenu();
113 
114  _menu->addAction("PeripheralSetup")->setData(QString("PeripheralSetup"));
115  _menu->addAction("FreeSetup")->setData(QString("FreeSetup"));
116  _menu->addSeparator();
117 
118  connect(_menu, SIGNAL(triggered(QAction *)), this,
119  SLOT(addProjector(QAction *)));
120 
121  ui_->btnAddTuning->setMenu(_menu);
122  }
123 
124  /// Set dock widget tabs
125  {
126 
127 // ui_->dockCanvas->setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint |
128 // Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint);
129  tabifyDockWidget(ui_->dockCanvas, ui_->dockScene);
130  tabifyDockWidget(ui_->dockInputs, ui_->dockMapping);
131  tabifyDockWidget(ui_->dockInputs, ui_->dockColorCorrection);
132  tabifyDockWidget(ui_->dockInputs, ui_->dockWarp);
133  tabifyDockWidget(ui_->dockInputs, ui_->dockBlend);
134  }
135 
136  // Connect signals and slots
137  {
138  // Connect projector position change with view update
139  connect(ui_->tuningList, SIGNAL(dataModelChanged()), this,
140  SLOT(setTuningIndex()));
141  connect(ui_->tuningList, SIGNAL(tuningChanged()), this,
142  SLOT(updateAllViews()));
143  connect(ui_->tuningList,
145  toolBar_.get(),
147  connect(ui_->tuningList, SIGNAL(tuningRemoved()), screenSetup_.get(),
148  SLOT(updateScreens()));
149  connect(ui_->tuningList, SIGNAL(tuningRemoved()), this,
150  SLOT(updateAllViews()));
151  screenSetup_->setTuningList(ui_->tuningList);
152 
153  connect(ui_->actionEnableAllTunings, SIGNAL(triggered()),
154  ui_->tuningList, SLOT(enableAllTunings()));
155  connect(ui_->actionDisableAllTunings, SIGNAL(triggered()),
156  ui_->tuningList, SLOT(disableAllTunings()));
157  connect(ui_->actionEnableSelectedTuningOnly, SIGNAL(triggered()),
158  ui_->tuningList, SLOT(enableSelectedTuningOnly()));
159 
160  // Connect canvas parameter change with view update
161  connect(ui_->dockCanvasWidget, SIGNAL(
162  dataModelChanged()), this,
163  SLOT(updateAllViews()));
164  connect(ui_->dockCanvasWidget, SIGNAL(canvasTypeChanged()),
165  this, SLOT(modified()));
166 
167  // Connect scene parameter change with 3d view update
168  connect(ui_->dockSceneWidget, SIGNAL(dataModelChanged()),
169  this, SLOT(updateAllViews()));
170 
171  /// Handle scene scale and unit events
172  connect(ui_->dockSceneWidget, SIGNAL(sceneScaleChanged(bool)),
173  ui_->tuningList, SLOT(updateSceneSize(bool)));
174  connect(ui_->dockSceneWidget, SIGNAL(sceneScaleChanged(bool)),
175  ui_->dockCanvasWidget, SLOT(updateSceneSize(bool)));
176  connect(ui_->dockSceneWidget, SIGNAL(unitChanged()),
177  ui_->dockCanvasWidget, SLOT(updateUnits()));
178  connect(ui_->dockSceneWidget, SIGNAL(unitChanged()),
179  ui_->tuningList, SLOT(updateUnits()));
180 
181  // Update all views when input has changed
182  connect(ui_->dockInputsWidget, SIGNAL(
183  inputIndexChanged()), this,
184  SLOT(modified()));
185 
186  connect(ui_->dockInputsWidget, SIGNAL(
187  inputIndexChanged()), sceneViewer_.get(),
188  SLOT(showInputControlWidget()));
189  connect(ui_->dockInputsWidget, SIGNAL(
190  inputRemoved()), sceneViewer_.get(),
191  SLOT(removeInputControlWidget()));
192  connect(ui_->dockInputsWidget, SIGNAL(
193  inputIndexChanged()), this,
194  SLOT(setMode()));
195  connect(ui_->dockInputsWidget, SIGNAL(
196  inputChanged()), this,
197  SLOT(updateAllViews()));
198 
199  // Update all views when mapping mode has changed
200  connect(ui_->dockMappingWidget, SIGNAL(
201  dataModelChanged()), this,
202  SLOT(modified()));
203  connect(ui_->dockMappingWidget, SIGNAL(
204  dataModelChanged()), this,
205  SLOT(updateAllViews()));
206  connect(ui_->dockMappingWidget, SIGNAL(
207  dataModelChanged()), toolBar_.get(),
208  SLOT(buttonStates()));
209  connect(ui_->dockMappingWidget, &Mapping::dataModelChanged,
211 
212  // Update all views when warp grid has changed
213  connect(ui_->dockWarpWidget, SIGNAL(
214  dataModelChanged()), this,
215  SLOT(modified()));
216 
217  // Update all views when blend mask has changed
218  connect(ui_->dockBlendWidget,
220  this,
222 
223  // Update all views when color correction has changed
224  connect(ui_->dockColorCorrectionWidget, SIGNAL(
225  dataModelChanged()), this,
226  SLOT(modified()));
227 
228  // Connect add tuning button with tuning list
229  connect(ui_->btnAddTuning, SIGNAL(
230  clicked()), ui_->tuningList,
231  SLOT(addTuning()));
232  connect(ui_->btnAddTuning, SIGNAL(
233  clicked()), this,
234  SLOT(buttonState()));
235 
236  // Connect about button with toolbar showAbout slot
237  connect(ui_->actionAbout,SIGNAL(triggered()),toolBar_.get(),SLOT(showAbout()));
238  }
239 
240  {
241  // Set splitter sizes
242  QList<int> _list;
243  int _width = width();
244  _list << _width * 1.2 << 100;
245  ui_->splitter->setSizes(_list);
246  }
247 
248  {
249  recentSessions_.reset(new RecentSessions);
250  ui_->actionRecentFiles->setMenu(recentSessions_->menu());
251  connect(recentSessions_.get(), SIGNAL(fileToBeLoaded(QString const &)),
252  this, SLOT(openProjection(QString const &)));
253  }
254 
255  readSettings();
257 
258  // Add one tuning by default
259  ui_->tuningList->addTuning();
260 
261  setMode();
262  raise();
263  show();
264 }
A widget for seting up fullscreen windows.
Definition: ScreenSetup.h:44
void dataModelChanged()
Signal which is emitted when parameters of one tuning have changed.
QUniquePtr< ToolBar > toolBar_
MainWindow toolbar.
Definition: MainWindow.h:131
QUniquePtr< ScreenSetup > screenSetup_
Screen Setup page.
Definition: MainWindow.h:116
QUniquePtr< SceneViewer > sceneViewer_
ProjectionSetup/Canvas arrangement and live view page.
Definition: MainWindow.h:119
Data structure and menu to store default sessions.
Definition: RecentSessions.h:55
void readSettings()
Definition: MainWindow.cpp:269
void setMode()
Sets session mode.
Definition: MainWindow.cpp:514
QUniquePtr< TuningGLView > tuningView_
Page for warp grid, blend mask and color correction.
Definition: MainWindow.h:122
Definition: Export.h:36
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
void modified()
Sets modified flag to true.
Definition: MainWindow.cpp:437
QUniquePtr< RecentSessions > recentSessions_
Store recent sessions.
Definition: MainWindow.h:128
void addProjector(QAction *_action)
Definition: MainWindow.cpp:499
virtual void updateFrontend()
Push data to frontend widgets and all child widgets.
Definition: DataModel.h:128
void dataModelChanged()
void updateAllViews()
Update all OpenGL views.
Definition: MainWindow.cpp:419
Omnidome main window toolbar.
Definition: ToolBar.h:31
A GLView for visualizing all modes of a projector view (tuning)
Definition: TuningGLView.h:34
QUniquePtr< Export > export_
Page for exporting projection.
Definition: MainWindow.h:125
void openProjection()
Open a new session.
Definition: MainWindow.cpp:367
SceneViewer widget for positioning of elements and 3D view of scene.
Definition: SceneViewer.h:35
void setupSession(std::shared_ptr< Session > &_session)
Makes a new session.
Definition: MainWindow.cpp:285
void setTuningIndex()
Set current tuning index.
Definition: MainWindow.cpp:487
MainWindow::~MainWindow ( )
267 {}

Member Function Documentation

void MainWindow::addProjector ( QAction *  _action)
privateslot

Check for single projector setups

500 {
501  auto _id = _action->data().toString();
502 
503  /// Check for single projector setups
504  for (auto& _idSetup : omni::proj::SetupFactory::classes())
505  {
506  if (_idSetup.first.str() == _id)
507  {
508  ui_->tuningList->addTuning(_id);
509  return;
510  }
511  }
512 }
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
static class_map_type const & classes()
Gives readonly access to registered classes.
Definition: factory.hpp:108
void MainWindow::buttonState ( )
privateslot

Sets enabled state of toolbar buttons.

470 {
471  QString _str("Omnidome");
472 
473  if (!filename_.isEmpty())
474  {
475  _str += " - " + filename_;
476  }
477 
478  if (modified_) _str += "*";
479  setWindowTitle(_str);
480 
481  ui_->actionEditAsNew->setEnabled(!filename_.isEmpty());
482  ui_->actionSave->setEnabled(modified_);
483  toolBar_->buttonStates();
484 }
QUniquePtr< ToolBar > toolBar_
MainWindow toolbar.
Definition: MainWindow.h:131
QString filename_
Current filename.
Definition: MainWindow.h:104
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
void MainWindow::closeEvent ( QCloseEvent *  _event)
protected
450 {
451  if (saveChangesPrompt() == QMessageBox::Cancel)
452  {
453  _event->ignore();
454  return;
455  }
456 
457  // Delete screen setup manually, so all fullscreen widgets are free'd too
458  if (screenSetup_) {
459  ui_->tuningList->clear();
460  screenSetup_->closeFullscreenWindows();
461  }
462 
463  Application::settings().setValue("geometry", saveGeometry());
464  Application::settings().setValue("windowState", saveState());
465  recentSessions_->writeToSettings();
466  QMainWindow::closeEvent(_event);
467 }
QUniquePtr< ScreenSetup > screenSetup_
Screen Setup page.
Definition: MainWindow.h:116
QMessageBox::StandardButton saveChangesPrompt()
Message Box for changing changes.
Definition: MainWindow.cpp:591
static QSettings & settings()
Application settings to be saved.
Definition: Application.cpp:75
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
QUniquePtr< RecentSessions > recentSessions_
Store recent sessions.
Definition: MainWindow.h:128
void MainWindow::editAsNew ( )
slot

Edit current session with a new filename.

405 {
406  if (!filename_.isEmpty() || modified_)
407  {
408  if (saveChangesPrompt() == QMessageBox::Cancel)
409  {
410  return;
411  }
412  }
413 
414  filename_ = "";
415  modified_ = false;
416  buttonState();
417 }
QMessageBox::StandardButton saveChangesPrompt()
Message Box for changing changes.
Definition: MainWindow.cpp:591
QString filename_
Current filename.
Definition: MainWindow.h:104
bool modified_
Modified flag.
Definition: MainWindow.h:110
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
void MainWindow::modified ( )
slot

Sets modified flag to true.

438 {
439  if (locked_) return;
440 
441  modified_ = true;
442  updateAllViews();
443  buttonState();
444 }
bool modified_
Modified flag.
Definition: MainWindow.h:110
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
bool locked_
Locked flag.
Definition: MainWindow.h:113
void updateAllViews()
Update all OpenGL views.
Definition: MainWindow.cpp:419
void MainWindow::newProjection ( )
slot

Initiaties a new session after dialog was confirmed.

315 {
316  if (saveChangesPrompt() == QMessageBox::Cancel)
317  {
318  return;
319  }
320 
321  session_.reset(new Session());
323  setMode();
324  modified_ = false;
325  buttonState();
326 }
void setMode()
Sets session mode.
Definition: MainWindow.cpp:514
QMessageBox::StandardButton saveChangesPrompt()
Message Box for changing changes.
Definition: MainWindow.cpp:591
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
void setupSession(std::shared_ptr< Session > &_session)
Makes a new session.
Definition: MainWindow.cpp:285
void MainWindow::openProjection ( )
slot

Open a new session.

368 {
369  if (saveChangesPrompt() == QMessageBox::Cancel)
370  {
371  return;
372  }
373 
374  QString _filename = QFileDialog::getOpenFileName(this,
375  "Open omni Projection...",
376  ".",
377  "omni Projections (*.omni)");
378 
379  if (!_filename.isEmpty())
380  {
381  openProjection(_filename);
382  }
383 }
QMessageBox::StandardButton saveChangesPrompt()
Message Box for changing changes.
Definition: MainWindow.cpp:591
void openProjection()
Open a new session.
Definition: MainWindow.cpp:367
bool MainWindow::openProjection ( const QString &  _filename)
slot

Open a new session from filename.

386 {
387  filename_ = _filename;
388  std::shared_ptr<Session> _session(new Session);
389 
390  std::unique_ptr<ExceptionList> _widget(new ExceptionList);
391  tryWithExceptionList<Exception>([&]() {
392  _session->load(filename_);
393  setupSession(_session);
394  session_ = _session;
395  modified_ = false;
396  filename_ = _filename;
397  recentSessions_->addFile(filename_);
398  setMode();
399  });
400 
401  return true;
402 }
void setMode()
Sets session mode.
Definition: MainWindow.cpp:514
QString filename_
Current filename.
Definition: MainWindow.h:104
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
QUniquePtr< RecentSessions > recentSessions_
Store recent sessions.
Definition: MainWindow.h:128
A list of all exceptions occured during a process.
Definition: ExceptionList.h:31
void setupSession(std::shared_ptr< Session > &_session)
Makes a new session.
Definition: MainWindow.cpp:285
void MainWindow::readSettings ( )
private
270 {
271  restoreGeometry(Application::settings().value("geometry").toByteArray());
272 
273  auto _windowState =
274  Application::settings().value("windowState").toByteArray();
275 
276  if (_windowState.isEmpty()) {
277  setWindowState(Qt::WindowMaximized);
278  } else {
279  restoreState(_windowState);
280  }
281 
282  recentSessions_->readFromSettings();
283 }
static QSettings & settings()
Application settings to be saved.
Definition: Application.cpp:75
QUniquePtr< RecentSessions > recentSessions_
Store recent sessions.
Definition: MainWindow.h:128
QMessageBox::StandardButton MainWindow::saveChangesPrompt ( )
private

Message Box for changing changes.

592 {
593  if (modified_)
594  {
595  QMessageBox::StandardButton _reply = QMessageBox::question(this,
596  "Screen update",
597  "There are unsaved modifications. Do you want to save them?",
598  QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
599  QMessageBox::Yes);
600 
601  if (_reply == QMessageBox::Yes) saveProjection();
602  return _reply;
603  }
604  return QMessageBox::No;
605 }
bool modified_
Modified flag.
Definition: MainWindow.h:110
void saveProjection()
Save current session.
Definition: MainWindow.cpp:328
void MainWindow::saveProjection ( )
slot

Save current session.

329 {
330  if (filename_.isEmpty())
331  {
333  }
334  else
335  {
336  session_->save(filename_);
337  modified_ = false;
338  buttonState();
339  }
340 }
QString filename_
Current filename.
Definition: MainWindow.h:104
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
void saveProjectionAs()
Set current session under a new filename.
Definition: MainWindow.cpp:342
void MainWindow::saveProjectionAs ( )
slot

Set current session under a new filename.

343 {
344  QString _filename = QFileDialog::getSaveFileName(this,
345  "Save omni Projection...",
346  ".",
347  "omni Projections (*.omni)");
348 
349  if (!_filename.isEmpty())
350  {
351  std::unique_ptr<ExceptionList> _widget(new ExceptionList);
352  try {
353  filename_ = _filename;
354  session_->save(filename_);
355  recentSessions_->addFile(filename_);
356  modified_ = false;
357  buttonState();
358  } catch (Exception& e) {
359  _widget->addException(e);
360  }
361  if (_widget->exceptionCount() > 0) {
362  _widget->exec();
363  }
364  }
365 }
QString filename_
Current filename.
Definition: MainWindow.h:104
bool modified_
Modified flag.
Definition: MainWindow.h:110
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
QUniquePtr< RecentSessions > recentSessions_
Store recent sessions.
Definition: MainWindow.h:128
A list of all exceptions occured during a process.
Definition: ExceptionList.h:31
void MainWindow::setMode ( )
privateslot

Sets session mode.

515 {
516  auto _mode = session_->mode();
517  bool _hasTunings = session_->hasOutput();
518 
519  screenSetup_->setVisible(_mode == Session::Mode::SCREENSETUP);
520  sceneViewer_->setVisible(_mode == Session::Mode::ARRANGE ||
521  (_mode == Session::Mode::LIVE && _hasTunings));
522  tuningView_->setVisible((
523  _mode == Session::Mode::WARP ||
524  _mode == Session::Mode::BLEND ||
525  _mode == Session::Mode::COLORCORRECTION) &&
526  _hasTunings);
527  export_->setVisible(_mode == Session::Mode::EXPORT && _hasTunings);
528 
530 
531  ui_->btnAddTuning->setVisible(
532  _mode == Session::Mode::SCREENSETUP ||
533  _mode == Session::Mode::ARRANGE);
534  ui_->dockCanvas->setVisible(_mode == Session::Mode::ARRANGE);
535  ui_->dockWarp->setVisible(_mode == Session::Mode::WARP);
536  ui_->dockBlend->setVisible(_mode == Session::Mode::BLEND);
537  ui_->dockColorCorrection->setVisible(_mode == Session::Mode::COLORCORRECTION);
538  ui_->dockScene->hide();
539 
540  switch (_mode)
541  {
543  ui_->dockMapping->hide();
544  ui_->dockInputs->show();
545  break;
546 
548  ui_->dockInputs->show();
549  ui_->dockMapping->setVisible(session_->inputs().current());
550  ui_->dockCanvas->raise();
551  ui_->dockScene->show();
552  break;
553 
554  case Session::Mode::WARP:
555  ui_->dockInputs->show();
556  ui_->dockMapping->setVisible(session_->inputs().current());
557  ui_->dockWarp->raise();
558  break;
559 
561  ui_->dockInputs->setVisible(true);
562  ui_->dockMapping->setVisible(false);
563  ui_->dockBlend->raise();
564  break;
565 
567  ui_->dockInputs->setVisible(true);
568  ui_->dockMapping->setVisible(session_->inputs().current());
569  ui_->dockColorCorrection->raise();
570  break;
571 
573  ui_->dockInputs->show();
574  ui_->dockMapping->setVisible(session_->inputs().current());
575  ui_->dockInputs->raise();
576  break;
577 
578  case Session::Mode::LIVE:
579  ui_->dockInputs->show();
580  ui_->dockMapping->hide();
581  ui_->dockScene->show();
582  default:
583  break;
584  }
585 
586  ui_->tuningList->sessionModeChange();
587  updateAllViews();
588  buttonState();
589 }
QUniquePtr< ScreenSetup > screenSetup_
Screen Setup page.
Definition: MainWindow.h:116
QUniquePtr< SceneViewer > sceneViewer_
ProjectionSetup/Canvas arrangement and live view page.
Definition: MainWindow.h:119
QUniquePtr< TuningGLView > tuningView_
Page for warp grid, blend mask and color correction.
Definition: MainWindow.h:122
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
void buttonState()
Sets enabled state of toolbar buttons.
Definition: MainWindow.cpp:469
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
Widget for manipulating projector parameters Also holds a preview OpenGL widget. ...
Definition: Tuning.h:46
void updateAllViews()
Update all OpenGL views.
Definition: MainWindow.cpp:419
QUniquePtr< Export > export_
Page for exporting projection.
Definition: MainWindow.h:125
void MainWindow::setTuningIndex ( )
privateslot

Set current tuning index.

488 {
489  int _index = session_->tunings().currentIndex();
490 
491  tuningView_->setTuningIndex(_index);
492  tuningView_->setChildViews(ui_->tuningList->getViews(_index));
493 
494  ui_->dockColorCorrectionWidget->updateFrontend();
495  ui_->dockBlendWidget->updateFrontend();
496  ui_->dockWarpWidget->updateFrontend();
497 }
QUniquePtr< TuningGLView > tuningView_
Page for warp grid, blend mask and color correction.
Definition: MainWindow.h:122
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
void MainWindow::setupSession ( std::shared_ptr< Session > &  _session)
private

Makes a new session.

286 {
287  using util::enumToInt;
288  locked_ = true;
289  {
290  ui_->dockInputsWidget->clear();
291  ui_->dockSceneWidget->setDataModel(_session);
292  ui_->dockInputsWidget->setDataModel(_session);
293  toolBar_->setDataModel(_session);
294  screenSetup_->setDataModel(_session);
295 
296  // Set session to pages
297  sceneViewer_->setDataModel(_session);
298  tuningView_->setDataModel(_session);
299  export_->setDataModel(_session);
300 
301  ui_->tuningList->setDataModel(_session);
302  ui_->dockMappingWidget->setDataModel(_session);
303  ui_->dockCanvasWidget->setDataModel(_session);
304  ui_->dockWarpWidget->setDataModel(_session);
305  ui_->dockBlendWidget->setDataModel(_session);
306  ui_->dockColorCorrectionWidget->setDataModel(_session);
307 
308  screenSetup_->updateScreens();
309  }
310 
311  locked_ = false;
312 }
QUniquePtr< ToolBar > toolBar_
MainWindow toolbar.
Definition: MainWindow.h:131
QUniquePtr< ScreenSetup > screenSetup_
Screen Setup page.
Definition: MainWindow.h:116
QUniquePtr< SceneViewer > sceneViewer_
ProjectionSetup/Canvas arrangement and live view page.
Definition: MainWindow.h:119
QUniquePtr< TuningGLView > tuningView_
Page for warp grid, blend mask and color correction.
Definition: MainWindow.h:122
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134
auto enumToInt(ENUM const &_v) -> typename std::underlying_type< ENUM >::type
Converts an enum class to integer.
Definition: util.h:105
bool locked_
Locked flag.
Definition: MainWindow.h:113
QUniquePtr< Export > export_
Page for exporting projection.
Definition: MainWindow.h:125
void MainWindow::showEvent ( QShowEvent *  _event)
protected
447 {}
void MainWindow::updateAllViews ( )
slot

Update all OpenGL views.

420 {
421  switch (session_->mode()) {
423  case Session::Mode::LIVE:
424  sceneViewer_->triggerUpdate();
425  break;
426  default:
427  case Session::Mode::WARP:
430  tuningView_->triggerUpdate();
431  break;
432  }
433  ui_->tuningList->updateViews();
434 }
QUniquePtr< SceneViewer > sceneViewer_
ProjectionSetup/Canvas arrangement and live view page.
Definition: MainWindow.h:119
QUniquePtr< TuningGLView > tuningView_
Page for warp grid, blend mask and color correction.
Definition: MainWindow.h:122
std::shared_ptr< Session > session_
Current projection session.
Definition: MainWindow.h:107
std::unique_ptr< Ui::MainWindow > ui_
UI containing designed widgets of this window.
Definition: MainWindow.h:134

Field Documentation

QUniquePtr<Export> omni::ui::MainWindow::export_
private

Page for exporting projection.

QString omni::ui::MainWindow::filename_
private

Current filename.

bool omni::ui::MainWindow::locked_
private

Locked flag.

bool omni::ui::MainWindow::modified_ = false
private

Modified flag.

QUniquePtr<RecentSessions> omni::ui::MainWindow::recentSessions_
private

Store recent sessions.

QUniquePtr<SceneViewer> omni::ui::MainWindow::sceneViewer_
private

ProjectionSetup/Canvas arrangement and live view page.

QUniquePtr<ScreenSetup> omni::ui::MainWindow::screenSetup_
private

Screen Setup page.

std::shared_ptr<Session> omni::ui::MainWindow::session_
private

Current projection session.

QUniquePtr<ToolBar> omni::ui::MainWindow::toolBar_
private

MainWindow toolbar.

QUniquePtr<TuningGLView> omni::ui::MainWindow::tuningView_
private

Page for warp grid, blend mask and color correction.

std::unique_ptr<Ui::MainWindow> omni::ui::MainWindow::ui_
private

UI containing designed widgets of this window.


The documentation for this class was generated from the following files: