Marble

KmlLabelStyleTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2015 Constantin Mihalache <[email protected]>
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 
13 namespace Marble
14 {
15 
16 static GeoTagWriterRegistrar s_writerLineStyle(
17  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLabelStyleType,
18  kml::kmlTag_nameSpaceOgc22),
19  new KmlLabelStyleTagWriter );
20 
21 KmlLabelStyleTagWriter::KmlLabelStyleTagWriter() : KmlColorStyleTagWriter( kml::kmlTag_LabelStyle )
22 {
23  //nothing to do here
24 }
25 
26 bool 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 
35 bool 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 
42 QColor KmlLabelStyleTagWriter::defaultColor() const
43 {
44  return QColor( Qt::black );
45 }
46 
47 }
QString number(int n, int base)
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.