Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CanvasParameters.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_CANVASPARAMETERS_H_
21 #define OMNI_UI_CANVASPARAMETERS_H_
22 
23 #include <QComboBox>
24 #include <omni/canvas/Interface.h>
27 
28 namespace omni {
29  namespace ui {
30  /**@brief Parameter widget for getting and setting canvas parameters
31  **/
33  public ParameterWidget,
34  public mixin::UnsharedDataModel<canvas::Interface>{
35  Q_OBJECT
37  public:
38  CanvasParameters(QWidget *_parent = nullptr);
39  virtual ~CanvasParameters();
40 
41  public slots:
42  // Set data model with scale and unit
44 
45  /**@brief Set flag if values are rescaled
46  @param _rescale Boolean which tells if values are rescaled
47  */
48  virtual void setRescaleValues(bool _rescale);
49 
50  /**@brief Set slider ranges
51  @param _factor Scale factor
52  **/
53  virtual void setScale(float _factor);
54 
55  /// Set slider units
56  virtual void setUnit(QString const&);
57 
58  signals:
59  void dataModelChanged();
60 
61  protected:
62  virtual void dataToFrontend();
63 
64  /// Return true if data has changed by front end
65  virtual bool frontendToData();
66 
67  private:
68  /// Transform widget
69  QUniquePtr<omni::ui::AffineTransform> transform_;
70  QUniquePtr<QComboBox> boxViewMode_;
71  };
72  }
73 }
74 
75 
76 #endif /* OMNI_UI_CANVASPARAMETERS_H_ */
virtual void setScale(float _factor)
Set slider ranges.
Definition: CanvasParameters.cpp:97
CanvasParameters(QWidget *_parent=nullptr)
Definition: CanvasParameters.cpp:28
QUniquePtr< omni::ui::AffineTransform > transform_
Transform widget.
Definition: CanvasParameters.h:69
virtual bool frontendToData()
Return true if data has changed by front end.
Definition: CanvasParameters.cpp:43
virtual void setRescaleValues(bool _rescale)
Set flag if values are rescaled.
Definition: CanvasParameters.cpp:86
Abstract interface for a canvas A canvas represents the surface on which the projection is performed...
Definition: Interface.h:46
QUniquePtr< QComboBox > boxViewMode_
Definition: CanvasParameters.h:70
virtual ~CanvasParameters()
Definition: CanvasParameters.cpp:39
void setDataModel(canvas::Interface *)
Definition: CanvasParameters.cpp:74
A widget which holds sub-widgets for manipulating parameters.
Definition: ParameterWidget.h:37
#define OMNI_UI_UNSHARED_DATAMODEL(MODEL)
Definition: DataModel.h:219
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
virtual void dataToFrontend()
Pure virtual method which determines how data model is represented in frontend.
Definition: CanvasParameters.cpp:55
virtual void setUnit(QString const &)
Set slider units.
Definition: CanvasParameters.cpp:108
Parameter widget for getting and setting canvas parameters.
Definition: CanvasParameters.h:32