Marble

KmlLabelStyleTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2015 Constantin Mihalache <mihalache.c94@gmail.com>
4
5#include "KmlLabelStyleTagWriter.h"
6
7#include "GeoDataLabelStyle.h"
8#include "GeoDataTypes.h"
9#include "GeoWriter.h"
10#include "KmlElementDictionary.h"
11#include <QDebug>
12
13namespace Marble
14{
15
16static GeoTagWriterRegistrar s_writerLineStyle(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataLabelStyleType),
17 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
18 new KmlLabelStyleTagWriter);
19
20KmlLabelStyleTagWriter::KmlLabelStyleTagWriter()
21 : KmlColorStyleTagWriter(QString::fromLatin1(kml::kmlTag_LabelStyle))
22{
23 // nothing to do here
24}
25
26bool KmlLabelStyleTagWriter::writeMid(const GeoNode *node, GeoWriter &writer) const
27{
28 const auto style = static_cast<const GeoDataLabelStyle *>(node);
29
30 writer.writeElement(QString::fromLatin1(kml::kmlTag_scale), QString::number(style->scale()));
31
32 return true;
33}
34
35bool KmlLabelStyleTagWriter::isEmpty(const GeoNode *node) const
36{
37 const auto style = static_cast<const GeoDataLabelStyle *>(node);
38
39 return style->scale() == 1.0;
40}
41
42QColor KmlLabelStyleTagWriter::defaultColor() const
43{
44 return {Qt::black};
45}
46
47}
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)
QString number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.