Marble

KmlAnimatedUpdateTagWriter.cpp
1 
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3 //
4 // SPDX-FileCopyrightText: 2014 Sanjiban Bairagya <[email protected]>
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 
16 namespace Marble
17 {
18 
19 static GeoTagWriterRegistrar s_writerAnimatedUpdate( GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataAnimatedUpdateType,
20  kml::kmlTag_nameSpaceOgc22 ), new KmlAnimatedUpdateTagWriter );
21 
22 bool 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.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
void update(Part *part, const QByteArray &data, qint64 dataSize)
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.