Marble

KmlGxTimeStampTagHandler.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Mayank Madan <[email protected]>
4 //
5 
6 #include "KmlGxTimeStampTagHandler.h"
7 
8 #include "MarbleDebug.h"
9 
10 #include "KmlElementDictionary.h"
11 #include "KmlObjectTagHandler.h"
12 #include "GeoDataTimeStamp.h"
13 #include "GeoDataFeature.h"
14 #include "GeoParser.h"
15 #include <GeoDataAbstractView.h>
16 #include "KmlTimeStampTagHandler.h"
17 
18 namespace Marble
19 {
20 namespace kml
21 {
22 namespace gx
23 {
24 KML_DEFINE_TAG_HANDLER_GX22( TimeStamp )
25 
26 GeoNode* KmlTimeStampTagHandler::parse( GeoParser& parser ) const
27 {
28  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_TimeStamp)));
29  GeoStackItem parentItem = parser.parentElement();
30  GeoDataTimeStamp timestamp;
31  KmlObjectTagHandler::parseIdentifiers( parser, &timestamp );
32  if ( parentItem.is<GeoDataFeature>() ) {
33  parentItem.nodeAs<GeoDataFeature>()->setTimeStamp( timestamp );
34  return &parentItem.nodeAs<GeoDataFeature>()->timeStamp();
35  } else if ( parentItem.is<GeoDataAbstractView>() ) {
36  parentItem.nodeAs<GeoDataAbstractView>()->setTimeStamp( timestamp );
37  return &parentItem.nodeAs<GeoDataAbstractView>()->timeStamp();
38  }
39  return nullptr;
40 }
41 
42 }
43 }
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 Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.