Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Scene.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 #include <memory>
21 #include <unordered_set>
22 #include <omni/Session.h>
24 #include "DockWidget.h"
25 
26 namespace omni {
27  namespace ui {
28  namespace Ui {
29  class Scene;
30  }
31 
32  /// Dock widget that contains view settings for the scene
33  class Scene :
34  public DockWidget,
35  public mixin::SharedDataModel<Session>{
36  Q_OBJECT
38  public:
39  Scene(QWidget *_parent = nullptr);
40  ~Scene();
41 
42  signals:
43  void dataModelChanged();
44  void unitChanged();
45 
46  /// Signal when scene scale has changed. Bool param tells if values should be rescaled
47  void sceneScaleChanged(bool);
48 
49  private slots:
50  void setSceneScale();
51  void fitSceneSizeToCanvas();
52  void setUnit();
53  void showArrangeMode();
54  void showLiveMode();
55 
56  protected:
57  void showEvent(QShowEvent*);
58 
59  private:
60  std::unique_ptr<Ui::Scene> ui_;
61 
62  /// Set of Widgets for manipulating scene size and units
63  std::set<QWidget*> sceneSizeWidgets_;
64 
65  void dataToFrontend();
66  bool frontendToData();
67 
68  };
69  }
70 }
void showArrangeMode()
Definition: Scene.cpp:111
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
void setUnit()
Definition: Scene.cpp:159
void sceneScaleChanged(bool)
Signal when scene scale has changed. Bool param tells if values should be rescaled.
#define OMNI_UI_SHARED_DATAMODEL(MODEL)
Definition: DataModel.h:216
Scene(QWidget *_parent=nullptr)
Definition: Scene.cpp:28
bool frontendToData()
Return true if data has changed by front end.
Definition: Scene.cpp:222
void fitSceneSizeToCanvas()
Definition: Scene.cpp:126
void showLiveMode()
Definition: Scene.cpp:118
std::unique_ptr< Ui::Scene > ui_
Definition: Scene.h:60
void dataToFrontend()
Pure virtual method which determines how data model is represented in frontend.
Definition: Scene.cpp:172
Dock widget that contains view settings for the scene.
Definition: Scene.h:33
void showEvent(QShowEvent *)
Definition: Scene.cpp:97
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
DockWidget is scroll area with an embedded widget.
Definition: DockWidget.h:27
~Scene()
Definition: Scene.cpp:94
void setSceneScale()
Definition: Scene.cpp:150
void dataModelChanged()
std::set< QWidget * > sceneSizeWidgets_
Set of Widgets for manipulating scene size and units.
Definition: Scene.h:63