Marble

KmlPolyStyleTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Thibaut Gridel <tgridel@free.fr>
4
5#include "KmlPolyStyleTagWriter.h"
6
7#include "GeoDataPolyStyle.h"
8#include "GeoDataTypes.h"
9#include "GeoWriter.h"
10#include "KmlElementDictionary.h"
11
12namespace Marble
13{
14
15static GeoTagWriterRegistrar s_writerLineStyle(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataPolyStyleType),
16 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
17 new KmlPolyStyleTagWriter);
18
19KmlPolyStyleTagWriter::KmlPolyStyleTagWriter()
20 : KmlColorStyleTagWriter(QString::fromLatin1(kml::kmlTag_PolyStyle))
21{
22}
23
24bool KmlPolyStyleTagWriter::writeMid(const GeoNode *node, GeoWriter &writer) const
25{
26 const auto style = static_cast<const GeoDataPolyStyle *>(node);
27
28 if (!style->fill()) {
29 writer.writeElement(QStringLiteral("fill"), QStringLiteral("0"));
30 }
31 if (!style->outline()) {
32 writer.writeElement(QStringLiteral("outline"), QStringLiteral("0"));
33 }
34
35 return true;
36}
37
38bool KmlPolyStyleTagWriter::isEmpty(const GeoNode *node) const
39{
40 const auto style = static_cast<const GeoDataPolyStyle *>(node);
41 return style->fill() && style->outline();
42}
43
44}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
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.