File indexing completed on 2024-05-12 03:50:18

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2017 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0004 //
0005 
0006 #include "GeoDataTourPrimitive.h"
0007 
0008 #include "GeoDataAnimatedUpdate.h"
0009 #include "GeoDataFlyTo.h"
0010 #include "GeoDataSoundCue.h"
0011 #include "GeoDataTourControl.h"
0012 #include "GeoDataWait.h"
0013 #include "GeoDataTypes.h"
0014 
0015 namespace Marble {
0016 
0017 bool GeoDataTourPrimitive::operator==(const GeoDataTourPrimitive &other) const
0018 {
0019     if (nodeType() != other.nodeType()) {
0020         return false;
0021     }
0022 
0023     if (nodeType() ==  GeoDataTypes::GeoDataAnimatedUpdateType) {
0024         const GeoDataAnimatedUpdate &thisUpdate = static_cast<const GeoDataAnimatedUpdate &>(*this);
0025         const GeoDataAnimatedUpdate &otherUpdate = static_cast<const GeoDataAnimatedUpdate &>(other);
0026 
0027         return thisUpdate == otherUpdate;
0028     }
0029     else if (nodeType() == GeoDataTypes::GeoDataFlyToType) {
0030         const GeoDataFlyTo &thisFlyTo = static_cast<const GeoDataFlyTo &>(*this);
0031         const GeoDataFlyTo &otherFlyTo = static_cast<const GeoDataFlyTo &>(other);
0032 
0033         return thisFlyTo == otherFlyTo;
0034     }
0035     else if (nodeType() == GeoDataTypes::GeoDataSoundCueType) {
0036         const GeoDataSoundCue &thisCue = static_cast<const GeoDataSoundCue &>(*this);
0037         const GeoDataSoundCue &otherCue = static_cast<const GeoDataSoundCue &>(other);
0038 
0039         return thisCue == otherCue;
0040     }
0041     else if (nodeType() == GeoDataTypes::GeoDataTourControlType) {
0042         const GeoDataTourControl &thisControl = static_cast<const GeoDataTourControl &>(*this);
0043         const GeoDataTourControl &otherControl = static_cast<const GeoDataTourControl &>(other);
0044 
0045         return thisControl == otherControl;
0046     }
0047     else if (nodeType() == GeoDataTypes::GeoDataWaitType) {
0048         const GeoDataWait &thisWait = static_cast<const GeoDataWait &>(*this);
0049         const GeoDataWait &otherWait = static_cast<const GeoDataWait &>(other);
0050 
0051         return thisWait == otherWait;
0052     }
0053 
0054     return false;
0055 }
0056 
0057 } // namespace Marble