Marble

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

KDE's Doxygen guidelines are available online.