Marble

GeoDataAnimatedUpdate.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Sanjiban Bairagya <sanjiban22393@gmail.com>
4//
5
6#include "GeoDataAnimatedUpdate.h"
7#include "GeoDataAbstractView.h"
8#include "GeoDataTypes.h"
9#include "GeoDataUpdate.h"
10
11namespace Marble
12{
13
14class GeoDataAnimatedUpdatePrivate
15{
16public:
17 double m_duration;
18 double m_delayedStart;
19 GeoDataUpdate *m_update;
20 GeoDataAnimatedUpdatePrivate();
21};
22
23GeoDataAnimatedUpdatePrivate::GeoDataAnimatedUpdatePrivate()
24 : m_duration(0.0)
25 , m_delayedStart(0)
26 , m_update(nullptr)
27{
28}
29
30GeoDataAnimatedUpdate::GeoDataAnimatedUpdate()
31 : d(new GeoDataAnimatedUpdatePrivate)
32{
33}
34
35GeoDataAnimatedUpdate::GeoDataAnimatedUpdate(const Marble::GeoDataAnimatedUpdate &other)
36 : GeoDataTourPrimitive(other)
37 , d(new GeoDataAnimatedUpdatePrivate(*other.d))
38{
39}
40
41GeoDataAnimatedUpdate &GeoDataAnimatedUpdate::operator=(const GeoDataAnimatedUpdate &other)
42{
43 GeoDataTourPrimitive::operator=(other);
44 *d = *other.d;
45 return *this;
46}
47
48bool GeoDataAnimatedUpdate::operator==(const GeoDataAnimatedUpdate &other) const
49{
50 if ((!d->m_update && other.d->m_update) || (d->m_update && !other.d->m_update)) {
51 return false;
52 } else if (d->m_update && other.d->m_update) {
53 return d->m_duration == other.d->m_duration && *(d->m_update) == *(other.d->m_update);
54 }
55 return d->m_duration == other.d->m_duration;
56}
57
58bool GeoDataAnimatedUpdate::operator!=(const GeoDataAnimatedUpdate &other) const
59{
60 return !this->operator==(other);
61}
62
63GeoDataAnimatedUpdate::~GeoDataAnimatedUpdate()
64{
65 delete d;
66}
67
68const char *GeoDataAnimatedUpdate::nodeType() const
69{
70 return GeoDataTypes::GeoDataAnimatedUpdateType;
71}
72
73const GeoDataUpdate *GeoDataAnimatedUpdate::update() const
74{
75 return d->m_update;
76}
77
78GeoDataUpdate *GeoDataAnimatedUpdate::update()
79{
80 return d->m_update;
81}
82
83void GeoDataAnimatedUpdate::setUpdate(GeoDataUpdate *update)
84{
85 delete d->m_update;
86 d->m_update = update;
87 if (d->m_update) {
88 d->m_update->setParent(this);
89 }
90}
91
92double GeoDataAnimatedUpdate::duration() const
93{
94 return d->m_duration;
95}
96
97void GeoDataAnimatedUpdate::setDuration(double duration)
98{
99 d->m_duration = duration;
100}
101
102double GeoDataAnimatedUpdate::delayedStart() const
103{
104 return d->m_delayedStart;
105}
106
107void GeoDataAnimatedUpdate::setDelayedStart(double delayedStart)
108{
109 d->m_delayedStart = delayedStart;
110}
111
112}
void update(Part *part, const QByteArray &data, qint64 dataSize)
KIOCORE_EXPORT bool operator==(const UDSEntry &entry, const UDSEntry &other)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.