• 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
  • plugins
  • runner
  • osm
  • handlers
OsmRelationTagHandler.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 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com>
9 
10  Copyright 2012 Ander Pijoan <ander.pijoan@deusto.es>
11 */
12 
13 #include "OsmRelationTagHandler.h"
14 
15 #include "OsmParser.h"
16 #include "OsmElementDictionary.h"
17 
18 #include "GeoDataDocument.h"
19 #include "GeoDataPlacemark.h"
20 #include "GeoDataParser.h"
21 #include "GeoDataPolygon.h"
22 
23 namespace Marble
24 {
25 
26 namespace osm
27 {
28 
29 static GeoTagHandlerRegistrar osmRelationTagHandler( GeoParser::QualifiedName( osmTag_relation, "" ),
30  new OsmRelationTagHandler() );
31 
32 GeoNode* OsmRelationTagHandler::parse( GeoParser &geoParser ) const
33 {
34  // Osm Relation http://wiki.openstreetmap.org/wiki/Data_Primitives#Relation
35 
36  Q_ASSERT( dynamic_cast<OsmParser *>( &geoParser ) != 0 );
37  OsmParser &parser = static_cast<OsmParser &>( geoParser );
38 
39  Q_ASSERT( parser.isStartElement() );
40 
41  GeoDataDocument* doc = geoDataDoc( parser );
42  Q_ASSERT( doc );
43 
44  GeoDataPolygon *polygon = new GeoDataPolygon();
45  GeoDataPlacemark *placemark = new GeoDataPlacemark();
46  placemark->setGeometry( polygon );
47 
48  // In the beginning visibility = false. Afterwards when it parses
49  // the tags for the placemark it will decide if it should be displayed or not
50  placemark->setVisible( false );
51  doc->append( placemark );
52 
53  parser.setPolygon( parser.attribute( "id" ).toULongLong(), polygon );
54 
55  return polygon;
56 }
57 
58 }
59 
60 }
GeoDataDocument.h
Marble::osm::OsmRelationTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: OsmRelationTagHandler.cpp:32
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
GeoDataPolygon.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoDataParser.h
Marble::GeoParser
Definition: GeoParser.h:40
OsmElementDictionary.h
Marble::GeoParser::attribute
QString attribute(const char *attributeName) const
Definition: GeoParser.cpp:200
Marble::osm::osmTag_relation
const char * osmTag_relation
Definition: OsmElementDictionary.cpp:25
Marble::GeoDataPolygon
A polygon that can have "holes".
Definition: GeoDataPolygon.h:81
Marble::OsmParser::setPolygon
void setPolygon(quint64 id, GeoDataPolygon *polygon)
Definition: src/plugins/runner/osm/OsmParser.cpp:86
OsmRelationTagHandler.h
QString::toULongLong
qulonglong toULongLong(bool *ok, int base) const
GeoDataPlacemark.h
Marble::GeoDataFeature::setVisible
void setVisible(bool value)
Set a new value for visibility.
Definition: GeoDataFeature.cpp:661
Marble::osm::osmRelationTagHandler
static GeoTagHandlerRegistrar osmRelationTagHandler(GeoParser::QualifiedName(osmTag_relation,""), new OsmRelationTagHandler())
QXmlStreamReader::isStartElement
bool isStartElement() const
Marble::OsmParser
Definition: src/plugins/runner/osm/OsmParser.h:29
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::GeoParser::QualifiedName
QPair< QString, QString > QualifiedName
Definition: GeoParser.h:43
Marble::geoDataDoc
GeoDataDocument * geoDataDoc(GeoParser &parser)
Definition: GeoDataParser.cpp:105
Marble::GeoDataPlacemark::setGeometry
void setGeometry(GeoDataGeometry *entry)
Sets the current Geometry of this Placemark.
Definition: GeoDataPlacemark.cpp:230
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 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