File indexing completed on 2025-01-05 03:59:02
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com> 0004 // 0005 0006 #include "GeoPolygonGraphicsItem.h" 0007 0008 #include "BuildingGraphicsItem.h" 0009 #include "GeoDataPlacemark.h" 0010 #include "StyleBuilder.h" 0011 0012 namespace Marble 0013 { 0014 0015 AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) 0016 { 0017 return new GeoPolygonGraphicsItem(placemark, polygon); 0018 } 0019 0020 AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring) 0021 { 0022 return new GeoPolygonGraphicsItem(placemark, ring); 0023 } 0024 0025 AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataBuilding *building) 0026 { 0027 return new BuildingGraphicsItem(placemark, building); 0028 } 0029 0030 GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) : 0031 AbstractGeoPolygonGraphicsItem(placemark, polygon) 0032 { 0033 const int elevation = extractElevation(*placemark); 0034 setZValue(zValue() + elevation); 0035 0036 const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory(); 0037 const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory); 0038 setPaintLayers(QStringList(paintLayer)); 0039 } 0040 0041 GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring) : 0042 AbstractGeoPolygonGraphicsItem(placemark, ring) 0043 { 0044 const int elevation = extractElevation(*placemark); 0045 setZValue(zValue() + elevation); 0046 0047 const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory(); 0048 const QString paintLayer = QLatin1String("Polygon/") + StyleBuilder::visualCategoryName(visualCategory); 0049 setPaintLayers(QStringList(paintLayer)); 0050 } 0051 0052 }