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 <QImage>
13#include <QColor>
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
44 const GeoDataPolygon *polygon() const { return m_polygon; }
45 inline
46 const GeoDataLinearRing *ring() const { return m_ring; }
47 inline
48 const GeoDataBuilding *building() const { return m_building; }
49
50 static int extractElevation(const GeoDataPlacemark &placemark);
51
52private:
53 QPixmap texture(const QString &path, const QColor &color) const;
54
55 const GeoDataPolygon * m_polygon;
56 const GeoDataLinearRing * m_ring;
57 const GeoDataBuilding *const m_building;
58};
59
60}
61
62#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 Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.