Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Warp.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_WARP_H_
21 #define OMNI_UI_WARP_H_
22 
23 #include <memory>
24 #include <omni/Session.h>
25 #include "DockWidget.h"
27 
28 namespace omni {
29  class WarpGrid;
30 
31  namespace ui {
32  namespace Ui {
33  class Warp;
34  }
35 
36  /// Dock widget for editing warp grid parameters
37  class Warp :
38  public DockWidget,
39  public mixin::SharedDataModel<Session>{
40  Q_OBJECT
42 
43  public:
44  Warp(QWidget * = nullptr);
45  ~Warp();
46 
47  public slots:
48  void resetWarpGrid();
49  void resizeWarpGrid(bool);
50  void changeInterpolation(int);
51 
52  signals:
53  void dataModelChanged();
54 
55  private:
56  /// Update sliders from current warp grid
57  void dataToFrontend();
58 
59  /// Assign slider values to current warp grid
60  bool frontendToData();
61 
62  omni::WarpGrid const* warpGrid() const;
64 
65  std::unique_ptr<Ui::Warp> ui_;
66  };
67  }
68 }
69 
70 #endif /* OMNI_UI_WARP_H_ */
bool frontendToData()
Assign slider values to current warp grid.
Definition: Warp.cpp:81
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 dataToFrontend()
Update sliders from current warp grid.
Definition: Warp.cpp:71
~Warp()
Definition: Warp.cpp:68
A warp grid is a 2D bezier grid with MxN points Default size 6x6 points. Selected points are also st...
Definition: WarpGrid.h:32
void resizeWarpGrid(bool)
Definition: Warp.cpp:110
std::unique_ptr< Ui::Warp > ui_
Definition: Warp.h:65
Warp(QWidget *=nullptr)
Definition: Warp.cpp:32
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
Dock widget for editing warp grid parameters.
Definition: Warp.h:37
void resetWarpGrid()
Definition: Warp.cpp:101
void dataModelChanged()
void changeInterpolation(int)
Definition: Warp.cpp:91
omni::WarpGrid const * warpGrid() const
Definition: Warp.cpp:136