• 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
  • kml
KmlCameraTagHandler.cpp
Go to the documentation of this file.
1 
2 //
3 // This file is part of the Marble Virtual Globe.
4 //
5 // This program is free software licensed under the GNU LGPL. You can
6 // find a copy of this license in LICENSE.txt in the top directory of
7 // the source code.
8 //
9 // Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
10 //
11 #include "KmlCameraTagHandler.h"
12 
13 #include "MarbleDebug.h"
14 
15 #include "KmlElementDictionary.h"
16 #include "KmlObjectTagHandler.h"
17 #include "GeoDataCamera.h"
18 #include "GeoParser.h"
19 #include "GeoDataContainer.h"
20 #include "GeoDataPlacemark.h"
21 #include "GeoDataFlyTo.h"
22 
23 namespace Marble
24 {
25 namespace kml
26 {
27 
28 KML_DEFINE_TAG_HANDLER( Camera )
29 
30 GeoNode *KmlCameraTagHandler::parse( GeoParser & parser ) const
31 {
32  Q_ASSERT (parser.isStartElement()
33  && parser.isValidElement( kmlTag_Camera ) );
34 
35  GeoDataCamera* camera = 0;
36  GeoStackItem parentItem = parser.parentElement();
37 
38  if ( parentItem.is<GeoDataFeature>() ) {
39  camera = new GeoDataCamera;
40  KmlObjectTagHandler::parseIdentifiers( parser, camera );
41  parentItem.nodeAs<GeoDataFeature>()->setAbstractView( camera );
42  }
43 
44  if ( parentItem.is<GeoDataFlyTo>() ) {
45  camera = new GeoDataCamera;
46  KmlObjectTagHandler::parseIdentifiers( parser, camera );
47  parentItem.nodeAs<GeoDataFlyTo>()->setView( camera );
48  }
49 
50  return camera;
51 }
52 
53 }
54 
55 }
KmlCameraTagHandler.h
Marble::GeoStackItem::nodeAs
T * nodeAs()
Definition: GeoParser.h:120
KmlObjectTagHandler.h
GeoDataContainer.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
Marble::kml::kmlTag_Camera
const char * kmlTag_Camera
Definition: KmlElementDictionary.cpp:46
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
Marble::kml::KmlCameraTagHandler
Definition: KmlCameraTagHandler.h:21
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
GeoDataCamera.h
KmlElementDictionary.h
Marble::GeoDataFlyTo
Definition: GeoDataFlyTo.h:23
Marble::KmlObjectTagHandler::parseIdentifiers
static void parseIdentifiers(const GeoParser &parser, GeoDataObject *object)
Parses the id and targetId attributes and assign their values to the given object.
Definition: KmlObjectTagHandler.cpp:15
Marble::GeoStackItem
Definition: GeoParser.h:97
KML_DEFINE_TAG_HANDLER
#define KML_DEFINE_TAG_HANDLER(Name)
Definition: KmlElementDictionary.h:242
GeoDataPlacemark.h
GeoDataFlyTo.h
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:57
Marble::GeoStackItem::is
bool is() const
Definition: GeoParser.h:127
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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