Marble

GeoPolygonGraphicsItem.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com>
4//
5
6#include "GeoPolygonGraphicsItem.h"
7
8#include "BuildingGraphicsItem.h"
9#include "GeoDataPlacemark.h"
10#include "StyleBuilder.h"
11
12namespace Marble
13{
14
15AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon)
16{
17 return new GeoPolygonGraphicsItem(placemark, polygon);
18}
19
20AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring)
21{
22 return new GeoPolygonGraphicsItem(placemark, ring);
23}
24
25AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataBuilding *building)
26{
27 return new BuildingGraphicsItem(placemark, building);
28}
29
30GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon)
31 : AbstractGeoPolygonGraphicsItem(placemark, polygon)
32{
33 const int elevation = extractElevation(*placemark);
34 setZValue(zValue() + elevation);
35
36 const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory();
37 const QString paintLayer = QLatin1StringView("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
38 setPaintLayers(QStringList(paintLayer));
39}
40
41GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring)
42 : AbstractGeoPolygonGraphicsItem(placemark, ring)
43{
44 const int elevation = extractElevation(*placemark);
45 setZValue(zValue() + elevation);
46
47 const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory();
48 const QString paintLayer = QLatin1StringView("Polygon/") + StyleBuilder::visualCategoryName(visualCategory);
49 setPaintLayers(QStringList(paintLayer));
50}
51
52}
Binds a QML item to a specific geodetic location in screen coordinates.
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.