• 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
KmlPlacemarkTagWriter.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 2009 Andrew Manson <g.real.ate@gmail.com>
9 //
10 
11 #include "KmlPlacemarkTagWriter.h"
12 
13 #include "KmlElementDictionary.h"
14 #include "GeoDataPlacemark.h"
15 #include "GeoDataExtendedData.h"
16 #include "GeoDataTimeStamp.h"
17 #include "GeoDataTypes.h"
18 #include "GeoWriter.h"
19 
20 namespace Marble
21 {
22 
23 //needs to handle a specific doctype. different versions different writer classes?
24 //don't use the tag dictionary for tag names, because with the writer we are using
25 // the object type strings instead
26 //FIXME: USE object strings provided by idis
27 static GeoTagWriterRegistrar s_writerPlacemark( GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataPlacemarkType,
28  kml::kmlTag_nameSpaceOgc22), new KmlPlacemarkTagWriter() );
29 
30 bool KmlPlacemarkTagWriter::writeMid( const GeoNode *node, GeoWriter& writer ) const
31 {
32  const GeoDataPlacemark *placemark = static_cast<const GeoDataPlacemark*>(node);
33 
34  writer.writeOptionalElement( kml::kmlTag_styleUrl, placemark->styleUrl() );
35 
36  if( placemark->geometry() ) {
37  writeElement( placemark->geometry(), writer );
38  }
39 
40  if( placemark->isBalloonVisible() ){
41  QString string;
42  string.setNum( 1 );
43  writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_balloonVisibility, string );
44  }
45 
46  return true;
47 }
48 
49 KmlPlacemarkTagWriter::KmlPlacemarkTagWriter() :
50  KmlFeatureTagWriter( kml::kmlTag_Placemark )
51 {
52  // nothing to do
53 }
54 
55 }
Marble::GeoWriter::writeOptionalElement
void writeOptionalElement(const QString &key, const QString &value, const QString &defaultValue=QString())
Convenience method to write value if value is not equal to defaultValue.
Definition: GeoWriter.cpp:98
Marble::kml::kmlTag_nameSpaceGx22
const char * kmlTag_nameSpaceGx22
Definition: KmlElementDictionary.cpp:35
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoDataTimeStamp.h
Marble::GeoDataTypes::GeoDataPlacemarkType
const char * GeoDataPlacemarkType
Definition: GeoDataTypes.cpp:66
GeoDataExtendedData.h
Marble::GeoDataFeature::styleUrl
QString styleUrl() const
Return the styleUrl of the feature.
Definition: GeoDataFeature.cpp:626
Marble::kml::kmlTag_styleUrl
const char * kmlTag_styleUrl
Definition: KmlElementDictionary.cpp:179
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
Marble::KmlPlacemarkTagWriter::KmlPlacemarkTagWriter
KmlPlacemarkTagWriter()
Definition: KmlPlacemarkTagWriter.cpp:49
GeoWriter.h
Marble::KmlFeatureTagWriter
Definition: KmlFeatureTagWriter.h:22
Marble::GeoDataPlacemark::geometry
GeoDataGeometry * geometry()
The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the c...
Definition: GeoDataPlacemark.cpp:152
Marble::KmlPlacemarkTagWriter::writeMid
virtual bool writeMid(const GeoNode *node, GeoWriter &writer) const
Definition: KmlPlacemarkTagWriter.cpp:30
Marble::kml::kmlTag_Placemark
const char * kmlTag_Placemark
Definition: KmlElementDictionary.cpp:143
Marble::GeoDataPlacemark::isBalloonVisible
bool isBalloonVisible() const
Returns whether balloon is visible or not.
Definition: GeoDataPlacemark.cpp:282
KmlElementDictionary.h
Marble::kml::kmlTag_balloonVisibility
const char * kmlTag_balloonVisibility
Definition: KmlElementDictionary.cpp:218
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
QString
GeoDataPlacemark.h
Marble::kml::kmlTag_nameSpaceOgc22
const char * kmlTag_nameSpaceOgc22
Definition: KmlElementDictionary.cpp:34
KmlPlacemarkTagWriter.h
Marble::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
QString::setNum
QString & setNum(short n, int base)
Marble::s_writerPlacemark
static GeoTagWriterRegistrar s_writerPlacemark(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataPlacemarkType, kml::kmlTag_nameSpaceOgc22), new KmlPlacemarkTagWriter())
GeoDataTypes.h
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
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