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( dgmlTag_Blending,
18 dgmlTag_nameSpace20 ),
19 new DgmlBlendingTagHandler );
20
21GeoNode* DgmlBlendingTagHandler::parse( GeoParser& parser ) const
22{
23 // Check whether the tag is valid
24 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(dgmlTag_Blending)));
25
26 // Checking for parent item
27 GeoStackItem parentItem = parser.parentElement();
28 if ( !parentItem.represents( dgmlTag_Texture ) && !parentItem.represents( dgmlTag_Vectortile ))
29 return nullptr;
30
31 // Attribute name, default to ""
32 const QString name = parser.attribute( dgmlAttr_name ).trimmed();
33 mDebug() << name;
34 parentItem.nodeAs<GeoSceneTileDataset>()->setBlending( name );
35 return nullptr;
36}
37
38
39}
40}
QString name(GameStandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:03:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.