• 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
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 #include "KmlObjectTagWriter.h"
18 
19 namespace Marble
20 {
21 
22 static GeoTagWriterRegistrar s_writerLatLonQuad(
23  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLatLonQuadType,
24  kml::kmlTag_nameSpaceOgc22 ),
25  new KmlLatLonQuadWriter );
26 
27 bool KmlLatLonQuadWriter::write( const GeoNode *node,
28  GeoWriter& writer ) const
29 {
30  const GeoDataLatLonQuad *latLonQuad = static_cast<const GeoDataLatLonQuad*>( node );
31 
32  if ( latLonQuad->isValid() ) {
33  writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_LatLonQuad );
34  KmlObjectTagWriter::writeIdentifiers( writer, latLonQuad );
35 
36  writer.writeStartElement( kml::kmlTag_coordinates );
37 
38  writer.writeCharacters( QString::number( latLonQuad->bottomLeftLongitude( GeoDataCoordinates::Degree ) ) );
39  writer.writeCharacters( QString( ',' ) );
40  writer.writeCharacters( QString::number( latLonQuad->bottomLeftLatitude( GeoDataCoordinates::Degree ) ) );
41  writer.writeCharacters( QString( ' ' ) );
42 
43  writer.writeCharacters( QString::number( latLonQuad->bottomRightLongitude( GeoDataCoordinates::Degree ) ) );
44  writer.writeCharacters( QString( ',' ) );
45  writer.writeCharacters( QString::number( latLonQuad->bottomRightLatitude( GeoDataCoordinates::Degree ) ) );
46  writer.writeCharacters( QString( ' ' ) );
47 
48  writer.writeCharacters( QString::number( latLonQuad->topRightLongitude( GeoDataCoordinates::Degree ) ) );
49  writer.writeCharacters( QString( ',' ) );
50  writer.writeCharacters( QString::number( latLonQuad->topRightLatitude( GeoDataCoordinates::Degree ) ) );
51  writer.writeCharacters( QString( ' ' ) );
52 
53  writer.writeCharacters( QString::number( latLonQuad->topLeftLongitude( GeoDataCoordinates::Degree ) ) );
54  writer.writeCharacters( QString( ',' ) );
55  writer.writeCharacters( QString::number( latLonQuad->topLeftLatitude( GeoDataCoordinates::Degree ) ) );
56 
57  writer.writeEndElement();
58 
59  writer.writeEndElement();
60  }
61 
62  return true;
63 }
64 
65 }
Marble::kml::kmlTag_nameSpaceGx22
const char * kmlTag_nameSpaceGx22
Definition: KmlElementDictionary.cpp:35
KmlObjectTagWriter.h
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:195
Marble::GeoDataLatLonQuad::bottomLeftLatitude
qreal bottomLeftLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:75
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::KmlObjectTagWriter::writeIdentifiers
static void writeIdentifiers(GeoWriter &writer, const GeoDataObject *object)
Parses the id and targetId attributes and assign their values to the given object.
Definition: KmlObjectTagWriter.cpp:15
GeoWriter.h
Marble::kml::kmlTag_coordinates
const char * kmlTag_coordinates
Definition: KmlElementDictionary.cpp:54
Marble::GeoDataLatLonQuad
Definition: GeoDataLatLonQuad.h:22
QString::number
QString number(int n, int base)
Marble::GeoDataLatLonQuad::topRightLatitude
qreal topRightLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:115
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:29
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::s_writerLatLonQuad
static GeoTagWriterRegistrar s_writerLatLonQuad(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataLatLonQuadType, kml::kmlTag_nameSpaceOgc22), new KmlLatLonQuadWriter)
QString
Marble::kml::kmlTag_LatLonQuad
const char * kmlTag_LatLonQuad
Definition: KmlElementDictionary.cpp:97
KmlLatLonQuadWriter.h
Marble::GeoDataTypes::GeoDataLatLonQuadType
const char * GeoDataLatLonQuadType
Definition: GeoDataTypes.cpp:51
Marble::kml::kmlTag_nameSpaceOgc22
const char * kmlTag_nameSpaceOgc22
Definition: KmlElementDictionary.cpp:34
Marble::GeoDataLatLonQuad::topLeftLongitude
qreal topLeftLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:145
Marble::GeoDataLatLonQuad::topRightLongitude
qreal topRightLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:125
Marble::GeoDataLatLonQuad::bottomRightLatitude
qreal bottomRightLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:95
GeoDataTypes.h
Marble::GeoDataLatLonQuad::bottomLeftLongitude
qreal bottomLeftLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:85
QXmlStreamWriter::writeCharacters
void writeCharacters(const QString &text)
Marble::GeoDataLatLonQuad::bottomRightLongitude
qreal bottomRightLongitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:105
Marble::KmlLatLonQuadWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const
Definition: KmlLatLonQuadWriter.cpp:27
QXmlStreamWriter::writeEndElement
void writeEndElement()
QXmlStreamWriter::writeStartElement
void writeStartElement(const QString &qualifiedName)
Marble::GeoDataLatLonQuad::topLeftLatitude
qreal topLeftLatitude(GeoDataCoordinates::Unit unit) const
Definition: GeoDataLatLonQuad.cpp:135
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