Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScreenSetup.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2015 "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 
20 #ifndef OMNI_UI_SCREENSETUP_H_
21 #define OMNI_UI_SCREENSETUP_H_
22 
23 #include <list>
24 #include <QWidget>
25 
26 #include <omni/proj/ScreenSetup.h>
29 #include "proj/Tuning.h"
30 #include "ScreenSetupDragWidget.h"
31 #include "ScreenItem.h"
32 
33 namespace omni {
34  class Session;
35 
36  namespace ui {
37  namespace proj {
38  class TuningList;
39  }
40 
41  /**@brief A widget for seting up fullscreen windows
42  * @details Holds fullscreen widgets
43  **/
44  class ScreenSetup :
45  public QWidget,
46  public mixin::SharedDataModel<Session>,
47  public mixin::TransformedRect<ScreenSetup>{
48  Q_OBJECT
50 
51  public:
52  ScreenSetup(QWidget * = nullptr);
53  ~ScreenSetup();
54 
55  inline QRect desktopRect() const {
57  }
58 
61  proj::TuningList const* tuningList() const;
62 
63  public slots:
64  /// Update screen dimensions
65  void updateScreens();
67 
69 
70  signals:
71  void dataModelChanged();
72 
73  protected:
74  void paintEvent(QPaintEvent *);
75 
76  void mouseMoveEvent(QMouseEvent *);
77 
78  /// Detach tuning on double click on screen event
79  void mouseDoubleClickEvent(QMouseEvent *);
80  void dragEnterEvent(QDragEnterEvent *);
81  void dragMoveEvent(QDragMoveEvent *);
82  void dropEvent(QDropEvent *);
83 
84  private:
85  friend ScreenItem;
86  friend SubScreenItem;
87 
88  /// Set session parameters
89  void dataToFrontend();
90 
91  bool frontendToData() {
92  return false;
93  }
94 
96 
97  /**@brief Returns pointer to a SubScreenItem under given position
98  *@detail Returns null otherwise
99  **/
100  SubScreenItem* getSubScreenItemAtPos(QPoint const&);
101 
102  std::map<QScreen const *, std::unique_ptr<ScreenItem> > screenItems_;
105  };
106  }
107 }
108 
109 #endif /* OMNI_UI_SCREENSETUP_H_ */
A widget for seting up fullscreen windows.
Definition: ScreenSetup.h:44
Definition: TuningList.h:40
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
ScreenSetup(QWidget *=nullptr)
Definition: ScreenSetup.cpp:43
#define OMNI_UI_SHARED_DATAMODEL(MODEL)
Definition: DataModel.h:216
QRect desktopRect() const
Pure virtual method which returns overall desktop rect.
Definition: ScreenSetup.h:55
~ScreenSetup()
Definition: ScreenSetup.cpp:59
void mouseMoveEvent(QMouseEvent *)
Definition: ScreenSetup.cpp:171
void assignTuning(omni::proj::Tuning *)
Definition: ScreenSetup.cpp:132
Mixin which calculates transformed screen rectangles Used in export output preview and screen setup ...
Definition: TransformedRect.h:33
friend ScreenItem
Definition: ScreenSetup.h:85
void dataToFrontend()
Set session parameters.
Definition: ScreenSetup.cpp:77
A projector tuning holds adjustment and distorsion data for a single projector and screen A tuning c...
Definition: Tuning.h:52
proj::TuningList * tuningList_
Definition: ScreenSetup.h:104
void dragMoveEvent(QDragMoveEvent *)
Definition: ScreenSetup.cpp:228
void setTuningList(proj::TuningList *)
Definition: ScreenSetup.cpp:64
void dragEnterEvent(QDragEnterEvent *)
Definition: ScreenSetup.cpp:205
friend SubScreenItem
Definition: ScreenSetup.h:86
Subscreen Item for which a tuning can be assigned.
Definition: ScreenItem.h:38
SubScreenItem * currentSubScreenItem_
Definition: ScreenSetup.h:103
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
proj::TuningList * tuningList()
Definition: ScreenSetup.cpp:69
std::map< QScreen const *, std::unique_ptr< ScreenItem > > screenItems_
Definition: ScreenSetup.h:102
void mouseDoubleClickEvent(QMouseEvent *)
Detach tuning on double click on screen event.
Definition: ScreenSetup.cpp:181
void closeFullscreenWindows()
Definition: ScreenSetup.cpp:101
void assignNewTuningToNextFreeScreen()
Definition: ScreenSetup.cpp:109
bool frontendToData()
Return true if data has changed by front end.
Definition: ScreenSetup.h:91
void dropEvent(QDropEvent *)
Definition: ScreenSetup.cpp:256
void paintEvent(QPaintEvent *)
Definition: ScreenSetup.cpp:147
void updateScreens()
Update screen dimensions.
Definition: ScreenSetup.cpp:81
SubScreenItem * getSubScreenItemAtPos(QPoint const &)
Returns pointer to a SubScreenItem under given position Returns null otherwise.
Definition: ScreenSetup.cpp:191
static QRect desktopRect(bool _excludeStandardScreen=true)
Definition: ScreenSetup.cpp:180