[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/handlers/kml
Bastian Holst
bastianholst at gmx.de
Wed Aug 26 22:41:31 CEST 2009
SVN commit 1016033 by bholst:
Marble KmlParser: Adding handlers for LatLonAltBox.
M +27 -24 KmlAltitudeModeTagHandler.cpp
AM KmlEastTagHandler.cpp [License: LGPL]
AM KmlEastTagHandler.h [License: LGPL]
AM KmlMaxAltitudeTagHandler.cpp [License: LGPL]
AM KmlMaxAltitudeTagHandler.h [License: LGPL]
AM KmlMinAltitudeTagHandler.cpp [License: LGPL]
AM KmlMinAltitudeTagHandler.h [License: LGPL]
AM KmlNorthTagHandler.cpp [License: LGPL]
AM KmlNorthTagHandler.h [License: LGPL]
AM KmlSouthTagHandler.cpp [License: LGPL]
AM KmlSouthTagHandler.h [License: LGPL]
AM KmlWestTagHandler.cpp [License: LGPL]
AM KmlWestTagHandler.h [License: LGPL]
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp #1016032:1016033
@@ -1,5 +1,6 @@
/*
Copyright (C) 2008 Patrick Spendrin <ps_ml at gmx.de>
+ Copyright (C) 2009 Bastian Holst <bastianholst at gmx.de>
This file is part of the KDE project
@@ -41,38 +42,40 @@
{
Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_altitudeMode ) );
+ QString content = parser.readElementText().trimmed();
+
+ AltitudeMode mode;
+ if( content == QString( "relativeToGround" ) ) {
+ mode = RelativeToGround;
+ }
+ else if( content == QString( "absolute" ) ) {
+ mode = Absolute;
+ }
+ else { // clampToGround is Standard
+ mode = ClampToGround;
+ }
+
GeoStackItem parentItem = parser.parentElement();
-
- GeoDataGeometry* geometry;
- bool validParents = false;
- if( parentItem.is<GeoDataFeature>() &&
- parentItem.nodeAs<GeoDataFeature>()->featureId() == GeoDataPlacemarkId &&
- parentItem.represents( kmlTag_Point ) ) {
- geometry = parentItem.nodeAs<GeoDataPlacemark>()->geometry();
- validParents = true;
- } else if( parentItem.is<GeoDataGeometry>() &&
- parentItem.nodeAs<GeoDataPoint>()->geometryId() == GeoDataPointId ) {
- geometry = parentItem.nodeAs<GeoDataPoint>();
- validParents = true;
+ if ( parentItem.is<GeoDataFeature>()
+ && parentItem.nodeAs<GeoDataFeature>()->featureId() == GeoDataPlacemarkId
+ && parentItem.represents( kmlTag_Point ) )
+ {
+ parentItem.nodeAs<GeoDataPlacemark>()->geometry()->setAltitudeMode( mode );
}
+ else if ( parentItem.is<GeoDataGeometry>()
+ && parentItem.nodeAs<GeoDataPoint>()->geometryId() == GeoDataPointId )
+ {
+ parentItem.nodeAs<GeoDataPoint>()->setAltitudeMode( mode );
+ }
+ else if ( parentItem.is<GeoDataLatLonAltBox>() ) {
+ parentItem.nodeAs<GeoDataLatLonAltBox>()->setAltitudeMode( mode );
+ }
- if( validParents ) {
- QString content = parser.readElementText().trimmed();
-
- if( content == QString( "relativeToGround" ) ) {
- geometry->setAltitudeMode( RelativeToGround );
- } else if( content == QString( "absolute" ) ) {
- geometry->setAltitudeMode( Absolute );
- } else { // clampToGround is Standard
- geometry->setAltitudeMode( ClampToGround );
- }
#ifdef DEBUG_TAGS
qDebug() << "Parsed <" << kmlTag_altitudeMode << "> containing: " << content
<< " parent item name: " << parentItem.qualifiedName().first;
#endif
- }
-
return 0;
}
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlEastTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlEastTagHandler.h #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlMaxAltitudeTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlMaxAltitudeTagHandler.h #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlMinAltitudeTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlMinAltitudeTagHandler.h #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlNorthTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlNorthTagHandler.h #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlSouthTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlSouthTagHandler.h #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlWestTagHandler.cpp #property svn:eol-style
+ native
** trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/kml/KmlWestTagHandler.h #property svn:eol-style
+ native
More information about the Marble-commits
mailing list