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

KDE's Doxygen guidelines are available online.