Marble

GeoDataTourPrimitive.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2017 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
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 "GeoDataTypes.h"
13#include "GeoDataWait.h"
14
15namespace Marble
16{
17
18bool GeoDataTourPrimitive::operator==(const GeoDataTourPrimitive &other) const
19{
20 if (nodeType() != other.nodeType()) {
21 return false;
22 }
23
24 if (nodeType() == GeoDataTypes::GeoDataAnimatedUpdateType) {
25 const auto &thisUpdate = static_cast<const GeoDataAnimatedUpdate &>(*this);
26 const auto &otherUpdate = static_cast<const GeoDataAnimatedUpdate &>(other);
27
28 return thisUpdate == otherUpdate;
29 } else if (nodeType() == GeoDataTypes::GeoDataFlyToType) {
30 const auto &thisFlyTo = static_cast<const GeoDataFlyTo &>(*this);
31 const auto &otherFlyTo = static_cast<const GeoDataFlyTo &>(other);
32
33 return thisFlyTo == otherFlyTo;
34 } else if (nodeType() == GeoDataTypes::GeoDataSoundCueType) {
35 const auto &thisCue = static_cast<const GeoDataSoundCue &>(*this);
36 const auto &otherCue = static_cast<const GeoDataSoundCue &>(other);
37
38 return thisCue == otherCue;
39 } else if (nodeType() == GeoDataTypes::GeoDataTourControlType) {
40 const auto &thisControl = static_cast<const GeoDataTourControl &>(*this);
41 const auto &otherControl = static_cast<const GeoDataTourControl &>(other);
42
43 return thisControl == otherControl;
44 } else if (nodeType() == GeoDataTypes::GeoDataWaitType) {
45 const auto &thisWait = static_cast<const GeoDataWait &>(*this);
46 const auto &otherWait = static_cast<const GeoDataWait &>(other);
47
48 return thisWait == otherWait;
49 }
50
51 return false;
52}
53
54} // namespace Marble
virtual const char * nodeType() const =0
Provides type information for downcasting a GeoNode.
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 Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.