Marble

KmlTessellateTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "KmlTessellateTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "KmlElementDictionary.h"
12
13#include "GeoDataGeometry.h"
14#include "GeoDataLinearRing.h"
15#include "GeoDataPoint.h"
16#include "GeoDataPolygon.h"
17
18#include "GeoParser.h"
19
20namespace Marble
21{
22namespace kml
23{
24KML_DEFINE_TAG_HANDLER(tessellate)
25
26GeoNode *KmltessellateTagHandler::parse(GeoParser &parser) const
27{
28 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_tessellate)));
29
30 GeoStackItem parentItem = parser.parentElement();
31
32 QString content = parser.readElementText().trimmed();
33
34 if (parentItem.is<GeoDataLineString>()) {
35 auto lineString = parentItem.nodeAs<GeoDataLineString>();
36
37 const bool tesselate = (content == QLatin1StringView("1"));
38 lineString->setTessellate(tesselate);
39
40 } else if (parentItem.is<GeoDataLinearRing>()) {
41 auto linearRing = parentItem.nodeAs<GeoDataLinearRing>();
42
43 const bool tesselate = (content == QLatin1StringView("1"));
44 linearRing->setTessellate(tesselate);
45
46 } else if (parentItem.is<GeoDataPolygon>()) {
47 auto polygon = parentItem.nodeAs<GeoDataPolygon>();
48
49 const bool tesselate = (content == QLatin1StringView("1"));
50 polygon->setTessellate(tesselate);
51 }
52
53 return nullptr;
54}
55
56}
57}
Binds a QML item to a specific geodetic location in screen coordinates.
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.