Marble

KmlLatLonAltBoxWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Mayank Madan <[email protected]>
4 //
5 
6 #include "KmlLatLonAltBoxWriter.h"
7 
8 #include "GeoDataLatLonAltBox.h"
9 #include "GeoDataTypes.h"
10 #include "GeoWriter.h"
11 #include "KmlGroundOverlayWriter.h"
12 #include "KmlElementDictionary.h"
13 #include "KmlObjectTagWriter.h"
14 
15 namespace Marble
16 {
17 
18 static GeoTagWriterRegistrar s_writerLatLonAltBox(
19  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLatLonAltBoxType,
20  kml::kmlTag_nameSpaceOgc22 ),
21  new KmlLatLonAltBoxWriter);
22 
23 bool KmlLatLonAltBoxWriter::write( const GeoNode *node,
24  GeoWriter& writer ) const
25 {
26  const GeoDataLatLonAltBox *latLonAltBox = static_cast<const GeoDataLatLonAltBox*>( node );
27  writer.writeStartElement(kml::kmlTag_LatLonAltBox);
28  KmlObjectTagWriter::writeIdentifiers( writer, latLonAltBox );
29  writer.writeTextElement( kml::kmlTag_north, QString::number(latLonAltBox->north( GeoDataCoordinates::Degree )) );
30  writer.writeTextElement( kml::kmlTag_south, QString::number(latLonAltBox->south( GeoDataCoordinates::Degree )) );
31  writer.writeTextElement( kml::kmlTag_east, QString::number(latLonAltBox->east( GeoDataCoordinates::Degree )) );
32  writer.writeTextElement( kml::kmlTag_west, QString::number(latLonAltBox->west( GeoDataCoordinates::Degree )) );
33  writer.writeTextElement( kml::kmlTag_minAltitude, QString::number(latLonAltBox->minAltitude()) );
34  writer.writeTextElement( kml::kmlTag_maxAltitude, QString::number(latLonAltBox->maxAltitude()) );
35  KmlGroundOverlayWriter::writeAltitudeMode( writer, latLonAltBox->altitudeMode());
36  writer.writeEndElement();
37  return true;
38 }
39 
40 }
QString number(int n, int base)
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.