Marble

GeoDataFlyTo.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Mayank Madan <[email protected]>
4 //
5 
6 #include "GeoDataFlyTo.h"
7 #include "GeoDataTypes.h"
8 #include "GeoDataAbstractView.h"
9 
10 namespace Marble {
11 
12 class GeoDataFlyToPrivate
13 {
14 public:
15  double m_duration;
16 
17  GeoDataFlyTo::FlyToMode m_flyToMode;
18 
19  GeoDataAbstractView* m_view;
20 
21  GeoDataFlyToPrivate();
22 };
23 
24 GeoDataFlyToPrivate::GeoDataFlyToPrivate() :
25  m_duration( 0.0 ), m_flyToMode(), m_view( nullptr )
26 {
27 
28 }
29 
30 GeoDataFlyTo::GeoDataFlyTo() : d( new GeoDataFlyToPrivate )
31 {
32 
33 }
34 
35 GeoDataFlyTo::GeoDataFlyTo( const Marble::GeoDataFlyTo &other ) :
36  GeoDataTourPrimitive( other ), d( new GeoDataFlyToPrivate( *other.d ) )
37 {
38 
39 }
40 
41 GeoDataFlyTo &GeoDataFlyTo::operator=( const GeoDataFlyTo &other )
42 {
43  GeoDataTourPrimitive::operator=( other );
44  *d = *other.d;
45  return *this;
46 }
47 
48 bool 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 
70 bool GeoDataFlyTo::operator!=( const GeoDataFlyTo& other ) const
71 {
72  return !this->operator==(other);
73 }
74 
75 GeoDataFlyTo::~GeoDataFlyTo()
76 {
77  delete d;
78 }
79 
80 const char *GeoDataFlyTo::nodeType() const
81 {
82  return GeoDataTypes::GeoDataFlyToType;
83 }
84 
85 const GeoDataAbstractView *GeoDataFlyTo::view() const
86 {
87  return d->m_view;
88 }
89 
90 GeoDataAbstractView *GeoDataFlyTo::view()
91 {
92  return d->m_view;
93 }
94 
95 void GeoDataFlyTo::setView( GeoDataAbstractView *view )
96 {
97  d->m_view = view;
98 }
99 
100 double GeoDataFlyTo::duration() const
101 {
102  return d->m_duration;
103 }
104 
105 void GeoDataFlyTo::setDuration( double duration )
106 {
107  d->m_duration = duration;
108 }
109 
110 GeoDataFlyTo::FlyToMode GeoDataFlyTo::flyToMode() const
111 {
112  return d->m_flyToMode;
113 }
114 
115 void GeoDataFlyTo::setFlyToMode( const GeoDataFlyTo::FlyToMode flyToMode )
116 {
117  d->m_flyToMode = flyToMode;
118 }
119 
120 }
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.