Marble

KmlLatLonBoxWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Shou Ya <shouyatf@gmail.com>
4//
5
6#include "KmlLatLonBoxWriter.h"
7
8#include "GeoDataLatLonBox.h"
9#include "GeoDataTypes.h"
10#include "GeoWriter.h"
11#include "KmlElementDictionary.h"
12#include "KmlObjectTagWriter.h"
13
14namespace Marble
15{
16
17static GeoTagWriterRegistrar s_writerLookAt(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataLatLonBoxType),
18 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
19 new KmlLatLonBoxWriter);
20
21bool KmlLatLonBoxWriter::write(const GeoNode *node, GeoWriter &writer) const
22{
23 const auto lat_lon_box = static_cast<const GeoDataLatLonBox *>(node);
24
25 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_LatLonBox));
26 KmlObjectTagWriter::writeIdentifiers(writer, lat_lon_box);
27
28 writer.writeTextElement("north", QString::number(lat_lon_box->north(GeoDataCoordinates::Degree)));
29 writer.writeTextElement("south", QString::number(lat_lon_box->south(GeoDataCoordinates::Degree)));
30 writer.writeTextElement("east", QString::number(lat_lon_box->east(GeoDataCoordinates::Degree)));
31 writer.writeTextElement("west", QString::number(lat_lon_box->west(GeoDataCoordinates::Degree)));
32 writer.writeOptionalElement(QStringLiteral("rotation"), QString::number(lat_lon_box->rotation(GeoDataCoordinates::Degree)), QStringLiteral("0"));
33
34 writer.writeEndElement();
35
36 return true;
37}
38
39}
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 Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.