Marble

AbstractGeoPolygonGraphicsItem.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com>
4//
5
6#ifndef MARBLE_ABSTRACTGEOPOLYGONGRAPHICSITEM_H
7#define MARBLE_ABSTRACTGEOPOLYGONGRAPHICSITEM_H
8
9#include "GeoGraphicsItem.h"
10#include "marble_export.h"
11
12#include <QColor>
13#include <QImage>
14
15namespace Marble
16{
17
18class GeoDataLinearRing;
19class GeoDataPlacemark;
20class GeoDataPolygon;
21class GeoDataBuilding;
22
23class MARBLE_EXPORT AbstractGeoPolygonGraphicsItem : public GeoGraphicsItem
24{
25protected:
26 AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon);
27 AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring);
28 AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataBuilding *building);
29 ~AbstractGeoPolygonGraphicsItem() override;
30
31public:
32 const GeoDataLatLonAltBox &latLonAltBox() const override;
33 void paint(GeoPainter *painter, const ViewportParams *viewport, const QString &layer, int tileZoomLevel) override;
34 bool contains(const QPoint &screenPosition, const ViewportParams *viewport) const override;
35
36 void setLinearRing(GeoDataLinearRing *ring);
37 void setPolygon(GeoDataPolygon *polygon);
38
39 static const void *s_previousStyle;
40
41protected:
42 bool configurePainter(GeoPainter *painter, const ViewportParams &viewport) const;
43 inline const GeoDataPolygon *polygon() const
44 {
45 return m_polygon;
46 }
47 inline const GeoDataLinearRing *ring() const
48 {
49 return m_ring;
50 }
51 inline const GeoDataBuilding *building() const
52 {
53 return m_building;
54 }
55
56 static int extractElevation(const GeoDataPlacemark &placemark);
57
58private:
59 QPixmap texture(const QString &path, const QColor &color) const;
60
61 const GeoDataPolygon *m_polygon;
62 const GeoDataLinearRing *m_ring;
63 const GeoDataBuilding *const m_building;
64};
65
66}
67
68#endif
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.