Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Canvas.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_CANVAS_H_
21 #define OMNI_UI_CANVAS_H_
22 
23 #include <memory>
28 #include <omni/TypeIdMemory.h>
29 #include "DockWidget.h"
30 
31 namespace omni {
32  class Session;
33 
34  namespace ui {
35  namespace Ui {
36  class Canvas;
37  }
38 
39  /// Dockwidget for editing canvas type and parameters
40  class Canvas :
41  public DockWidget,
42  public mixin::SharedDataModel<Session>,
43  private mixin::ParameterWidget<ui::CanvasParameters> {
44  Q_OBJECT
46  public:
47  Canvas(QWidget * = nullptr);
48  ~Canvas();
49 
50  signals:
51  void dataModelChanged();
52  void canvasTypeChanged();
53 
54  public slots:
55  /// Select canvas type with id
56  void selectCanvasType(QString);
57 
58  /// Set size of scene for canvas parameter widget
59  void updateSceneSize(bool);
60 
61  /// Set unit suffix string for canvas parameter widget
62  void updateUnits();
63 
64  private:
65  /// Update widgets from current mapping
66  void dataToFrontend();
67 
68  /// Assign widget values to current mapping
69  bool frontendToData();
70 
71  void showParameterWidget();
72 
73  std::unique_ptr<Ui::Canvas> ui_;
74 
76  };
77  }
78 }
79 
80 #endif /* OMNI_UI_CANVAS_H_ */
Canvas(QWidget *=nullptr)
Definition: Canvas.cpp:33
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
void updateUnits()
Set unit suffix string for canvas parameter widget.
Definition: Canvas.cpp:92
Dockwidget for editing canvas type and parameters.
Definition: Canvas.h:40
void showParameterWidget()
Definition: Canvas.cpp:121
void dataToFrontend()
Update widgets from current mapping.
Definition: Canvas.cpp:55
std::unique_ptr< Ui::Canvas > ui_
Definition: Canvas.h:73
void selectCanvasType(QString)
Select canvas type with id.
Definition: Canvas.cpp:101
bool frontendToData()
Assign widget values to current mapping.
Definition: Canvas.cpp:79
Setup and remove a parameter widget for a certain plugin interface.
Definition: ParameterWidget.h:34
~Canvas()
Definition: Canvas.cpp:52
canvas::Interface Canvas
Definition: Interface.h:127
void dataModelChanged()
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
TypeIdMemory< canvas::Interface > canvasMemory_
Definition: Canvas.h:75
DockWidget is scroll area with an embedded widget.
Definition: DockWidget.h:27
void canvasTypeChanged()
void updateSceneSize(bool)
Set size of scene for canvas parameter widget.
Definition: Canvas.cpp:83