/src/qtbase/src/gui/math3d/qquaternion.h
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QQUATERNION_H |
6 | | #define QQUATERNION_H |
7 | | |
8 | | #include <QtGui/qtguiglobal.h> |
9 | | #include <QtGui/qgenericmatrix.h> |
10 | | #include <QtGui/qvector3d.h> |
11 | | #include <QtGui/qvector4d.h> |
12 | | |
13 | | QT_BEGIN_NAMESPACE |
14 | | |
15 | | |
16 | | #ifndef QT_NO_QUATERNION |
17 | | |
18 | | class QMatrix4x4; |
19 | | class QVariant; |
20 | | |
21 | | class QT6_ONLY(Q_GUI_EXPORT) QQuaternion |
22 | | { |
23 | | public: |
24 | | constexpr QQuaternion() noexcept; |
25 | 0 | explicit QQuaternion(Qt::Initialization) noexcept {} |
26 | | constexpr QQuaternion(float scalar, float xpos, float ypos, float zpos) noexcept; |
27 | | #ifndef QT_NO_VECTOR3D |
28 | | constexpr QQuaternion(float scalar, const QVector3D &vector) noexcept; |
29 | | #endif |
30 | | #ifndef QT_NO_VECTOR4D |
31 | | constexpr explicit QQuaternion(const QVector4D &vector) noexcept; |
32 | | #endif |
33 | | |
34 | | constexpr bool isNull() const noexcept; |
35 | | constexpr bool isIdentity() const noexcept; |
36 | | |
37 | | #ifndef QT_NO_VECTOR3D |
38 | | constexpr QVector3D vector() const noexcept; |
39 | | constexpr void setVector(const QVector3D &vector) noexcept; |
40 | | #endif |
41 | | constexpr void setVector(float x, float y, float z) noexcept; |
42 | | |
43 | | constexpr float x() const noexcept; |
44 | | constexpr float y() const noexcept; |
45 | | constexpr float z() const noexcept; |
46 | | constexpr float scalar() const noexcept; |
47 | | |
48 | | constexpr void setX(float x) noexcept; |
49 | | constexpr void setY(float y) noexcept; |
50 | | constexpr void setZ(float z) noexcept; |
51 | | constexpr void setScalar(float scalar) noexcept; |
52 | | |
53 | | constexpr static float dotProduct(const QQuaternion &q1, const QQuaternion &q2) noexcept; |
54 | | |
55 | | // ### Qt 7: make the next four constexpr |
56 | | // (perhaps using std::hypot, constexpr in C++26, or constexpr qHypot) |
57 | | QT7_ONLY(Q_GUI_EXPORT) float length() const; |
58 | | QT7_ONLY(Q_GUI_EXPORT) float lengthSquared() const; |
59 | | |
60 | | [[nodiscard]] QT7_ONLY(Q_GUI_EXPORT) QQuaternion normalized() const; |
61 | | QT7_ONLY(Q_GUI_EXPORT) void normalize(); |
62 | | |
63 | | constexpr QQuaternion inverted() const noexcept; |
64 | | |
65 | | [[nodiscard]] constexpr QQuaternion conjugated() const noexcept; |
66 | | |
67 | | QT7_ONLY(Q_GUI_EXPORT) QVector3D rotatedVector(const QVector3D &vector) const; |
68 | | |
69 | | constexpr QQuaternion &operator+=(const QQuaternion &quaternion) noexcept; |
70 | | constexpr QQuaternion &operator-=(const QQuaternion &quaternion) noexcept; |
71 | | constexpr QQuaternion &operator*=(float factor) noexcept; |
72 | | constexpr QQuaternion &operator*=(const QQuaternion &quaternion) noexcept; |
73 | | constexpr QQuaternion &operator/=(float divisor); |
74 | | |
75 | | QT_WARNING_PUSH |
76 | | QT_WARNING_DISABLE_FLOAT_COMPARE |
77 | | friend constexpr bool operator==(const QQuaternion &q1, const QQuaternion &q2) noexcept |
78 | 0 | { |
79 | 0 | return q1.wp == q2.wp && q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp; |
80 | 0 | } |
81 | | friend constexpr bool operator!=(const QQuaternion &q1, const QQuaternion &q2) noexcept |
82 | 0 | { |
83 | 0 | return !(q1 == q2); |
84 | 0 | } |
85 | | QT_WARNING_POP |
86 | | |
87 | | friend constexpr QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2) noexcept; |
88 | | friend constexpr QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2) noexcept; |
89 | | friend constexpr QQuaternion operator*(float factor, const QQuaternion &quaternion) noexcept; |
90 | | friend constexpr QQuaternion operator*(const QQuaternion &quaternion, float factor) noexcept; |
91 | | friend constexpr QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2) noexcept; |
92 | | friend constexpr QQuaternion operator-(const QQuaternion &quaternion) noexcept; |
93 | | friend constexpr QQuaternion operator/(const QQuaternion &quaternion, float divisor); |
94 | | |
95 | | friend constexpr bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2) noexcept; |
96 | | |
97 | | #ifndef QT_NO_VECTOR4D |
98 | | constexpr QVector4D toVector4D() const noexcept; |
99 | | #endif |
100 | | |
101 | | QT7_ONLY(Q_GUI_EXPORT) operator QVariant() const; |
102 | | |
103 | | struct Axis { |
104 | | float x, y, z; |
105 | | // prevent users from defining them themselves, until we do: |
106 | | friend constexpr bool comparesEqual(Axis lhs, Axis rhs) noexcept |
107 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
108 | | friend bool operator==(Axis, Axis) |
109 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
110 | | friend bool operator!=(Axis, Axis) |
111 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
112 | | friend size_t qHash(const Axis &, size_t) noexcept |
113 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
114 | | friend size_t qHash(const Axis &) noexcept |
115 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
116 | | friend bool qFuzzyIsNull(Axis axis) noexcept |
117 | 0 | { return qFuzzyIsNull(axis.x) && qFuzzyIsNull(axis.y) && qFuzzyIsNull(axis.z); } |
118 | | friend bool qFuzzyCompare(Axis lhs, Axis rhs) noexcept |
119 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
120 | | #ifndef QT_NO_VECTOR3D |
121 | | static constexpr Axis fromVector3D(QVector3D v) noexcept |
122 | 0 | { return {v.x(), v.y(), v.z()}; } |
123 | 0 | constexpr QVector3D toVector3D() const noexcept { return {x, y, z}; } |
124 | | friend constexpr bool comparesEqual(Axis lhs, QVector3D rhs) noexcept |
125 | | Q_DECL_EQ_DELETE_X("Deliberately not implemented. Don't implement it yourself!"); |
126 | | #endif |
127 | | }; |
128 | | |
129 | | #ifndef QT_NO_VECTOR3D |
130 | | inline void getAxisAndAngle(QVector3D *axis, float *angle) const; |
131 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromAxisAndAngle(const QVector3D &axis, float angle); |
132 | | #endif |
133 | | QT7_ONLY(Q_GUI_EXPORT) void getAxisAndAngle(float *x, float *y, float *z, float *angle) const; |
134 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromAxisAndAngle(float x, float y, float z, |
135 | | float angle); |
136 | | |
137 | | #ifndef QT_NO_VECTOR3D |
138 | | inline QVector3D toEulerAngles() const; |
139 | | # if !QT_CORE_REMOVED_SINCE(6, 11) |
140 | | Q_WEAK_OVERLOAD |
141 | | # endif |
142 | | static QQuaternion fromEulerAngles(const QVector3D &angles) |
143 | | { return fromEulerAngles(angles.x(), angles.y(), angles.z()); } |
144 | | |
145 | | #endif |
146 | | template <typename T> |
147 | | struct EulerAngles |
148 | | { |
149 | | T pitch, yaw, roll; |
150 | | }; |
151 | | QT7_ONLY(Q_GUI_EXPORT) EulerAngles<float> eulerAngles() const; |
152 | | static QQuaternion fromEulerAngles(EulerAngles<float> angles) |
153 | 0 | { return fromEulerAngles(angles.pitch, angles.yaw, angles.roll); } |
154 | | |
155 | | QT_GUI_INLINE_SINCE(6, 11) |
156 | | void getEulerAngles(float *pitch, float *yaw, float *roll) const; |
157 | | static QQuaternion fromEulerAngles(float pitch, float yaw, float roll); |
158 | | |
159 | | QT7_ONLY(Q_GUI_EXPORT) QMatrix3x3 toRotationMatrix() const; |
160 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromRotationMatrix(const QMatrix3x3 &rot3x3); |
161 | | |
162 | | struct Axes |
163 | | { |
164 | | Axis x, y, z; |
165 | | }; |
166 | | QT7_ONLY(Q_GUI_EXPORT) Axes toAxes() const; |
167 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromAxes(Axes axes); // clazy:exclude=function-args-by-ref |
168 | | #ifndef QT_NO_VECTOR3D |
169 | | QT_GUI_INLINE_SINCE(6, 11) |
170 | | void getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const; |
171 | | QT_GUI_INLINE_SINCE(6, 11) |
172 | | static QQuaternion fromAxes(const QVector3D &xAxis, |
173 | | const QVector3D &yAxis, |
174 | | const QVector3D &zAxis); |
175 | | |
176 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromDirection(const QVector3D &direction, |
177 | | const QVector3D &up); |
178 | | |
179 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion rotationTo(const QVector3D &from, |
180 | | const QVector3D &to); |
181 | | #endif // QT_NO_VECTOR3D |
182 | | |
183 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion slerp(const QQuaternion &q1, const QQuaternion &q2, |
184 | | float t); |
185 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fastSlerp(const QQuaternion &q1, |
186 | | const QQuaternion &q2, float t); |
187 | | QT7_ONLY(Q_GUI_EXPORT) static QQuaternion nlerp(const QQuaternion &q1, const QQuaternion &q2, |
188 | | float t); |
189 | | |
190 | | private: |
191 | | float wp, xp, yp, zp; |
192 | | }; |
193 | | |
194 | | Q_DECLARE_TYPEINFO(QQuaternion, Q_PRIMITIVE_TYPE); |
195 | | |
196 | 0 | constexpr QQuaternion::QQuaternion() noexcept : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} |
197 | | |
198 | | constexpr QQuaternion::QQuaternion(float aScalar, float xpos, float ypos, float zpos) noexcept |
199 | 0 | : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} |
200 | | |
201 | | QT_WARNING_PUSH |
202 | | QT_WARNING_DISABLE_FLOAT_COMPARE |
203 | | |
204 | | constexpr bool QQuaternion::isNull() const noexcept |
205 | 0 | { |
206 | 0 | return wp == 0.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f; |
207 | 0 | } |
208 | | |
209 | | constexpr bool QQuaternion::isIdentity() const noexcept |
210 | 0 | { |
211 | 0 | return wp == 1.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f; |
212 | 0 | } |
213 | | QT_WARNING_POP |
214 | | |
215 | 0 | constexpr float QQuaternion::x() const noexcept { return xp; } |
216 | 0 | constexpr float QQuaternion::y() const noexcept { return yp; } |
217 | 0 | constexpr float QQuaternion::z() const noexcept { return zp; } |
218 | 0 | constexpr float QQuaternion::scalar() const noexcept { return wp; } |
219 | | |
220 | 0 | constexpr void QQuaternion::setX(float aX) noexcept { xp = aX; } |
221 | 0 | constexpr void QQuaternion::setY(float aY) noexcept { yp = aY; } |
222 | 0 | constexpr void QQuaternion::setZ(float aZ) noexcept { zp = aZ; } |
223 | 0 | constexpr void QQuaternion::setScalar(float aScalar) noexcept { wp = aScalar; } |
224 | | |
225 | | constexpr float QQuaternion::dotProduct(const QQuaternion &q1, const QQuaternion &q2) noexcept |
226 | 0 | { |
227 | 0 | return q1.wp * q2.wp + q1.xp * q2.xp + q1.yp * q2.yp + q1.zp * q2.zp; |
228 | 0 | } |
229 | | |
230 | | constexpr QQuaternion QQuaternion::inverted() const noexcept |
231 | 0 | { |
232 | 0 | // Need some extra precision if the length is very small. |
233 | 0 | double len = double(wp) * double(wp) + |
234 | 0 | double(xp) * double(xp) + |
235 | 0 | double(yp) * double(yp) + |
236 | 0 | double(zp) * double(zp); |
237 | 0 | if (!qFuzzyIsNull(len)) |
238 | 0 | return QQuaternion(float(double(wp) / len), float(double(-xp) / len), |
239 | 0 | float(double(-yp) / len), float(double(-zp) / len)); |
240 | 0 | return QQuaternion(0.0f, 0.0f, 0.0f, 0.0f); |
241 | 0 | } |
242 | | |
243 | | constexpr QQuaternion QQuaternion::conjugated() const noexcept |
244 | 0 | { |
245 | 0 | return QQuaternion(wp, -xp, -yp, -zp); |
246 | 0 | } |
247 | | |
248 | | constexpr QQuaternion &QQuaternion::operator+=(const QQuaternion &quaternion) noexcept |
249 | 0 | { |
250 | 0 | wp += quaternion.wp; |
251 | 0 | xp += quaternion.xp; |
252 | 0 | yp += quaternion.yp; |
253 | 0 | zp += quaternion.zp; |
254 | 0 | return *this; |
255 | 0 | } |
256 | | |
257 | | constexpr QQuaternion &QQuaternion::operator-=(const QQuaternion &quaternion) noexcept |
258 | 0 | { |
259 | 0 | wp -= quaternion.wp; |
260 | 0 | xp -= quaternion.xp; |
261 | 0 | yp -= quaternion.yp; |
262 | 0 | zp -= quaternion.zp; |
263 | 0 | return *this; |
264 | 0 | } |
265 | | |
266 | | constexpr QQuaternion &QQuaternion::operator*=(float factor) noexcept |
267 | 0 | { |
268 | 0 | wp *= factor; |
269 | 0 | xp *= factor; |
270 | 0 | yp *= factor; |
271 | 0 | zp *= factor; |
272 | 0 | return *this; |
273 | 0 | } |
274 | | |
275 | | constexpr QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2) noexcept |
276 | 0 | { |
277 | 0 | float yy = (q1.wp - q1.yp) * (q2.wp + q2.zp); |
278 | 0 | float zz = (q1.wp + q1.yp) * (q2.wp - q2.zp); |
279 | 0 | float ww = (q1.zp + q1.xp) * (q2.xp + q2.yp); |
280 | 0 | float xx = ww + yy + zz; |
281 | 0 | float qq = 0.5f * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp)); |
282 | |
|
283 | 0 | float w = qq - ww + (q1.zp - q1.yp) * (q2.yp - q2.zp); |
284 | 0 | float x = qq - xx + (q1.xp + q1.wp) * (q2.xp + q2.wp); |
285 | 0 | float y = qq - yy + (q1.wp - q1.xp) * (q2.yp + q2.zp); |
286 | 0 | float z = qq - zz + (q1.zp + q1.yp) * (q2.wp - q2.xp); |
287 | |
|
288 | 0 | return QQuaternion(w, x, y, z); |
289 | 0 | } |
290 | | |
291 | | constexpr QQuaternion &QQuaternion::operator*=(const QQuaternion &quaternion) noexcept |
292 | 0 | { |
293 | 0 | *this = *this * quaternion; |
294 | 0 | return *this; |
295 | 0 | } |
296 | | |
297 | | constexpr QQuaternion &QQuaternion::operator/=(float divisor) |
298 | 0 | { |
299 | 0 | wp /= divisor; |
300 | 0 | xp /= divisor; |
301 | 0 | yp /= divisor; |
302 | 0 | zp /= divisor; |
303 | 0 | return *this; |
304 | 0 | } |
305 | | |
306 | | constexpr QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2) noexcept |
307 | 0 | { |
308 | 0 | return QQuaternion(q1.wp + q2.wp, q1.xp + q2.xp, q1.yp + q2.yp, q1.zp + q2.zp); |
309 | 0 | } |
310 | | |
311 | | constexpr QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2) noexcept |
312 | 0 | { |
313 | 0 | return QQuaternion(q1.wp - q2.wp, q1.xp - q2.xp, q1.yp - q2.yp, q1.zp - q2.zp); |
314 | 0 | } |
315 | | |
316 | | constexpr QQuaternion operator*(float factor, const QQuaternion &quaternion) noexcept |
317 | 0 | { |
318 | 0 | return QQuaternion(quaternion.wp * factor, quaternion.xp * factor, quaternion.yp * factor, quaternion.zp * factor); |
319 | 0 | } |
320 | | |
321 | | constexpr QQuaternion operator*(const QQuaternion &quaternion, float factor) noexcept |
322 | 0 | { |
323 | 0 | return QQuaternion(quaternion.wp * factor, quaternion.xp * factor, quaternion.yp * factor, quaternion.zp * factor); |
324 | 0 | } |
325 | | |
326 | | constexpr QQuaternion operator-(const QQuaternion &quaternion) noexcept |
327 | 0 | { |
328 | 0 | return QQuaternion(-quaternion.wp, -quaternion.xp, -quaternion.yp, -quaternion.zp); |
329 | 0 | } |
330 | | |
331 | | constexpr QQuaternion operator/(const QQuaternion &quaternion, float divisor) |
332 | 0 | { |
333 | 0 | return QQuaternion(quaternion.wp / divisor, quaternion.xp / divisor, quaternion.yp / divisor, quaternion.zp / divisor); |
334 | 0 | } |
335 | | |
336 | | constexpr bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2) noexcept |
337 | 0 | { |
338 | 0 | return QtPrivate::fuzzyCompare(q1.wp, q2.wp) |
339 | 0 | && QtPrivate::fuzzyCompare(q1.xp, q2.xp) |
340 | 0 | && QtPrivate::fuzzyCompare(q1.yp, q2.yp) |
341 | 0 | && QtPrivate::fuzzyCompare(q1.zp, q2.zp); |
342 | 0 | } |
343 | | |
344 | | #if QT_GUI_INLINE_IMPL_SINCE(6, 11) |
345 | | void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll) const |
346 | 0 | { |
347 | 0 | Q_PRE(pitch); |
348 | 0 | Q_PRE(yaw); |
349 | 0 | Q_PRE(roll); |
350 | 0 | const auto angles = eulerAngles(); |
351 | 0 | *pitch = angles.pitch; |
352 | 0 | *yaw = angles.yaw; |
353 | 0 | *roll = angles.roll; |
354 | 0 | } |
355 | | #endif // QT_GUI_INLINE_IMPL_SINCE |
356 | | |
357 | | #ifndef QT_NO_VECTOR3D |
358 | | |
359 | | constexpr QQuaternion::QQuaternion(float aScalar, const QVector3D &aVector) noexcept |
360 | 0 | : wp(aScalar), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} |
361 | | |
362 | | constexpr void QQuaternion::setVector(const QVector3D &aVector) noexcept |
363 | 0 | { |
364 | 0 | xp = aVector.x(); |
365 | 0 | yp = aVector.y(); |
366 | 0 | zp = aVector.z(); |
367 | 0 | } |
368 | | |
369 | | constexpr QVector3D QQuaternion::vector() const noexcept |
370 | 0 | { |
371 | 0 | return QVector3D(xp, yp, zp); |
372 | 0 | } |
373 | | |
374 | | inline QVector3D operator*(const QQuaternion &quaternion, const QVector3D &vec) |
375 | 0 | { |
376 | 0 | return quaternion.rotatedVector(vec); |
377 | 0 | } |
378 | | |
379 | | void QQuaternion::getAxisAndAngle(QVector3D *axis, float *angle) const |
380 | 0 | { |
381 | 0 | float aX, aY, aZ; |
382 | 0 | getAxisAndAngle(&aX, &aY, &aZ, angle); |
383 | 0 | *axis = QVector3D(aX, aY, aZ); |
384 | 0 | } |
385 | | |
386 | | QVector3D QQuaternion::toEulerAngles() const |
387 | 0 | { |
388 | 0 | const auto angles = eulerAngles(); |
389 | 0 | return QVector3D{angles.pitch, angles.yaw, angles.roll}; |
390 | 0 | } |
391 | | |
392 | | #if QT_GUI_INLINE_IMPL_SINCE(6, 11) |
393 | | void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const |
394 | 0 | { |
395 | 0 | Q_PRE(xAxis); |
396 | 0 | Q_PRE(yAxis); |
397 | 0 | Q_PRE(zAxis); |
398 | 0 | const Axes axes = toAxes(); |
399 | 0 | *xAxis = axes.x.toVector3D(); |
400 | 0 | *yAxis = axes.y.toVector3D(); |
401 | 0 | *zAxis = axes.z.toVector3D(); |
402 | 0 | } |
403 | | |
404 | | QQuaternion QQuaternion::fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis) |
405 | 0 | { |
406 | 0 | return fromAxes(Axes{Axis::fromVector3D(xAxis), |
407 | 0 | Axis::fromVector3D(yAxis), |
408 | 0 | Axis::fromVector3D(zAxis)}); |
409 | 0 | } |
410 | | #endif // QT_GUI_INLINE_IMPL_SINCE(6, 11) |
411 | | |
412 | | #endif // QT_NO_VECTOR3D |
413 | | |
414 | | constexpr void QQuaternion::setVector(float aX, float aY, float aZ) noexcept |
415 | 0 | { |
416 | 0 | xp = aX; |
417 | 0 | yp = aY; |
418 | 0 | zp = aZ; |
419 | 0 | } |
420 | | |
421 | | #ifndef QT_NO_VECTOR4D |
422 | | |
423 | | constexpr QQuaternion::QQuaternion(const QVector4D &aVector) noexcept |
424 | | : wp(aVector.w()), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} |
425 | | |
426 | | constexpr QVector4D QQuaternion::toVector4D() const noexcept |
427 | 0 | { |
428 | 0 | return QVector4D(xp, yp, zp, wp); |
429 | 0 | } |
430 | | |
431 | | #endif // QT_NO_VECTOR4D |
432 | | |
433 | | #ifndef QT_NO_DEBUG_STREAM |
434 | | Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QQuaternion &q); |
435 | | #endif |
436 | | |
437 | | #ifndef QT_NO_DATASTREAM |
438 | | Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QQuaternion &); |
439 | | Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QQuaternion &); |
440 | | #endif |
441 | | |
442 | | #endif // QT_NO_QUATERNION |
443 | | |
444 | | QT_END_NAMESPACE |
445 | | |
446 | | #endif // QQUATERNION_H |