Marble

DgmlVectorTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
4//
5
6#include "DgmlVectorTagWriter.h"
7
8#include "DgmlElementDictionary.h"
9#include "GeoSceneTypes.h"
10#include "GeoSceneVector.h"
11#include "GeoWriter.h"
12
13namespace Marble
14{
15
16static GeoTagWriterRegistrar s_writerVector(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoSceneTypes::GeoSceneVectorType),
17 QString::fromLatin1(dgml::dgmlTag_nameSpace20)),
18 new DgmlVectorTagWriter());
19
20bool DgmlVectorTagWriter::write(const GeoNode *node, GeoWriter &writer) const
21{
22 const auto vector = static_cast<const GeoSceneVector *>(node);
23 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_Vector));
24 writer.writeAttribute(QStringLiteral("name"), vector->name());
25 writer.writeAttribute("feature", vector->feature());
26
27 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_SourceFile));
28 writer.writeAttribute(QStringLiteral("format"), vector->fileFormat());
29 writer.writeCharacters(vector->sourceFile());
30 writer.writeEndElement();
31
32 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_Pen));
33 writer.writeAttribute(QStringLiteral("color"), vector->pen().color().name());
34 writer.writeEndElement();
35
36 writer.writeEndElement();
37 return true;
38}
39
40}
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 fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.