Marble

GeoDataAnimatedUpdate.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2014 Sanjiban Bairagya <[email protected]>
4 //
5 
6 #include "GeoDataAnimatedUpdate.h"
7 #include "GeoDataUpdate.h"
8 #include "GeoDataTypes.h"
9 #include "GeoDataAbstractView.h"
10 
11 namespace Marble {
12 
13 class GeoDataAnimatedUpdatePrivate
14 {
15 public:
16  double m_duration;
17  double m_delayedStart;
18  GeoDataUpdate* m_update;
19  GeoDataAnimatedUpdatePrivate();
20 };
21 
22 GeoDataAnimatedUpdatePrivate::GeoDataAnimatedUpdatePrivate() :
23  m_duration( 0.0 ), m_delayedStart( 0 ), m_update( nullptr )
24 {
25 
26 }
27 
28 GeoDataAnimatedUpdate::GeoDataAnimatedUpdate() : d( new GeoDataAnimatedUpdatePrivate )
29 {
30 
31 }
32 
33 GeoDataAnimatedUpdate::GeoDataAnimatedUpdate( const Marble::GeoDataAnimatedUpdate &other ) :
34  GeoDataTourPrimitive( other ), d( new GeoDataAnimatedUpdatePrivate( *other.d ) )
35 {
36 
37 }
38 
39 GeoDataAnimatedUpdate &GeoDataAnimatedUpdate::operator=( const GeoDataAnimatedUpdate &other )
40 {
41  GeoDataTourPrimitive::operator=( other );
42  *d = *other.d;
43  return *this;
44 }
45 
46 bool 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 
56 bool GeoDataAnimatedUpdate::operator!=(const GeoDataAnimatedUpdate& other) const
57 {
58  return !this->operator==(other);
59 }
60 
61 GeoDataAnimatedUpdate::~GeoDataAnimatedUpdate()
62 {
63  delete d;
64 }
65 
66 const char *GeoDataAnimatedUpdate::nodeType() const
67 {
68  return GeoDataTypes::GeoDataAnimatedUpdateType;
69 }
70 
71 const GeoDataUpdate* GeoDataAnimatedUpdate::update() const
72 {
73  return d->m_update;
74 }
75 
76 GeoDataUpdate* GeoDataAnimatedUpdate::update()
77 {
78  return d->m_update;
79 }
80 
81 void 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 
90 double GeoDataAnimatedUpdate::duration() const
91 {
92  return d->m_duration;
93 }
94 
95 void GeoDataAnimatedUpdate::setDuration( double duration )
96 {
97  d->m_duration = duration;
98 }
99 
100 double GeoDataAnimatedUpdate::delayedStart() const
101 {
102  return d->m_delayedStart;
103 }
104 
105 void GeoDataAnimatedUpdate::setDelayedStart( double delayedStart )
106 {
107  d->m_delayedStart = delayedStart;
108 }
109 
110 }
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
void update(Part *part, const QByteArray &data, qint64 dataSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Oct 4 2023 04:09:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.