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