Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Rotation.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_ROTATION_H_
21 #define OMNI_UI_ROTATION_H_
22 
24 #include <omni/ui/mixin/Locked.h>
25 #include "Dial.h"
26 
27 namespace omni {
28  namespace ui {
29  /// Rotation widget has three dials for rotation in X,Y,Z direction
30  class Rotation :
31  public QWidget,
32  protected mixin::Locked {
33  Q_OBJECT
34 
35  public:
36  /// Construct from optional parent widget
37  Rotation(QWidget * = nullptr);
38 
39  /// Construct from given x,y,z angle values
40  Rotation(double _x,
41  double _y,
42  double _z,
43  QWidget * = nullptr);
44  ~Rotation();
45 
46  /// Return x angle (roll) value as double
47  double x() const;
48 
49  /// Return y angle (pitch) value as double
50  double y() const;
51 
52  /// Return z angle (yaw) value as double
53  double z() const;
54 
55  /// Return x,y,z values as euler angles
56  EulerAngles angles() const;
57 
58  public slots:
59  /// Set value for X angle (roll angle)
60  void setX(double);
61 
62  /// Set value for Y angle (pitch angle)
63  void setY(double);
64 
65  /// Set value for Z angle (yaw angle)
66  void setZ(double);
67 
68  /// Set rotation from euler angles
69  void setRotation(EulerAngles const&);
70 
71  signals:
72  void xChanged();
73  void yChanged();
74  void zChanged();
75  void rotationChanged();
76 
77  private:
78  void updateX();
79  void updateY();
80  void updateZ();
81 
82  void init(double,
83  double,
84  double);
85  Dial *x_;
86  Dial *y_;
87  Dial *z_;
88  };
89  }
90 }
91 
92 
93 #endif /* OMNI_UI_ROTATION_H_ */
void setY(double)
Set value for Y angle (pitch angle)
Definition: Rotation.cpp:89
Mixin with a function to lock the widget temporarily.
Definition: Locked.h:26
void setZ(double)
Set value for Z angle (yaw angle)
Definition: Rotation.cpp:94
Rotation widget has three dials for rotation in X,Y,Z direction.
Definition: Rotation.h:30
double y() const
Return y angle (pitch) value as double.
Definition: Rotation.cpp:74
Dial * y_
Definition: Rotation.h:86
void setX(double)
Set value for X angle (roll angle)
Definition: Rotation.cpp:84
void init(double, double, double)
Definition: Rotation.cpp:41
Dial * x_
Definition: Rotation.h:85
~Rotation()
Definition: Rotation.cpp:38
void setRotation(EulerAngles const &)
Set rotation from euler angles.
Definition: Rotation.cpp:120
void updateY()
Definition: Rotation.cpp:106
EulerAngles angles() const
Return x,y,z values as euler angles.
double x() const
Return x angle (roll) value as double.
Definition: Rotation.cpp:69
Dial * z_
Definition: Rotation.h:87
double z() const
Return z angle (yaw) value as double.
Definition: Rotation.cpp:79
Circular dial widget with range value and editor.
Definition: Dial.h:33
Rotation(QWidget *=nullptr)
Construct from optional parent widget.
Definition: Rotation.cpp:26
void updateZ()
Definition: Rotation.cpp:113
void updateX()
Definition: Rotation.cpp:99