/
Canvas.h
executable file
·80 lines (65 loc) · 2.33 KB
/
Canvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* Copyright (c) 2014-2015 "Omnidome" by Michael Winkelmann
* Dome Mapping Projection Software (http://omnido.me).
* Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
*
* This file is part of Omnidome.
*
* Omnidome is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OMNI_UI_CANVAS_H_
#define OMNI_UI_CANVAS_H_
#include <memory>
#include <omni/visual/ProjectorViewMode.h>
#include "mixin/DataModel.h"
#include "mixin/ParameterWidget.h"
#include <omni/ui/CanvasParameters.h>
#include <omni/TypeIdMemory.h>
#include "DockWidget.h"
namespace omni {
class Session;
namespace ui {
namespace Ui {
class Canvas;
}
/// Dockwidget for editing canvas type and parameters
class Canvas :
public DockWidget,
public mixin::SharedDataModel<Canvas,Session>,
private mixin::ParameterWidget<ui::CanvasParameters> {
Q_OBJECT
OMNI_UI_SHARED_DATAMODEL(Canvas,Session)
public:
Canvas(QWidget * = nullptr);
~Canvas() override;
signals:
void dataModelChanged();
void canvasTypeChanged();
public slots:
/// Select canvas type with id
void selectCanvasType(QByteArray const&);
/// Set size of scene for canvas parameter widget
void updateSceneSize(bool);
/// Set unit suffix string for canvas parameter widget
void updateUnits();
private:
/// Update widgets from current mapping
void dataToFrontend() override;
/// Assign widget values to current mapping
bool frontendToData() override;
void showParameterWidget();
std::unique_ptr<Ui::Canvas> ui_;
TypeIdMemory<canvas::Interface> canvasMemory_;
};
}
}
#endif /* OMNI_UI_CANVAS_H_ */