Marble

GeoDataTourPrimitive.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2017 Bernhard Beschow <[email protected]>
4 //
5 
6 #include "GeoDataTourPrimitive.h"
7 
8 #include "GeoDataAnimatedUpdate.h"
9 #include "GeoDataFlyTo.h"
10 #include "GeoDataSoundCue.h"
11 #include "GeoDataTourControl.h"
12 #include "GeoDataWait.h"
13 #include "GeoDataTypes.h"
14 
15 namespace Marble {
16 
17 bool GeoDataTourPrimitive::operator==(const GeoDataTourPrimitive &other) const
18 {
19  if (nodeType() != other.nodeType()) {
20  return false;
21  }
22 
23  if (nodeType() == GeoDataTypes::GeoDataAnimatedUpdateType) {
24  const GeoDataAnimatedUpdate &thisUpdate = static_cast<const GeoDataAnimatedUpdate &>(*this);
25  const GeoDataAnimatedUpdate &otherUpdate = static_cast<const GeoDataAnimatedUpdate &>(other);
26 
27  return thisUpdate == otherUpdate;
28  }
29  else if (nodeType() == GeoDataTypes::GeoDataFlyToType) {
30  const GeoDataFlyTo &thisFlyTo = static_cast<const GeoDataFlyTo &>(*this);
31  const GeoDataFlyTo &otherFlyTo = static_cast<const GeoDataFlyTo &>(other);
32 
33  return thisFlyTo == otherFlyTo;
34  }
35  else if (nodeType() == GeoDataTypes::GeoDataSoundCueType) {
36  const GeoDataSoundCue &thisCue = static_cast<const GeoDataSoundCue &>(*this);
37  const GeoDataSoundCue &otherCue = static_cast<const GeoDataSoundCue &>(other);
38 
39  return thisCue == otherCue;
40  }
41  else if (nodeType() == GeoDataTypes::GeoDataTourControlType) {
42  const GeoDataTourControl &thisControl = static_cast<const GeoDataTourControl &>(*this);
43  const GeoDataTourControl &otherControl = static_cast<const GeoDataTourControl &>(other);
44 
45  return thisControl == otherControl;
46  }
47  else if (nodeType() == GeoDataTypes::GeoDataWaitType) {
48  const GeoDataWait &thisWait = static_cast<const GeoDataWait &>(*this);
49  const GeoDataWait &otherWait = static_cast<const GeoDataWait &>(other);
50 
51  return thisWait == otherWait;
52  }
53 
54  return false;
55 }
56 
57 } // namespace Marble
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 Thu Sep 21 2023 04:12:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.