Marble

KmlTimeSpanWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Shou Ya <[email protected]>
4 //
5 
6 #include "KmlTimeSpanWriter.h"
7 
8 #include "GeoDataTimeSpan.h"
9 #include "GeoDataTypes.h"
10 #include "GeoWriter.h"
11 #include "KmlElementDictionary.h"
12 #include "KmlTimeStampTagWriter.h"
13 #include "KmlObjectTagWriter.h"
14 
15 namespace Marble
16 {
17 
18 static GeoTagWriterRegistrar s_writerLookAt(
19  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataTimeSpanType,
20  kml::kmlTag_nameSpaceOgc22 ),
21  new KmlTimeSpanWriter );
22 
23 bool KmlTimeSpanWriter::write( const GeoNode *node,
24  GeoWriter& writer ) const
25 {
26  Q_ASSERT(dynamic_cast<const GeoDataTimeSpan *>(node));
27  const GeoDataTimeSpan *timespan = static_cast<const GeoDataTimeSpan *>(node);
28 
29  writer.writeStartElement( kml::kmlTag_TimeSpan );
30  KmlObjectTagWriter::writeIdentifiers( writer, timespan );
31 
32  writer.writeTextElement( "begin", KmlTimeStampTagWriter::toString( timespan->begin() ) );
33  writer.writeTextElement( "end", KmlTimeStampTagWriter::toString( timespan->end() ) );
34 
35  writer.writeEndElement();
36 
37  return true;
38 }
39 
40 }
41 
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 Mon Sep 25 2023 03:50:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.