Marble

DgmlBlendingTagHandler.cpp
1// SPDX-FileCopyrightText: 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#include "DgmlBlendingTagHandler.h"
6
7#include "DgmlAttributeDictionary.h"
8#include "DgmlElementDictionary.h"
9#include "GeoParser.h"
10#include "GeoSceneTileDataset.h"
11#include "MarbleDebug.h"
12
13namespace Marble
14{
15namespace dgml
16{
17static GeoTagHandlerRegistrar registrar(GeoParser::QualifiedName(QString::fromLatin1(dgmlTag_Blending), QString::fromLatin1(dgmlTag_nameSpace20)),
18 new DgmlBlendingTagHandler);
19
20GeoNode *DgmlBlendingTagHandler::parse(GeoParser &parser) const
21{
22 // Check whether the tag is valid
23 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(dgmlTag_Blending)));
24
25 // Checking for parent item
26 GeoStackItem parentItem = parser.parentElement();
27 if (!parentItem.represents(dgmlTag_Texture) && !parentItem.represents(dgmlTag_Vectortile))
28 return nullptr;
29
30 // Attribute name, default to ""
31 const QString name = parser.attribute(dgmlAttr_name).trimmed();
32 mDebug() << name;
33 parentItem.nodeAs<GeoSceneTileDataset>()->setBlending(name);
34 return nullptr;
35}
36
37}
38}
QString name(GameStandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.