Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquickgravity.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | const qreal CONV = 0.017453292520444443; | - | ||||||
3 | void QQuickGravityAffector::setMagnitude(qreal arg) | - | ||||||
4 | { | - | ||||||
5 | if (m_magnitude != arg
| 0-4 | ||||||
6 | m_magnitude = arg; | - | ||||||
7 | m_needRecalc = true; | - | ||||||
8 | magnitudeChanged(arg); | - | ||||||
9 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
10 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
11 | - | |||||||
12 | qreal QQuickGravityAffector::magnitude() const | - | ||||||
13 | { | - | ||||||
14 | return never executed: m_magnitude;return m_magnitude; never executed: return m_magnitude; | 0 | ||||||
15 | } | - | ||||||
16 | void QQuickGravityAffector::setAcceleration(qreal arg) | - | ||||||
17 | { | - | ||||||
18 | qmlWarning(this) << "The acceleration property is deprecated. Please use magnitude instead."; | - | ||||||
19 | setMagnitude(arg); | - | ||||||
20 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
21 | - | |||||||
22 | - | |||||||
23 | - | |||||||
24 | - | |||||||
25 | - | |||||||
26 | - | |||||||
27 | void QQuickGravityAffector::setAngle(qreal arg) | - | ||||||
28 | { | - | ||||||
29 | if (m_angle != arg
| 2 | ||||||
30 | m_angle = arg; | - | ||||||
31 | m_needRecalc = true; | - | ||||||
32 | angleChanged(arg); | - | ||||||
33 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
34 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
35 | - | |||||||
36 | qreal QQuickGravityAffector::angle() const | - | ||||||
37 | { | - | ||||||
38 | return never executed: m_angle;return m_angle; never executed: return m_angle; | 0 | ||||||
39 | } | - | ||||||
40 | - | |||||||
41 | QQuickGravityAffector::QQuickGravityAffector(QQuickItem *parent) : | - | ||||||
42 | QQuickParticleAffector(parent), m_magnitude(-10), m_angle(90), m_needRecalc(true) | - | ||||||
43 | { | - | ||||||
44 | } executed 4 times by 2 tests: end of block Executed by:
| 4 | ||||||
45 | - | |||||||
46 | bool QQuickGravityAffector::affectParticle(QQuickParticleData *d, qreal dt) | - | ||||||
47 | { | - | ||||||
48 | if (!m_magnitude
| 0-22348 | ||||||
49 | return never executed: false;return false; never executed: return false; | 0 | ||||||
50 | if (m_needRecalc
| 2-22346 | ||||||
51 | m_needRecalc = false; | - | ||||||
52 | m_dx = m_magnitude * std::cos(m_angle * CONV); | - | ||||||
53 | m_dy = m_magnitude * std::sin(m_angle * CONV); | - | ||||||
54 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
55 | - | |||||||
56 | d->setInstantaneousVX(d->curVX(m_system) + m_dx*dt, m_system); | - | ||||||
57 | d->setInstantaneousVY(d->curVY(m_system) + m_dy*dt, m_system); | - | ||||||
58 | return executed 22348 times by 1 test: true;return true; Executed by:
executed 22348 times by 1 test: return true; Executed by:
| 22348 | ||||||
59 | } | - | ||||||
60 | - | |||||||
61 | - | |||||||
62 | - | |||||||
63 | - | |||||||
64 | - | |||||||
Switch to Source code | Preprocessed file |