Marble

KmlAnimatedUpdateTagWriter.cpp
1
2// SPDX-License-Identifier: LGPL-2.1-or-later
3//
4// SPDX-FileCopyrightText: 2014 Sanjiban Bairagya <sanjiban22393@gmail.com>
5//
6
7#include "KmlAnimatedUpdateTagWriter.h"
8
9#include "GeoDataAnimatedUpdate.h"
10#include "GeoDataTypes.h"
11#include "GeoDataUpdate.h"
12#include "GeoWriter.h"
13#include "KmlElementDictionary.h"
14#include "KmlObjectTagWriter.h"
15
16namespace Marble
17{
18
19static GeoTagWriterRegistrar s_writerAnimatedUpdate(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataAnimatedUpdateType),
20 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
21 new KmlAnimatedUpdateTagWriter);
22
23bool KmlAnimatedUpdateTagWriter::write(const GeoNode *node, GeoWriter &writer) const
24{
25 Q_ASSERT(dynamic_cast<const GeoDataAnimatedUpdate *>(node));
26 const auto animUpdate = static_cast<const GeoDataAnimatedUpdate *>(node);
27 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_nameSpaceGx22), QString::fromUtf8(kml::kmlTag_AnimatedUpdate));
28 KmlObjectTagWriter::writeIdentifiers(writer, animUpdate);
29 writer.writeOptionalElement(QStringLiteral("gx:duration"), animUpdate->duration(), 0.0);
30 if (animUpdate->update()) {
31 auto const *update = dynamic_cast<const GeoDataUpdate *>(animUpdate->update());
32 if (update) {
33 writeElement(update, writer);
34 }
35 }
36 writer.writeOptionalElement(QStringLiteral("gx:delayedStart"), animUpdate->delayedStart(), 0.0);
37 writer.writeEndElement();
38 return true;
39}
40
41}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
void update(Part *part, const QByteArray &data, qint64 dataSize)
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.