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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • writers
  • kml
KmlGroundOverlayWriter.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 2012 Shou Ya <shouyatf@gmail.com>
9 // Copyright 2012 Dennis Nienhüser <earthwings@gentoo.org>
10 //
11 
12 #include "KmlGroundOverlayWriter.h"
13 
14 #include "GeoDataGroundOverlay.h"
15 #include "GeoDataTypes.h"
16 #include "GeoWriter.h"
17 #include "KmlElementDictionary.h"
18 
19 namespace Marble
20 {
21 
22 static GeoTagWriterRegistrar s_writerLookAt(
23  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataGroundOverlayType,
24  kml::kmlTag_nameSpace22 ),
25  new KmlGroundOverlayWriter );
26 
27 KmlGroundOverlayWriter::KmlGroundOverlayWriter() : KmlOverlayTagWriter( kml::kmlTag_GroundOverlay )
28 {
29  // nothing to do
30 }
31 
32 bool KmlGroundOverlayWriter::writeMid(const GeoNode *node, GeoWriter &writer) const
33 {
34  const GeoDataGroundOverlay *ground_overlay =
35  static_cast<const GeoDataGroundOverlay*>( node );
36 
37  writer.writeTextElement( kml::kmlTag_altitude,
38  QString::number(ground_overlay->altitude()) );
39  writer.writeTextElement( kml::kmlTag_altitudeMode,
40  altitudeModeToString(ground_overlay->altitudeMode()) );
41 
42  if ( !ground_overlay->latLonBox().isEmpty() ) {
43  writeElement( &ground_overlay->latLonBox(), writer );
44  }
45 
46  if ( ground_overlay->latLonQuad().isValid() ) {
47  writeElement( &ground_overlay->latLonQuad(), writer );
48  }
49 
50  return true;
51 }
52 
53 QString KmlGroundOverlayWriter::altitudeModeToString(AltitudeMode mode)
54 {
55  switch (mode) {
56  case ClampToGround:
57  return "clampToGround";
58  case RelativeToGround:
59  return "relativeToGround";
60  case Absolute:
61  return "absolute";
62  }
63  return "";
64 }
65 
66 }
67 
Marble::s_writerLookAt
static GeoTagWriterRegistrar s_writerLookAt(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataGroundOverlayType, kml::kmlTag_nameSpace22), new KmlGroundOverlayWriter)
Marble::GeoDataGroundOverlay::altitudeMode
AltitudeMode altitudeMode() const
Definition: GeoDataGroundOverlay.cpp:73
Marble::GeoDataLatLonBox::isEmpty
virtual bool isEmpty() const
Indicates whether the bounding box is not initialised (and contains nothing).
Definition: GeoDataLatLonBox.cpp:768
Marble::Absolute
Altitude is given relative to the sealevel.
Definition: MarbleGlobal.h:148
GeoDataGroundOverlay.h
Marble::KmlGroundOverlayWriter::writeMid
bool writeMid(const GeoNode *node, GeoWriter &writer) const
Definition: KmlGroundOverlayWriter.cpp:32
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::KmlGroundOverlayWriter::altitudeModeToString
static QString altitudeModeToString(AltitudeMode mode)
Definition: KmlGroundOverlayWriter.cpp:53
Marble::kml::kmlTag_altitudeMode
const char * kmlTag_altitudeMode
Definition: KmlElementDictionary.cpp:41
Marble::GeoDataLatLonQuad::isValid
bool isValid() const
Definition: GeoDataLatLonQuad.cpp:181
Marble::KmlOverlayTagWriter
Definition: KmlOverlayTagWriter.h:22
Marble::GeoDataTypes::GeoDataGroundOverlayType
const char * GeoDataGroundOverlayType
Definition: GeoDataTypes.cpp:40
KmlGroundOverlayWriter.h
Marble::kml::kmlTag_nameSpace22
const char * kmlTag_nameSpace22
Definition: KmlElementDictionary.cpp:33
Marble::GeoDataGroundOverlay::latLonBox
GeoDataLatLonBox & latLonBox() const
Definition: GeoDataGroundOverlay.cpp:83
GeoWriter.h
Marble::RelativeToGround
Altitude is always given relative to ground level.
Definition: MarbleGlobal.h:147
KmlElementDictionary.h
Marble::AltitudeMode
AltitudeMode
Definition: MarbleGlobal.h:145
Marble::KmlGroundOverlayWriter::KmlGroundOverlayWriter
KmlGroundOverlayWriter()
Definition: KmlGroundOverlayWriter.cpp:27
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:28
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::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
Marble::GeoDataGroundOverlay::latLonQuad
const GeoDataLatLonQuad & latLonQuad() const
Definition: GeoDataGroundOverlay.cpp:98
Marble::ClampToGround
Altitude always sticks to ground level.
Definition: MarbleGlobal.h:146
Marble::GeoDataGroundOverlay
Definition: GeoDataGroundOverlay.h:24
Marble::kml::kmlTag_altitude
const char * kmlTag_altitude
Definition: KmlElementDictionary.cpp:40
GeoDataTypes.h
Marble::kml::kmlTag_GroundOverlay
const char * kmlTag_GroundOverlay
Definition: KmlElementDictionary.cpp:79
Marble::GeoDataGroundOverlay::altitude
double altitude() const
Definition: GeoDataGroundOverlay.cpp:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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