Marble

KmlRollTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4// SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
5//
6
7#include "KmlRollTagHandler.h"
8
9#include "KmlElementDictionary.h"
10#include "GeoDataCamera.h"
11#include "GeoParser.h"
12#include "GeoDataOrientation.h"
13
14namespace Marble
15{
16namespace kml
17{
18KML_DEFINE_TAG_HANDLER( roll )
19
20GeoNode* 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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.