• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • handlers
  • kml
KmlDurationTagHandler.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
9 //
10 #include "KmlDurationTagHandler.h"
11 
12 #include "MarbleDebug.h"
13 
14 #include "KmlElementDictionary.h"
15 
16 #include "MarbleGlobal.h"
17 #include "GeoDataFlyTo.h"
18 #include "GeoDataWait.h"
19 #include "GeoDataAnimatedUpdate.h"
20 #include "GeoParser.h"
21 
22 
23 namespace Marble
24 {
25 namespace kml
26 {
27 
28 KML_DEFINE_TAG_HANDLER_GX22( duration )
29 
30 GeoNode *KmldurationTagHandler::parse(GeoParser & parser) const
31 {
32  Q_ASSERT ( parser.isStartElement()
33  && parser.isValidElement( kmlTag_duration ) );
34 
35  GeoStackItem parentItem = parser.parentElement();
36 
37  qreal const duration = parser.readElementText().trimmed().toDouble();
38  if ( parentItem.is<GeoDataFlyTo>() ){
39  parentItem.nodeAs<GeoDataFlyTo>()->setDuration( duration );
40  }
41  if ( parentItem.is<GeoDataWait>() ){
42  parentItem.nodeAs<GeoDataWait>()->setDuration( duration );
43  }
44  if ( parentItem.is<GeoDataAnimatedUpdate>() ){
45  parentItem.nodeAs<GeoDataAnimatedUpdate>()->setDuration( duration );
46  }
47  return 0;
48 }
49 
50 }
51 }
Marble::GeoStackItem::nodeAs
T * nodeAs()
Definition: GeoParser.h:120
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
GeoDataWait.h
KmlDurationTagHandler.h
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::kml::KmldurationTagHandler
Definition: KmlDurationTagHandler.h:20
Marble::GeoDataWait
Definition: GeoDataWait.h:19
KmlElementDictionary.h
Marble::GeoDataFlyTo
Definition: GeoDataFlyTo.h:23
Marble::GeoDataAnimatedUpdate
Definition: GeoDataAnimatedUpdate.h:23
Marble::GeoStackItem
Definition: GeoParser.h:97
MarbleGlobal.h
GeoDataAnimatedUpdate.h
Marble::kml::kmlTag_duration
const char * kmlTag_duration
Definition: KmlElementDictionary.cpp:63
GeoDataFlyTo.h
KML_DEFINE_TAG_HANDLER_GX22
#define KML_DEFINE_TAG_HANDLER_GX22(Name)
Definition: KmlElementDictionary.h:240
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal