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( GeoDataTypes::GeoDataAnimatedUpdateType,
20 kml::kmlTag_nameSpaceOgc22 ), new KmlAnimatedUpdateTagWriter );
21
22bool KmlAnimatedUpdateTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
23{
24 Q_ASSERT(dynamic_cast<const GeoDataAnimatedUpdate *>(node));
25 const GeoDataAnimatedUpdate *animUpdate = static_cast<const GeoDataAnimatedUpdate*>( node );
26 writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_AnimatedUpdate );
27 KmlObjectTagWriter::writeIdentifiers( writer, animUpdate );
28 writer.writeOptionalElement( "gx:duration", animUpdate->duration(), 0.0 );
29 if ( animUpdate->update() ){
30 GeoDataUpdate const *update = dynamic_cast<const GeoDataUpdate*>( animUpdate->update() );
31 if( update ){
32 writeElement( update, writer );
33 }
34 }
35 writer.writeOptionalElement( "gx:delayedStart", animUpdate->delayedStart(), 0.0 );
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.
void update(Part *part, const QByteArray &data, qint64 dataSize)
Binds a QML item to a specific geodetic location in screen coordinates.
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.