Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ToolBar.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OMNI_UI_TOOLBAR_H_
20 #define OMNI_UI_TOOLBAR_H_
21 
22 #include <QToolBar>
23 #include <omni/Session.h>
25 
26 class QToolButton;
27 
28 namespace omni {
29  namespace ui {
30  /// Omnidome main window toolbar
31  class ToolBar :
32  public QToolBar,
33  public mixin::SharedDataModel<Session>{
34  Q_OBJECT
36 
37  public:
38  ToolBar(QWidget * = nullptr);
39  ~ToolBar();
40 
41  public slots:
42  void setScreenSetupMode();
43  void setArrangeMode();
44  void setWarpMode();
45  void setBlendMode();
47  void setExportMode();
48  void setLiveMode();
49 
50  /// Show About dialog
51  void showAbout();
52 
53  /// Set button states (e.g. disable buttons when modes are not accessible)
54  void buttonStates();
55 
56  signals:
57  void dataModelChanged();
58 
59  private:
60  void setMode(Session::Mode);
61 
62  /// Update buttons from session
63  void dataToFrontend();
64 
65  /// Set session mode from buttons
66  bool frontendToData() {
67  return false;
68  }
69 
70  QToolButton *btnSettings_ = nullptr;
71  QToolButton *btnScreenSetup_ = nullptr;
72  QToolButton *btnArrange_ = nullptr;
73  QToolButton *btnWarp_ = nullptr;
74  QToolButton *btnBlend_ = nullptr;
75  QToolButton *btnColorCorrection_ = nullptr;
76  QToolButton *btnExport_ = nullptr;
77  QToolButton *btnLive_ = nullptr;
78  };
79  }
80 }
81 
82 #endif /* OMNI_UI_TOOLBAR_H_ */
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
#define OMNI_UI_SHARED_DATAMODEL(MODEL)
Definition: DataModel.h:216
QToolButton * btnLive_
Definition: ToolBar.h:77
void setWarpMode()
Definition: ToolBar.cpp:178
void setBlendMode()
Definition: ToolBar.cpp:182
QToolButton * btnColorCorrection_
Definition: ToolBar.h:75
QToolButton * btnBlend_
Definition: ToolBar.h:74
QToolButton * btnSettings_
Definition: ToolBar.h:70
QToolButton * btnWarp_
Definition: ToolBar.h:73
void buttonStates()
Set button states (e.g. disable buttons when modes are not accessible)
Definition: ToolBar.cpp:218
void setArrangeMode()
Definition: ToolBar.cpp:174
void setScreenSetupMode()
Definition: ToolBar.cpp:170
void showAbout()
Show About dialog.
Definition: ToolBar.cpp:229
~ToolBar()
Definition: ToolBar.cpp:168
QToolButton * btnScreenSetup_
Definition: ToolBar.h:71
void setMode(Session::Mode)
Definition: ToolBar.cpp:198
void dataToFrontend()
Update buttons from session.
Definition: ToolBar.cpp:205
Mode
General mode of the User Interface.
Definition: Session.h:46
QToolButton * btnExport_
Definition: ToolBar.h:76
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
void setLiveMode()
Definition: ToolBar.cpp:194
void setColorCorrectionMode()
Definition: ToolBar.cpp:186
ToolBar(QWidget *=nullptr)
Definition: ToolBar.cpp:34
QToolButton * btnArrange_
Definition: ToolBar.h:72
Omnidome main window toolbar.
Definition: ToolBar.h:31
bool frontendToData()
Set session mode from buttons.
Definition: ToolBar.h:66
void setExportMode()
Definition: ToolBar.cpp:190