Marble

KmlRollTagHandler.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Mayank Madan <[email protected]>
4 // SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <[email protected]>
5 //
6 
7 #include "KmlRollTagHandler.h"
8 
9 #include "KmlElementDictionary.h"
10 #include "GeoDataCamera.h"
11 #include "GeoParser.h"
12 #include "GeoDataOrientation.h"
13 
14 namespace Marble
15 {
16 namespace kml
17 {
18 KML_DEFINE_TAG_HANDLER( roll )
19 
20 GeoNode* KmlrollTagHandler::parse( GeoParser& parser ) const
21 {
22  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_roll)));
23 
24  GeoStackItem parentItem = parser.parentElement();
25 
26  if ( parentItem.is<GeoDataCamera>() ) {
27  qreal roll = parser.readElementText().trimmed().toDouble();
28  parentItem.nodeAs<GeoDataCamera>()->setRoll(roll);
29  } else if (parentItem.is<GeoDataOrientation>() ) {
30  qreal roll = parser.readElementText().trimmed().toDouble();
31  parentItem.nodeAs<GeoDataOrientation>()->setRoll(roll);
32  }
33  return nullptr;
34 }
35 
36 }
37 }
QAction * roll(const QObject *recvr, const char *slot, QObject *parent)
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.