• 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
  • handlers
  • dgml
DgmlTileSizeTagHandler.cpp
Go to the documentation of this file.
1 // This file is part of the Marble Virtual Globe.
2 //
3 // This program is free software licensed under the GNU LGPL. You can
4 // find a copy of this license in LICENSE.txt in the top directory of
5 // the source code.
6 //
7 // Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
8 //
9 
10 #include "DgmlTileSizeTagHandler.h"
11 
12 #include "DgmlAttributeDictionary.h"
13 #include "DgmlElementDictionary.h"
14 #include "GeoParser.h"
15 #include "GeoSceneTiled.h"
16 
17 namespace Marble
18 {
19 namespace dgml
20 {
21 DGML_DEFINE_TAG_HANDLER(TileSize)
22 
23 GeoNode* DgmlTileSizeTagHandler::parse( GeoParser& parser ) const
24 {
25  // Check whether the tag is valid
26  Q_ASSERT( parser.isStartElement() && parser.isValidElement( dgmlTag_TileSize ));
27 
28  // Checking for parent item
29  GeoStackItem parentItem = parser.parentElement();
30  if ( !parentItem.represents( dgmlTag_Texture ) && !parentItem.represents( dgmlTag_Vectortile ))
31  return 0;
32 
33  int width = parser.attribute(dgmlAttr_width).toInt();
34  int height = parser.attribute(dgmlAttr_height).toInt();
35  QSize const size( width, height );
36  if ( !size.isEmpty() ) {
37  parentItem.nodeAs<GeoSceneTiled>()->setTileSize( size );
38  }
39 
40  return 0;
41 }
42 
43 }
44 }
DgmlAttributeDictionary.h
DGML_DEFINE_TAG_HANDLER
#define DGML_DEFINE_TAG_HANDLER(Name)
Definition: DgmlElementDictionary.h:85
QSize::isEmpty
bool isEmpty() const
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
Marble::dgml::dgmlAttr_height
const char * dgmlAttr_height
Definition: DgmlAttributeDictionary.cpp:46
Marble::GeoSceneTiled
Definition: GeoSceneTiled.h:43
Marble::dgml::dgmlTag_Texture
const char * dgmlTag_Texture
Definition: DgmlElementDictionary.cpp:71
Marble::GeoParser
Definition: GeoParser.h:40
DgmlTileSizeTagHandler.h
DgmlElementDictionary.h
Marble::GeoStackItem
Definition: GeoParser.h:97
QSize
Marble::dgml::dgmlAttr_width
const char * dgmlAttr_width
Definition: DgmlAttributeDictionary.cpp:72
Marble::dgml::dgmlTag_Vectortile
const char * dgmlTag_Vectortile
Definition: DgmlElementDictionary.cpp:76
Marble::dgml::dgmlTag_TileSize
const char * dgmlTag_TileSize
Definition: DgmlElementDictionary.cpp:73
GeoSceneTiled.h
Marble::dgml::DgmlTileSizeTagHandler
Definition: DgmlTileSizeTagHandler.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 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