Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktranslate.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | class QQuickTranslatePrivate : public QQuickTransformPrivate | - | ||||||||||||
5 | { | - | ||||||||||||
6 | public: | - | ||||||||||||
7 | QQuickTranslatePrivate() | - | ||||||||||||
8 | : x(0), y(0) {} executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
9 | - | |||||||||||||
10 | qreal x; | - | ||||||||||||
11 | qreal y; | - | ||||||||||||
12 | }; | - | ||||||||||||
13 | QQuickTranslate::QQuickTranslate(QObject *parent) | - | ||||||||||||
14 | : QQuickTransform(*new QQuickTranslatePrivate, parent) | - | ||||||||||||
15 | { | - | ||||||||||||
16 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
17 | - | |||||||||||||
18 | - | |||||||||||||
19 | QQuickTranslate::~QQuickTranslate() | - | ||||||||||||
20 | { | - | ||||||||||||
21 | } | - | ||||||||||||
22 | - | |||||||||||||
23 | - | |||||||||||||
24 | - | |||||||||||||
25 | - | |||||||||||||
26 | - | |||||||||||||
27 | - | |||||||||||||
28 | - | |||||||||||||
29 | qreal QQuickTranslate::x() const | - | ||||||||||||
30 | { | - | ||||||||||||
31 | const QQuickTranslatePrivate * const d = d_func(); | - | ||||||||||||
32 | return never executed: d->x;return d->x; never executed: return d->x; | 0 | ||||||||||||
33 | } | - | ||||||||||||
34 | - | |||||||||||||
35 | void QQuickTranslate::setX(qreal x) | - | ||||||||||||
36 | { | - | ||||||||||||
37 | QQuickTranslatePrivate * const d = d_func(); | - | ||||||||||||
38 | if (d->x == x
| 0-6 | ||||||||||||
39 | return; never executed: return; | 0 | ||||||||||||
40 | d->x = x; | - | ||||||||||||
41 | update(); | - | ||||||||||||
42 | xChanged(); | - | ||||||||||||
43 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
44 | qreal QQuickTranslate::y() const | - | ||||||||||||
45 | { | - | ||||||||||||
46 | const QQuickTranslatePrivate * const d = d_func(); | - | ||||||||||||
47 | return never executed: d->y;return d->y; never executed: return d->y; | 0 | ||||||||||||
48 | } | - | ||||||||||||
49 | void QQuickTranslate::setY(qreal y) | - | ||||||||||||
50 | { | - | ||||||||||||
51 | QQuickTranslatePrivate * const d = d_func(); | - | ||||||||||||
52 | if (d->y == y
| 0-6 | ||||||||||||
53 | return; never executed: return; | 0 | ||||||||||||
54 | d->y = y; | - | ||||||||||||
55 | update(); | - | ||||||||||||
56 | yChanged(); | - | ||||||||||||
57 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
58 | - | |||||||||||||
59 | void QQuickTranslate::applyTo(QMatrix4x4 *matrix) const | - | ||||||||||||
60 | { | - | ||||||||||||
61 | const QQuickTranslatePrivate * const d = d_func(); | - | ||||||||||||
62 | matrix->translate(d->x, d->y, 0); | - | ||||||||||||
63 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
64 | - | |||||||||||||
65 | class QQuickScalePrivate : public QQuickTransformPrivate | - | ||||||||||||
66 | { | - | ||||||||||||
67 | public: | - | ||||||||||||
68 | QQuickScalePrivate() | - | ||||||||||||
69 | : xScale(1), yScale(1), zScale(1) {} executed 8 times by 3 tests: end of block Executed by:
| 8 | ||||||||||||
70 | QVector3D origin; | - | ||||||||||||
71 | qreal xScale; | - | ||||||||||||
72 | qreal yScale; | - | ||||||||||||
73 | qreal zScale; | - | ||||||||||||
74 | }; | - | ||||||||||||
75 | QQuickScale::QQuickScale(QObject *parent) | - | ||||||||||||
76 | : QQuickTransform(*new QQuickScalePrivate, parent) | - | ||||||||||||
77 | { | - | ||||||||||||
78 | } executed 8 times by 3 tests: end of block Executed by:
| 8 | ||||||||||||
79 | - | |||||||||||||
80 | QQuickScale::~QQuickScale() | - | ||||||||||||
81 | { | - | ||||||||||||
82 | } | - | ||||||||||||
83 | QVector3D QQuickScale::origin() const | - | ||||||||||||
84 | { | - | ||||||||||||
85 | const QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
86 | return never executed: d->origin;return d->origin; never executed: return d->origin; | 0 | ||||||||||||
87 | } | - | ||||||||||||
88 | void QQuickScale::setOrigin(const QVector3D &point) | - | ||||||||||||
89 | { | - | ||||||||||||
90 | QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
91 | if (d->origin == point
| 0 | ||||||||||||
92 | return; never executed: return; | 0 | ||||||||||||
93 | d->origin = point; | - | ||||||||||||
94 | update(); | - | ||||||||||||
95 | originChanged(); | - | ||||||||||||
96 | } never executed: end of block | 0 | ||||||||||||
97 | qreal QQuickScale::xScale() const | - | ||||||||||||
98 | { | - | ||||||||||||
99 | const QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
100 | return never executed: d->xScale;return d->xScale; never executed: return d->xScale; | 0 | ||||||||||||
101 | } | - | ||||||||||||
102 | void QQuickScale::setXScale(qreal scale) | - | ||||||||||||
103 | { | - | ||||||||||||
104 | QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
105 | if (d->xScale == scale
| 2-6 | ||||||||||||
106 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||||||||
107 | d->xScale = scale; | - | ||||||||||||
108 | update(); | - | ||||||||||||
109 | xScaleChanged(); | - | ||||||||||||
110 | scaleChanged(); | - | ||||||||||||
111 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
112 | qreal QQuickScale::yScale() const | - | ||||||||||||
113 | { | - | ||||||||||||
114 | const QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
115 | return never executed: d->yScale;return d->yScale; never executed: return d->yScale; | 0 | ||||||||||||
116 | } | - | ||||||||||||
117 | void QQuickScale::setYScale(qreal scale) | - | ||||||||||||
118 | { | - | ||||||||||||
119 | QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
120 | if (d->yScale == scale
| 2-6 | ||||||||||||
121 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||||||||
122 | d->yScale = scale; | - | ||||||||||||
123 | update(); | - | ||||||||||||
124 | yScaleChanged(); | - | ||||||||||||
125 | scaleChanged(); | - | ||||||||||||
126 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
127 | - | |||||||||||||
128 | qreal QQuickScale::zScale() const | - | ||||||||||||
129 | { | - | ||||||||||||
130 | const QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
131 | return never executed: d->zScale;return d->zScale; never executed: return d->zScale; | 0 | ||||||||||||
132 | } | - | ||||||||||||
133 | void QQuickScale::setZScale(qreal scale) | - | ||||||||||||
134 | { | - | ||||||||||||
135 | QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
136 | if (d->zScale == scale
| 0 | ||||||||||||
137 | return; never executed: return; | 0 | ||||||||||||
138 | d->zScale = scale; | - | ||||||||||||
139 | update(); | - | ||||||||||||
140 | zScaleChanged(); | - | ||||||||||||
141 | scaleChanged(); | - | ||||||||||||
142 | } never executed: end of block | 0 | ||||||||||||
143 | - | |||||||||||||
144 | void QQuickScale::applyTo(QMatrix4x4 *matrix) const | - | ||||||||||||
145 | { | - | ||||||||||||
146 | const QQuickScalePrivate * const d = d_func(); | - | ||||||||||||
147 | matrix->translate(d->origin); | - | ||||||||||||
148 | matrix->scale(d->xScale, d->yScale, d->zScale); | - | ||||||||||||
149 | matrix->translate(-d->origin); | - | ||||||||||||
150 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
151 | - | |||||||||||||
152 | class QQuickRotationPrivate : public QQuickTransformPrivate | - | ||||||||||||
153 | { | - | ||||||||||||
154 | public: | - | ||||||||||||
155 | QQuickRotationPrivate() | - | ||||||||||||
156 | : angle(0), axis(0, 0, 1) {} executed 838 times by 5 tests: end of block Executed by:
| 838 | ||||||||||||
157 | QVector3D origin; | - | ||||||||||||
158 | qreal angle; | - | ||||||||||||
159 | QVector3D axis; | - | ||||||||||||
160 | }; | - | ||||||||||||
161 | QQuickRotation::QQuickRotation(QObject *parent) | - | ||||||||||||
162 | : QQuickTransform(*new QQuickRotationPrivate, parent) | - | ||||||||||||
163 | { | - | ||||||||||||
164 | } executed 838 times by 5 tests: end of block Executed by:
| 838 | ||||||||||||
165 | - | |||||||||||||
166 | QQuickRotation::~QQuickRotation() | - | ||||||||||||
167 | { | - | ||||||||||||
168 | } | - | ||||||||||||
169 | QVector3D QQuickRotation::origin() const | - | ||||||||||||
170 | { | - | ||||||||||||
171 | const QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
172 | return executed 2468 times by 3 tests: d->origin;return d->origin; Executed by:
executed 2468 times by 3 tests: return d->origin; Executed by:
| 2468 | ||||||||||||
173 | } | - | ||||||||||||
174 | - | |||||||||||||
175 | void QQuickRotation::setOrigin(const QVector3D &point) | - | ||||||||||||
176 | { | - | ||||||||||||
177 | QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
178 | if (d->origin == point
| 822-1646 | ||||||||||||
179 | return; executed 822 times by 3 tests: return; Executed by:
| 822 | ||||||||||||
180 | d->origin = point; | - | ||||||||||||
181 | update(); | - | ||||||||||||
182 | originChanged(); | - | ||||||||||||
183 | } executed 1646 times by 3 tests: end of block Executed by:
| 1646 | ||||||||||||
184 | - | |||||||||||||
185 | - | |||||||||||||
186 | - | |||||||||||||
187 | - | |||||||||||||
188 | - | |||||||||||||
189 | - | |||||||||||||
190 | qreal QQuickRotation::angle() const | - | ||||||||||||
191 | { | - | ||||||||||||
192 | const QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
193 | return executed 8 times by 2 tests: d->angle;return d->angle; Executed by:
executed 8 times by 2 tests: return d->angle; Executed by:
| 8 | ||||||||||||
194 | } | - | ||||||||||||
195 | void QQuickRotation::setAngle(qreal angle) | - | ||||||||||||
196 | { | - | ||||||||||||
197 | QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
198 | if (d->angle == angle
| 18-88 | ||||||||||||
199 | return; executed 18 times by 3 tests: return; Executed by:
| 18 | ||||||||||||
200 | d->angle = angle; | - | ||||||||||||
201 | update(); | - | ||||||||||||
202 | angleChanged(); | - | ||||||||||||
203 | } executed 88 times by 5 tests: end of block Executed by:
| 88 | ||||||||||||
204 | QVector3D QQuickRotation::axis() const | - | ||||||||||||
205 | { | - | ||||||||||||
206 | const QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
207 | return executed 838 times by 4 tests: d->axis;return d->axis; Executed by:
executed 838 times by 4 tests: return d->axis; Executed by:
| 838 | ||||||||||||
208 | } | - | ||||||||||||
209 | void QQuickRotation::setAxis(const QVector3D &axis) | - | ||||||||||||
210 | { | - | ||||||||||||
211 | QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
212 | if (d->axis == axis
| 4-834 | ||||||||||||
213 | return; executed 4 times by 1 test: return; Executed by:
| 4 | ||||||||||||
214 | d->axis = axis; | - | ||||||||||||
215 | update(); | - | ||||||||||||
216 | axisChanged(); | - | ||||||||||||
217 | } executed 834 times by 4 tests: end of block Executed by:
| 834 | ||||||||||||
218 | - | |||||||||||||
219 | void QQuickRotation::setAxis(Qt::Axis axis) | - | ||||||||||||
220 | { | - | ||||||||||||
221 | switch (axis) | - | ||||||||||||
222 | { | - | ||||||||||||
223 | case never executed: Qt::XAxis:case Qt::XAxis: never executed: case Qt::XAxis: | 0 | ||||||||||||
224 | setAxis(QVector3D(1, 0, 0)); | - | ||||||||||||
225 | break; never executed: break; | 0 | ||||||||||||
226 | case never executed: Qt::YAxis:case Qt::YAxis: never executed: case Qt::YAxis: | 0 | ||||||||||||
227 | setAxis(QVector3D(0, 1, 0)); | - | ||||||||||||
228 | break; never executed: break; | 0 | ||||||||||||
229 | case never executed: Qt::ZAxis:case Qt::ZAxis: never executed: case Qt::ZAxis: | 0 | ||||||||||||
230 | setAxis(QVector3D(0, 0, 1)); | - | ||||||||||||
231 | break; never executed: break; | 0 | ||||||||||||
232 | } | - | ||||||||||||
233 | } never executed: end of block | 0 | ||||||||||||
234 | - | |||||||||||||
235 | class QGraphicsRotation { | - | ||||||||||||
236 | public: | - | ||||||||||||
237 | static inline void projectedRotate(QMatrix4x4 *matrix, qreal angle, qreal x, qreal y, qreal z) | - | ||||||||||||
238 | { | - | ||||||||||||
239 | matrix->projectedRotate(angle, x, y, z); | - | ||||||||||||
240 | } executed 41 times by 4 tests: end of block Executed by:
| 41 | ||||||||||||
241 | }; | - | ||||||||||||
242 | - | |||||||||||||
243 | void QQuickRotation::applyTo(QMatrix4x4 *matrix) const | - | ||||||||||||
244 | { | - | ||||||||||||
245 | const QQuickRotationPrivate * const d = d_func(); | - | ||||||||||||
246 | - | |||||||||||||
247 | if (d->angle == 0.
| 0-338 | ||||||||||||
248 | return; executed 338 times by 3 tests: return; Executed by:
| 338 | ||||||||||||
249 | - | |||||||||||||
250 | matrix->translate(d->origin); | - | ||||||||||||
251 | QGraphicsRotation::projectedRotate(matrix, d->angle, d->axis.x(), d->axis.y(), d->axis.z()); | - | ||||||||||||
252 | matrix->translate(-d->origin); | - | ||||||||||||
253 | } executed 41 times by 4 tests: end of block Executed by:
| 41 | ||||||||||||
254 | - | |||||||||||||
255 | class QQuickMatrix4x4Private : public QQuickTransformPrivate | - | ||||||||||||
256 | { | - | ||||||||||||
257 | public: | - | ||||||||||||
258 | QQuickMatrix4x4Private() | - | ||||||||||||
259 | : matrix() {} executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
260 | QMatrix4x4 matrix; | - | ||||||||||||
261 | }; | - | ||||||||||||
262 | QQuickMatrix4x4::QQuickMatrix4x4(QObject *parent) | - | ||||||||||||
263 | : QQuickTransform(*new QQuickMatrix4x4Private, parent) | - | ||||||||||||
264 | { | - | ||||||||||||
265 | } executed 6 times by 2 tests: end of block Executed by:
| 6 | ||||||||||||
266 | - | |||||||||||||
267 | QQuickMatrix4x4::~QQuickMatrix4x4() | - | ||||||||||||
268 | { | - | ||||||||||||
269 | } | - | ||||||||||||
270 | - | |||||||||||||
271 | - | |||||||||||||
272 | - | |||||||||||||
273 | - | |||||||||||||
274 | - | |||||||||||||
275 | - | |||||||||||||
276 | QMatrix4x4 QQuickMatrix4x4::matrix() const | - | ||||||||||||
277 | { | - | ||||||||||||
278 | const QQuickMatrix4x4Private * const d = d_func(); | - | ||||||||||||
279 | return never executed: d->matrix;return d->matrix; never executed: return d->matrix; | 0 | ||||||||||||
280 | } | - | ||||||||||||
281 | - | |||||||||||||
282 | void QQuickMatrix4x4::setMatrix(const QMatrix4x4 &matrix) | - | ||||||||||||
283 | { | - | ||||||||||||
284 | QQuickMatrix4x4Private * const d = d_func(); | - | ||||||||||||
285 | if (d->matrix == matrix
| 0-2 | ||||||||||||
286 | return; never executed: return; | 0 | ||||||||||||
287 | d->matrix = matrix; | - | ||||||||||||
288 | update(); | - | ||||||||||||
289 | matrixChanged(); | - | ||||||||||||
290 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
291 | - | |||||||||||||
292 | void QQuickMatrix4x4::applyTo(QMatrix4x4 *matrix) const | - | ||||||||||||
293 | { | - | ||||||||||||
294 | const QQuickMatrix4x4Private * const d = d_func(); | - | ||||||||||||
295 | *matrix *= d->matrix; | - | ||||||||||||
296 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
297 | - | |||||||||||||
298 | - | |||||||||||||
299 | - | |||||||||||||
Switch to Source code | Preprocessed file |