• 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
  • writers
  • kml
KmlFlyToTagWriter.cpp
Go to the documentation of this file.
1 
2 //
3 // This file is part of the Marble Virtual Globe.
4 //
5 // This program is free software licensed under the GNU LGPL. You can
6 // find a copy of this license in LICENSE.txt in the top directory of
7 // the source code.
8 //
9 // Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
10 //
11 
12 #include "KmlFlyToTagWriter.h"
13 
14 #include "GeoDataFlyTo.h"
15 #include "GeoDataTypes.h"
16 #include "GeoDataAbstractView.h"
17 #include "GeoDataLookAt.h"
18 #include "GeoDataCamera.h"
19 #include "GeoWriter.h"
20 #include "KmlElementDictionary.h"
21 
22 namespace Marble
23 {
24 
25 static GeoTagWriterRegistrar s_writerFlyTo(
26  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataFlyToType,
27  kml::kmlTag_nameSpaceOgc22 ),
28  new KmlFlyToTagWriter );
29 
30 bool KmlFlyToTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
31 {
32  const GeoDataFlyTo *flyTo = static_cast<const GeoDataFlyTo*>( node );
33  writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_FlyTo );
34  writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_duration, QString::number( flyTo->duration()) );
35  if ( flyTo->flyToMode() == GeoDataFlyTo::Smooth ) {
36  // two values, smooth and bounce, bounce is default and can hence be omitted
37  writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_flyToMode, "smooth" );
38  }
39  if ( flyTo->view() ) {
40  GeoDataLookAt const * lookAt = dynamic_cast<const GeoDataLookAt*>( flyTo->view() );
41  if ( lookAt ) {
42  writeElement( lookAt, writer );
43  }
44  GeoDataCamera const * camera = dynamic_cast<const GeoDataCamera*>( flyTo->view() );
45  if ( camera ) {
46  writeElement( camera, writer );
47  }
48  }
49  writer.writeEndElement();
50  return true;
51 }
52 
53 }
Marble::kml::kmlTag_nameSpaceGx22
const char * kmlTag_nameSpaceGx22
Definition: KmlElementDictionary.cpp:35
GeoDataAbstractView.h
KmlFlyToTagWriter.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::kml::kmlTag_flyToMode
const char * kmlTag_flyToMode
Definition: KmlElementDictionary.cpp:71
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
Marble::kml::kmlTag_FlyTo
const char * kmlTag_FlyTo
Definition: KmlElementDictionary.cpp:207
Marble::GeoWriter::writeElement
void writeElement(const QString &namespaceUri, const QString &key, const QString &value)
Convenience method to write value with key prefixed format namespaceUri.
Definition: GeoWriter.cpp:84
GeoWriter.h
GeoDataCamera.h
QString::number
QString number(int n, int base)
GeoDataLookAt.h
KmlElementDictionary.h
Marble::GeoDataFlyTo
Definition: GeoDataFlyTo.h:23
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:29
Marble::GeoDataTypes::GeoDataFlyToType
const char * GeoDataFlyToType
Definition: GeoDataTypes.cpp:41
Marble::GeoTagWriter::QualifiedName
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:48
Marble::GeoDataFlyTo::Smooth
Definition: GeoDataFlyTo.h:28
Marble::GeoDataFlyTo::flyToMode
FlyToMode flyToMode() const
Definition: GeoDataFlyTo.cpp:135
Marble::kml::kmlTag_nameSpaceOgc22
const char * kmlTag_nameSpaceOgc22
Definition: KmlElementDictionary.cpp:34
Marble::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::kml::kmlTag_duration
const char * kmlTag_duration
Definition: KmlElementDictionary.cpp:63
Marble::GeoDataFlyTo::duration
double duration() const
Definition: GeoDataFlyTo.cpp:125
GeoDataFlyTo.h
GeoDataTypes.h
Marble::KmlFlyToTagWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const
Definition: KmlFlyToTagWriter.cpp:30
Marble::s_writerFlyTo
static GeoTagWriterRegistrar s_writerFlyTo(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataFlyToType, kml::kmlTag_nameSpaceOgc22), new KmlFlyToTagWriter)
Marble::GeoDataFlyTo::view
const GeoDataAbstractView * view() const
Definition: GeoDataFlyTo.cpp:110
QXmlStreamWriter::writeEndElement
void writeEndElement()
QXmlStreamWriter::writeStartElement
void writeStartElement(const QString &qualifiedName)
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