Marble

KmlTiltTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4//
5
6#include "KmlTiltTagHandler.h"
7
8#include "MarbleDebug.h"
9
10#include "KmlElementDictionary.h"
11#include "GeoDataCamera.h"
12#include "GeoParser.h"
13#include "GeoDataOrientation.h"
14
15
16namespace Marble
17{
18namespace kml
19{
20KML_DEFINE_TAG_HANDLER( tilt )
21
22GeoNode* KmltiltTagHandler::parse( GeoParser& parser ) const
23{
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_tilt)));
25
26 GeoStackItem parentItem = parser.parentElement();
27
28 if ( parentItem.is<GeoDataCamera>() ){
29 qreal tilt = parser.readElementText().trimmed().toDouble();
30 parentItem.nodeAs<GeoDataCamera>()->setTilt(tilt);
31 } else if ( parentItem.is<GeoDataOrientation>() ){
32 double tilt = parser.readElementText().trimmed().toDouble();
33 parentItem.nodeAs<GeoDataOrientation>()->setTilt(tilt);
34 }
35 return nullptr;
36}
37
38}
39}
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 Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.