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(
17 GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLabelStyleType,
18 kml::kmlTag_nameSpaceOgc22),
19 new KmlLabelStyleTagWriter );
20
21KmlLabelStyleTagWriter::KmlLabelStyleTagWriter() : KmlColorStyleTagWriter( kml::kmlTag_LabelStyle )
22{
23 //nothing to do here
24}
25
26bool KmlLabelStyleTagWriter::writeMid( const GeoNode *node, GeoWriter &writer ) const
27{
28 const GeoDataLabelStyle *style = static_cast<const GeoDataLabelStyle*>( node );
29
30 writer.writeElement( kml::kmlTag_scale, QString::number(style->scale()));
31
32 return true;
33}
34
35bool KmlLabelStyleTagWriter::isEmpty(const GeoNode *node) const
36{
37 const GeoDataLabelStyle *style = static_cast<const GeoDataLabelStyle*>( node );
38
39 return style->scale() == 1.0;
40}
41
42QColor KmlLabelStyleTagWriter::defaultColor() const
43{
44 return QColor( 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 number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.