• 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
KmlLatLonQuadWriter.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 
11 #include "KmlLatLonQuadWriter.h"
12 
13 #include "GeoDataLatLonQuad.h"
14 #include "GeoDataTypes.h"
15 #include "GeoWriter.h"
16 #include "KmlElementDictionary.h"
17 
18 namespace Marble
19 {
20 
21 static GeoTagWriterRegistrar s_writerLatLonQuad(
22  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLatLonQuadType,
23  kml::kmlTag_nameSpace22 ),
24  new KmlLatLonQuadWriter );
25 
26 bool KmlLatLonQuadWriter::write( const GeoNode *node,
27  GeoWriter& writer ) const
28 {
29  const GeoDataLatLonQuad *latLonQuad = static_cast<const GeoDataLatLonQuad*>( node );
30 
31  if ( latLonQuad->isValid() ) {
32  writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_LatLonQuad );
33 
34  writer.writeStartElement( kml::kmlTag_coordinates );
35 
36  writer.writeCharacters( QString::number( latLonQuad->bottomLeftLongitude( GeoDataCoordinates::Degree ) ) );
37  writer.writeCharacters( QString( ',' ) );
38  writer.writeCharacters( QString::number( latLonQuad->bottomLeftLatitude( GeoDataCoordinates::Degree ) ) );
39  writer.writeCharacters( QString( ' ' ) );
40 
41  writer.writeCharacters( QString::number( latLonQuad->bottomRightLongitude( GeoDataCoordinates::Degree ) ) );
42  writer.writeCharacters( QString( ',' ) );
43  writer.writeCharacters( QString::number( latLonQuad->bottomRightLatitude( GeoDataCoordinates::Degree ) ) );
44  writer.writeCharacters( QString( ' ' ) );
45 
46  writer.writeCharacters( QString::number( latLonQuad->topRightLongitude( GeoDataCoordinates::Degree ) ) );
47  writer.writeCharacters( QString( ',' ) );
48  writer.writeCharacters( QString::number( latLonQuad->topRightLatitude( GeoDataCoordinates::Degree ) ) );
49  writer.writeCharacters( QString( ' ' ) );
50 
51  writer.writeCharacters( QString::number( latLonQuad->topLeftLongitude( GeoDataCoordinates::Degree ) ) );
52  writer.writeCharacters( QString( ',' ) );
53  writer.writeCharacters( QString::number( latLonQuad->topLeftLatitude( GeoDataCoordinates::Degree ) ) );
54 
55  writer.writeEndElement();
56 
57  writer.writeEndElement();
58  }
59 
60  return true;
61 }
62 
63 }
Marble::kml::kmlTag_nameSpaceGx22
const char * kmlTag_nameSpaceGx22
Definition: KmlElementDictionary.cpp:35
GeoDataLatLonQuad.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::GeoDataLatLonQuad::isValid
bool isValid() const
Definition: GeoDataLatLonQuad.cpp:181
Marble::GeoDataLatLonQuad::bottomLeftLatitude
qreal bottomLeftLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:61
Marble::kml::kmlTag_nameSpace22
const char * kmlTag_nameSpace22
Definition: KmlElementDictionary.cpp:33
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
GeoWriter.h
Marble::kml::kmlTag_coordinates
const char * kmlTag_coordinates
Definition: KmlElementDictionary.cpp:54
Marble::GeoDataLatLonQuad
Definition: GeoDataLatLonQuad.h:22
Marble::s_writerLatLonQuad
static GeoTagWriterRegistrar s_writerLatLonQuad(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataLatLonQuadType, kml::kmlTag_nameSpace22), new KmlLatLonQuadWriter)
Marble::GeoDataLatLonQuad::topRightLatitude
qreal topRightLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:101
KmlElementDictionary.h
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::kml::kmlTag_LatLonQuad
const char * kmlTag_LatLonQuad
Definition: KmlElementDictionary.cpp:97
KmlLatLonQuadWriter.h
Marble::GeoDataTypes::GeoDataLatLonQuadType
const char * GeoDataLatLonQuadType
Definition: GeoDataTypes.cpp:47
Marble::GeoDataLatLonQuad::topLeftLongitude
qreal topLeftLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:131
Marble::GeoDataLatLonQuad::topRightLongitude
qreal topRightLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:111
Marble::GeoDataLatLonQuad::bottomRightLatitude
qreal bottomRightLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:81
GeoDataTypes.h
Marble::GeoDataLatLonQuad::bottomLeftLongitude
qreal bottomLeftLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:71
Marble::GeoDataLatLonQuad::bottomRightLongitude
qreal bottomRightLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:91
Marble::KmlLatLonQuadWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const
Definition: KmlLatLonQuadWriter.cpp:26
Marble::GeoDataLatLonQuad::topLeftLatitude
qreal topLeftLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:121
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