• 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
OsmWayTagHandler.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 
11 #include "OsmWayTagHandler.h"
12 
13 #include "OsmParser.h"
14 #include "OsmElementDictionary.h"
15 
16 #include "GeoDataDocument.h"
17 #include "GeoDataPlacemark.h"
18 #include "GeoDataParser.h"
19 #include "GeoDataLineString.h"
20 
21 namespace Marble
22 {
23 
24 namespace osm
25 {
26 
27 static GeoTagHandlerRegistrar osmWayTagHandler( GeoParser::QualifiedName( osmTag_way, "" ),
28  new OsmWayTagHandler() );
29 
30 GeoNode* OsmWayTagHandler::parse( GeoParser &geoParser ) const
31 {
32  // Osm Way http://wiki.openstreetmap.org/wiki/Data_Primitives#Way
33 
34  Q_ASSERT( dynamic_cast<OsmParser *>( &geoParser ) );
35  OsmParser &parser = static_cast<OsmParser &>( geoParser );
36 
37  Q_ASSERT( parser.isStartElement() );
38 
39  GeoDataDocument* doc = geoDataDoc( parser );
40  Q_ASSERT( doc );
41 
42  GeoDataLineString *polyline = new GeoDataLineString();
43  GeoDataPlacemark *placemark = new GeoDataPlacemark();
44  placemark->setGeometry( polyline );
45 
46  // At the beginning visibility = false. Afterwards when parsing
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  parser.setWay( parser.attribute( "id" ).toULongLong(), polyline );
52 
53  return polyline;
54 }
55 
56 }
57 
58 }
GeoDataDocument.h
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Marble::osm::OsmWayTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: OsmWayTagHandler.cpp:30
OsmWayTagHandler.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::OsmParser::setWay
void setWay(quint64 id, GeoDataLineString *way)
Definition: src/plugins/runner/osm/OsmParser.cpp:76
Marble::GeoParser
Definition: GeoParser.h:40
OsmElementDictionary.h
Marble::GeoParser::attribute
QString attribute(const char *attributeName) const
Definition: GeoParser.cpp:200
GeoDataLineString.h
Marble::osm::osmTag_way
const char * osmTag_way
Definition: OsmElementDictionary.cpp:24
QString::toULongLong
qulonglong toULongLong(bool *ok, int base) const
GeoDataPlacemark.h
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
Marble::osm::osmWayTagHandler
static GeoTagHandlerRegistrar osmWayTagHandler(GeoParser::QualifiedName(osmTag_way,""), new OsmWayTagHandler())
Marble::GeoDataFeature::setVisible
void setVisible(bool value)
Set a new value for visibility.
Definition: GeoDataFeature.cpp:661
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