• 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
  • 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 "GeoParser.h"
16 #include "OsmRelationFactory.h"
17 #include "GeoDataDocument.h"
18 #include "GeoDataPlacemark.h"
19 #include "GeoDataParser.h"
20 #include "GeoDataPolygon.h"
21 #include "OsmElementDictionary.h"
22 #include "MarbleDebug.h"
23 
24 namespace Marble
25 {
26 
27 namespace osm
28 {
29 
30 static GeoTagHandlerRegistrar osmRelationTagHandler( GeoParser::QualifiedName( osmTag_relation, "" ),
31  new OsmRelationTagHandler() );
32 
33 GeoNode* OsmRelationTagHandler::parse( GeoParser& parser ) const
34 {
35  // Osm Relation http://wiki.openstreetmap.org/wiki/Data_Primitives#Relation
36 
37  Q_ASSERT( parser.isStartElement() );
38 
39  GeoDataDocument* doc = geoDataDoc( parser );
40  Q_ASSERT( doc );
41 
42  GeoDataPolygon *polygon = new GeoDataPolygon();
43  GeoDataPlacemark *placemark = new GeoDataPlacemark();
44  placemark->setGeometry( polygon );
45 
46  // In the beginning visibility = false. Afterwards when it parses
47  // the tags for the placemark it will decide if it should be displayed or not
48  placemark->setVisible( false );
49  doc->append( placemark );
50 
51  osm::OsmRelationFactory::appendPolygon( parser.attribute( "id" ).toULongLong(), polygon );
52 
53  return polygon;
54 }
55 
56 }
57 
58 }
OsmRelationFactory.h
GeoDataDocument.h
Marble::osm::OsmRelationTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: OsmRelationTagHandler.cpp:33
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
GeoDataPolygon.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
GeoDataParser.h
MarbleDebug.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
OsmRelationTagHandler.h
GeoDataPlacemark.h
Marble::GeoDataFeature::setVisible
void setVisible(bool value)
Set a new value for visibility.
Definition: GeoDataFeature.cpp:586
Marble::osm::osmRelationTagHandler
static GeoTagHandlerRegistrar osmRelationTagHandler(GeoParser::QualifiedName(osmTag_relation,""), new OsmRelationTagHandler())
Marble::osm::OsmRelationFactory::appendPolygon
static void appendPolygon(quint64 id, GeoDataPolygon *p)
Definition: OsmRelationFactory.cpp:27
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:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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