• 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
  • parser
GeoSceneParser.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 
4  This file is part of the KDE project
5 
6  This library is free software you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  aint with this library see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 
23 // Own
24 #include "GeoSceneParser.h"
25 
26 // Marble
27 #include "MarbleDebug.h"
28 
29 // Geodata
30 #include "GeoDocument.h"
31 #include "GeoSceneDocument.h"
32 #include "GeoTagHandler.h"
33 
34 // DGML support
35 #include "DgmlElementDictionary.h"
36 
37 namespace Marble
38 {
39 
40 GeoSceneParser::GeoSceneParser(GeoSceneSourceType source)
41  : GeoParser(source)
42 {
43 }
44 
45 GeoSceneParser::~GeoSceneParser()
46 {
47  // nothing to do
48 }
49 
50 bool GeoSceneParser::isValidRootElement()
51 {
52  switch ((GeoSceneSourceType) m_source) {
53  case GeoScene_DGML:
54  return isValidElement(dgml::dgmlTag_Dgml);
55  default:
56  Q_ASSERT(false);
57  return false;
58  }
59 }
60 
61 bool GeoSceneParser::isValidElement(const QString& tagName) const
62 {
63  if (!GeoParser::isValidElement(tagName))
64  return false;
65 
66  switch ((GeoSceneSourceType) m_source) {
67  case GeoScene_DGML:
68  return (namespaceUri() == dgml::dgmlTag_nameSpace20);
69  default:
70  break;
71  }
72 
73  // Should never be reached.
74  Q_ASSERT(false);
75  return false;
76 }
77 
78 GeoDocument* GeoSceneParser::createDocument() const
79 {
80  return new GeoSceneDocument;
81 }
82 
83 // Global helper function for the tag handlers
84 GeoSceneDocument* geoSceneDoc(GeoParser& parser)
85 {
86  GeoDocument* document = parser.activeDocument();
87  Q_ASSERT(document->isGeoSceneDocument());
88  return static_cast<GeoSceneDocument*>(document);
89 }
90 
91 }
Marble::GeoParser::activeDocument
GeoDocument * activeDocument()
Definition: GeoParser.h:62
Marble::GeoSceneParser::GeoSceneParser
GeoSceneParser(GeoSceneSourceType source)
Definition: GeoSceneParser.cpp:40
Marble::GeoParser::m_source
GeoDataGenericSourceType m_source
Definition: GeoParser.h:90
QXmlStreamReader::namespaceUri
QStringRef namespaceUri() const
Marble::GeoSceneParser::~GeoSceneParser
virtual ~GeoSceneParser()
Definition: GeoSceneParser.cpp:45
Marble::GeoDocument::isGeoSceneDocument
virtual bool isGeoSceneDocument() const
Definition: GeoDocument.cpp:54
GeoTagHandler.h
GeoSceneDocument.h
Marble::GeoSceneSourceType
GeoSceneSourceType
Definition: GeoSceneParser.h:34
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::dgml::dgmlTag_Dgml
const char * dgmlTag_Dgml
Definition: DgmlElementDictionary.cpp:40
Marble::dgml::dgmlTag_nameSpace20
const char * dgmlTag_nameSpace20
Definition: DgmlElementDictionary.cpp:31
GeoDocument.h
DgmlElementDictionary.h
QString
Marble::GeoSceneDocument
A container for features parsed from the DGML file.
Definition: GeoSceneDocument.h:44
Marble::GeoParser::isValidElement
virtual bool isValidElement(const QString &tagName) const
Definition: GeoParser.cpp:117
Marble::GeoScene_DGML
Definition: GeoSceneParser.h:35
Marble::GeoDocument
A shared base class between GeoDataDocument/GeoSourceDocument.
Definition: GeoDocument.h:42
Marble::geoSceneDoc
GeoSceneDocument * geoSceneDoc(GeoParser &parser)
Definition: GeoSceneParser.cpp:84
GeoSceneParser.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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