Marble

KmlCameraTagHandler.cpp
1
2// SPDX-License-Identifier: LGPL-2.1-or-later
3//
4// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
5//
6#include "KmlCameraTagHandler.h"
7
8#include "GeoDataCamera.h"
9#include "GeoDataFeature.h"
10#include "GeoDataFlyTo.h"
11#include "GeoParser.h"
12#include "KmlElementDictionary.h"
13#include "KmlObjectTagHandler.h"
14
15namespace Marble
16{
17namespace kml
18{
19
20KML_DEFINE_TAG_HANDLER(Camera)
21
22GeoNode *KmlCameraTagHandler::parse(GeoParser &parser) const
23{
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_Camera)));
25
26 GeoDataCamera *camera = nullptr;
27 GeoStackItem parentItem = parser.parentElement();
28
29 if (parentItem.is<GeoDataFeature>()) {
30 camera = new GeoDataCamera;
31 KmlObjectTagHandler::parseIdentifiers(parser, camera);
32 parentItem.nodeAs<GeoDataFeature>()->setAbstractView(camera);
33 }
34
35 if (parentItem.is<GeoDataFlyTo>()) {
36 camera = new GeoDataCamera;
37 KmlObjectTagHandler::parseIdentifiers(parser, camera);
38 parentItem.nodeAs<GeoDataFlyTo>()->setView(camera);
39 }
40
41 return camera;
42}
43
44}
45
46}
Q_SCRIPTABLE QString camera()
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.