• 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
  • lib
  • marble
  • geodata
  • handlers
  • dgml
DgmlBlendingTagHandler.cpp
Go to the documentation of this file.
1 // Copyright 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
15 
16 #include "DgmlBlendingTagHandler.h"
17 
18 #include "DgmlAttributeDictionary.h"
19 #include "DgmlElementDictionary.h"
20 #include "GeoParser.h"
21 #include "GeoSceneTiled.h"
22 #include "MarbleDebug.h"
23 
24 namespace Marble
25 {
26 namespace dgml
27 {
28 static GeoTagHandlerRegistrar registrar( GeoParser::QualifiedName( dgmlTag_Blending,
29  dgmlTag_nameSpace20 ),
30  new DgmlBlendingTagHandler );
31 
32 GeoNode* DgmlBlendingTagHandler::parse( GeoParser& parser ) const
33 {
34  // Check whether the tag is valid
35  Q_ASSERT( parser.isStartElement() && parser.isValidElement( dgmlTag_Blending ));
36 
37  // Checking for parent item
38  GeoStackItem parentItem = parser.parentElement();
39  if ( !parentItem.represents( dgmlTag_Texture ) && !parentItem.represents( dgmlTag_Vectortile ))
40  return 0;
41 
42  // Attribute name, default to ""
43  const QString name = parser.attribute( dgmlAttr_name ).trimmed();
44  mDebug() << "DgmlBlendingTagHandler::parse" << name;
45  parentItem.nodeAs<GeoSceneTiled>()->setBlending( name );
46  return 0;
47 }
48 
49 
50 }
51 }
DgmlAttributeDictionary.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
DgmlBlendingTagHandler.h
Marble::GeoParser::parentElement
GeoStackItem parentElement(unsigned int depth=0) const
Definition: GeoParser.cpp:122
Marble::GeoSceneTiled
Definition: GeoSceneTiled.h:43
Marble::dgml::dgmlTag_Texture
const char * dgmlTag_Texture
Definition: DgmlElementDictionary.cpp:71
Marble::dgml::dgmlAttr_name
const char * dgmlAttr_name
Definition: DgmlAttributeDictionary.cpp:52
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::GeoParser::attribute
QString attribute(const char *attributeName) const
Definition: GeoParser.cpp:200
Marble::dgml::dgmlTag_nameSpace20
const char * dgmlTag_nameSpace20
Definition: DgmlElementDictionary.cpp:31
DgmlElementDictionary.h
Marble::GeoStackItem
Definition: GeoParser.h:97
Marble::GeoParser::isValidElement
virtual bool isValidElement(const QString &tagName) const
Definition: GeoParser.cpp:117
Marble::dgml::DgmlBlendingTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: DgmlBlendingTagHandler.cpp:32
Marble::dgml::dgmlTag_Vectortile
const char * dgmlTag_Vectortile
Definition: DgmlElementDictionary.cpp:76
GeoSceneTiled.h
Marble::dgml::registrar
static GeoTagHandlerRegistrar registrar(GeoParser::QualifiedName(dgmlTag_Blending, dgmlTag_nameSpace20), new DgmlBlendingTagHandler)
Marble::dgml::dgmlTag_Blending
const char * dgmlTag_Blending
Definition: DgmlElementDictionary.cpp:34
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
Marble::GeoParser::QualifiedName
QPair< QString, QString > QualifiedName
Definition: GeoParser.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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