Marble

GeoDataFlyTo.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4//
5
6#include "GeoDataFlyTo.h"
7#include "GeoDataAbstractView.h"
8#include "GeoDataTypes.h"
9
10namespace Marble
11{
12
13class GeoDataFlyToPrivate
14{
15public:
16 double m_duration;
17
18 GeoDataFlyTo::FlyToMode m_flyToMode;
19
20 GeoDataAbstractView *m_view;
21
22 GeoDataFlyToPrivate();
23};
24
25GeoDataFlyToPrivate::GeoDataFlyToPrivate()
26 : m_duration(0.0)
27 , m_flyToMode()
28 , m_view(nullptr)
29{
30}
31
32GeoDataFlyTo::GeoDataFlyTo()
33 : d(new GeoDataFlyToPrivate)
34{
35}
36
37GeoDataFlyTo::GeoDataFlyTo(const Marble::GeoDataFlyTo &other)
38 : GeoDataTourPrimitive(other)
39 , d(new GeoDataFlyToPrivate(*other.d))
40{
41}
42
43GeoDataFlyTo &GeoDataFlyTo::operator=(const GeoDataFlyTo &other)
44{
45 GeoDataTourPrimitive::operator=(other);
46 *d = *other.d;
47 return *this;
48}
49
50bool GeoDataFlyTo::operator==(const GeoDataFlyTo &other) const
51{
52 if (!equals(other) || d->m_duration != other.d->m_duration || d->m_flyToMode != other.d->m_flyToMode) {
53 return false;
54 }
55
56 if ((!d->m_view && other.d->m_view) || (d->m_view && !other.d->m_view)) {
57 return false;
58 } else if (!d->m_view && !other.d->m_view) {
59 return true;
60 }
61
62 if (*d->m_view != *other.d->m_view) {
63 return false;
64 }
65
66 return true;
67}
68
69bool GeoDataFlyTo::operator!=(const GeoDataFlyTo &other) const
70{
71 return !this->operator==(other);
72}
73
74GeoDataFlyTo::~GeoDataFlyTo()
75{
76 delete d;
77}
78
79const char *GeoDataFlyTo::nodeType() const
80{
81 return GeoDataTypes::GeoDataFlyToType;
82}
83
84const GeoDataAbstractView *GeoDataFlyTo::view() const
85{
86 return d->m_view;
87}
88
89GeoDataAbstractView *GeoDataFlyTo::view()
90{
91 return d->m_view;
92}
93
94void GeoDataFlyTo::setView(GeoDataAbstractView *view)
95{
96 d->m_view = view;
97}
98
99double GeoDataFlyTo::duration() const
100{
101 return d->m_duration;
102}
103
104void GeoDataFlyTo::setDuration(double duration)
105{
106 d->m_duration = duration;
107}
108
109GeoDataFlyTo::FlyToMode GeoDataFlyTo::flyToMode() const
110{
111 return d->m_flyToMode;
112}
113
114void GeoDataFlyTo::setFlyToMode(const GeoDataFlyTo::FlyToMode flyToMode)
115{
116 d->m_flyToMode = flyToMode;
117}
118
119}
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)
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 Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.