Marble

PlacemarkLayer.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007-2008 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6//
7
8//
9// PlacemarkLayer is responsible for drawing the Placemarks on the map
10//
11
12#ifndef MARBLE_PLACEMARKLAYER_H
13#define MARBLE_PLACEMARKLAYER_H
14
15#include "LayerInterface.h"
16#include <QObject>
17
18#include <QList>
19#include <QPainter>
20
21#include "PlacemarkLayout.h"
22
25class QString;
26
27namespace Marble
28{
29
30class GeoPainter;
31class GeoSceneLayer;
32class MarbleClock;
33class ViewportParams;
34class StyleBuilder;
35
36struct Fragment {
38 QPixmap pixmap;
39};
40
41class PlacemarkLayer : public QObject, public LayerInterface
42{
44
45public:
46 PlacemarkLayer(QAbstractItemModel *placemarkModel,
47 QItemSelectionModel *selectionModel,
48 MarbleClock *clock,
49 const StyleBuilder *styleBuilder,
50 QObject *parent = nullptr);
51 ~PlacemarkLayer() override;
52
53 /**
54 * @reimp
55 */
56 QStringList renderPosition() const override;
57
58 /**
59 * @reimp
60 */
61 qreal zValue() const override;
62
63 /**
64 * @reimp
65 */
66 bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos = QLatin1String("NONE"), GeoSceneLayer *layer = nullptr) override;
67
68 RenderState renderState() const override;
69
70 QString runtimeTrace() const override;
71
72 /**
73 * Returns a list of model indexes that are at position @p pos.
74 */
75 QList<const GeoDataFeature *> whichPlacemarkAt(const QPoint &pos);
76
77 bool hasPlacemarkAt(const QPoint &pos);
78
79 bool isDebugModeEnabled() const;
80 void setDebugModeEnabled(bool enabled);
81
82 void setLevelTagDebugModeEnabled(bool enabled);
83 bool levelTagDebugModeEnabled() const;
84 void setDebugLevelTag(int level);
85
86public Q_SLOTS:
87 // earth
88 void setShowPlaces(bool show);
89 void setShowCities(bool show);
90 void setShowTerrain(bool show);
91 void setShowOtherPlaces(bool show);
92
93 // other planets
94 void setShowLandingSites(bool show);
95 void setShowCraters(bool show);
96 void setShowMaria(bool show);
97
98 void requestStyleReset();
99 void setTileLevel(int tileLevel);
100
102 void repaintNeeded();
103
104private:
105 void renderDebug(GeoPainter *painter, ViewportParams *viewport, const QList<VisiblePlacemark *> &placemarks) const;
106
107 PlacemarkLayout m_layout;
108 bool m_debugModeEnabled;
109 bool m_levelTagDebugModeEnabled;
110 int m_tileLevel;
111 int m_debugLevelTag;
112};
113
114}
115
116#endif
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() 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:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.