File indexing completed on 2025-01-05 03:59:13

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2012 Mayank Madan <maddiemadan@gmail.com>
0004 //
0005 
0006 #include "KmlLatLonAltBoxWriter.h"
0007 
0008 #include "GeoDataLatLonAltBox.h"
0009 #include "GeoDataTypes.h"
0010 #include "GeoWriter.h"
0011 #include "KmlGroundOverlayWriter.h"
0012 #include "KmlElementDictionary.h"
0013 #include "KmlObjectTagWriter.h"
0014 
0015 namespace Marble
0016 {
0017 
0018 static GeoTagWriterRegistrar s_writerLatLonAltBox(
0019     GeoTagWriter::QualifiedName( QString::fromUtf8(GeoDataTypes::GeoDataLatLonAltBoxType),
0020                                  QString::fromUtf8(kml::kmlTag_nameSpaceOgc22) ),
0021     new KmlLatLonAltBoxWriter);
0022 
0023 bool KmlLatLonAltBoxWriter::write( const GeoNode *node,
0024                  GeoWriter& writer ) const
0025 {
0026     const GeoDataLatLonAltBox *latLonAltBox = static_cast<const GeoDataLatLonAltBox*>( node );
0027     writer.writeStartElement(QString::fromUtf8(kml::kmlTag_LatLonAltBox));
0028     KmlObjectTagWriter::writeIdentifiers( writer, latLonAltBox );
0029     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_north), QString::number(latLonAltBox->north( GeoDataCoordinates::Degree )) );
0030     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_south), QString::number(latLonAltBox->south( GeoDataCoordinates::Degree )) );
0031     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_east),  QString::number(latLonAltBox->east( GeoDataCoordinates::Degree )) );
0032     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_west),  QString::number(latLonAltBox->west( GeoDataCoordinates::Degree )) );
0033     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_minAltitude), QString::number(latLonAltBox->minAltitude()) );
0034     writer.writeTextElement( QString::fromUtf8(kml::kmlTag_maxAltitude), QString::number(latLonAltBox->maxAltitude()) );
0035     KmlGroundOverlayWriter::writeAltitudeMode( writer, latLonAltBox->altitudeMode());
0036     writer.writeEndElement();
0037     return true;
0038 }
0039 
0040 }