• 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
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 "GeoParser.h"
14 #include "OsmWayFactory.h"
15 #include "GeoDataDocument.h"
16 #include "GeoDataPlacemark.h"
17 #include "GeoDataParser.h"
18 #include "GeoDataLineString.h"
19 #include "OsmElementDictionary.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& parser ) const
31 {
32  // Osm Way http://wiki.openstreetmap.org/wiki/Data_Primitives#Way
33 
34  Q_ASSERT( parser.isStartElement() );
35 
36  GeoDataDocument* doc = geoDataDoc( parser );
37  Q_ASSERT( doc );
38 
39  GeoDataLineString *polyline = new GeoDataLineString();
40  GeoDataPlacemark *placemark = new GeoDataPlacemark();
41  placemark->setGeometry( polyline );
42 
43  // At the beginning visibility = false. Afterwards when parsing
44  // the tags for the placemark it will decide if it should be displayed or not
45  placemark->setVisible( false );
46  doc->append( placemark );
47 
48  osm::OsmWayFactory::appendLine( parser.attribute( "id" ).toULongLong(), polyline );
49 
50  return polyline;
51 }
52 
53 }
54 
55 }
GeoDataDocument.h
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
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
GeoParser.h
OsmWayFactory.h
GeoDataParser.h
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
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:586
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::osm::OsmWayFactory::appendLine
static void appendLine(quint64 id, GeoDataLineString *l)
Definition: OsmWayFactory.cpp:26
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