Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EulerAngles.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_GEOMETRY_EULERANGLES_H_
21 #define OMNI_GEOMETRY_EULERANGLES_H_
22 
23 #include <QMatrix4x4>
24 #include <omni/geometry/Angle.h>
25 
26 namespace omni {
27  namespace geometry {
28  /// Mixin class for a zyx Euler Angle Rotation system
29  struct EulerAngles
30  {
31  /// Default constructor, all angles are zero
32  EulerAngles();
33 
34  /// Constructor by values
35  EulerAngles(Angle _yaw,
36  Angle _pitch,
37  Angle _roll);
38 
39  /// Reference to yaw angle (Angle in Z direction)
40  Angle & yaw();
41 
42  /// Reference to yaw angle (Angle in Z direction, const version)
43  Angle const & yaw() const;
44 
45  /// Set yaw angle (Z direction angle) to new value
46  void setYaw(Angle _yaw);
47 
48  /// Reference to pitch angle (Angle in Y direction)
49  Angle & pitch();
50 
51  /// Reference to pitch angle (Angle in Y direction, const version)
52  Angle const & pitch() const;
53 
54  /// Set pitch angle (Y direction angle) to new value
55  void setPitch(Angle _pitch);
56 
57  /// Reference to roll angle (Angle in X direction)
58  Angle & roll();
59 
60  /// Reference to roll angle (Angle in X direction)
61  Angle const & roll() const;
62 
63  /// Set roll angle (X direction angle) to new value
64  void setRoll(Angle _roll);
65 
66  /// Public Static function to get rotation matrix conveniently
67  static QMatrix4x4 matrix(Angle _yaw,
68  Angle _pitch,
69  Angle _roll);
70 
71  /// Calculate the rotation matrix
72  QMatrix4x4 matrix() const;
73 
74  /// Test for equality
75  friend bool operator==(EulerAngles const&,
76  EulerAngles const&);
77 
78  private:
79  /// Yaw Angle (Z direction)
81 
82  /// Pitch Angle (Y direction)
84 
85  /// Roll Angle (X direction)
87  };
88  }
90 }
91 
92 QDataStream& operator>>(QDataStream&,
94 QDataStream& operator<<(QDataStream&,
96 
97 
98 #endif /* OMNI_GEOMETRY_EULERANGLES_H_ */
void setYaw(Angle _yaw)
Set yaw angle (Z direction angle) to new value.
Definition: EulerAngles.cpp:47
Angle & pitch()
Reference to pitch angle (Angle in Y direction)
Definition: EulerAngles.cpp:52
QDataStream & operator<<(QDataStream &, omni::geometry::EulerAngles const &)
Angle & yaw()
Reference to yaw angle (Angle in Z direction)
Definition: EulerAngles.cpp:37
Angle & roll()
Reference to roll angle (Angle in X direction)
Definition: EulerAngles.cpp:67
Angle roll_
Roll Angle (X direction)
Definition: EulerAngles.h:86
Angle pitch_
Pitch Angle (Y direction)
Definition: EulerAngles.h:83
void setRoll(Angle _roll)
Set roll angle (X direction angle) to new value.
Definition: EulerAngles.cpp:77
void setPitch(Angle _pitch)
Set pitch angle (Y direction angle) to new value.
Definition: EulerAngles.cpp:62
Mixin class for a zyx Euler Angle Rotation system.
Definition: EulerAngles.h:29
friend bool operator==(EulerAngles const &, EulerAngles const &)
Test for equality.
Definition: EulerAngles.cpp:98
Angle yaw_
Yaw Angle (Z direction)
Definition: EulerAngles.h:80
QMatrix4x4 matrix() const
Calculate the rotation matrix.
Definition: EulerAngles.cpp:93
EulerAngles()
Default constructor, all angles are zero.
Definition: EulerAngles.cpp:27
Struct for representing an angle (stored in degrees internally)
Definition: Angle.h:28
QDataStream & operator>>(QDataStream &, omni::geometry::EulerAngles &)