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
16#include <QObject>
17#include "LayerInterface.h"
18
19#include <QVector>
20#include <QPainter>
21
22#include "PlacemarkLayout.h"
23
26class QString;
27
28namespace Marble
29{
30
31class GeoPainter;
32class GeoSceneLayer;
33class MarbleClock;
34class ViewportParams;
35class StyleBuilder;
36
37
38struct Fragment
39{
41 QPixmap pixmap;
42};
43
44class PlacemarkLayer : public QObject, public LayerInterface
45{
47
48 public:
49 PlacemarkLayer( QAbstractItemModel *placemarkModel,
50 QItemSelectionModel *selectionModel,
51 MarbleClock *clock,
52 const StyleBuilder *styleBuilder,
53 QObject *parent = nullptr );
54 ~PlacemarkLayer() override;
55
56 /**
57 * @reimp
58 */
59 QStringList renderPosition() const override;
60
61 /**
62 * @reimp
63 */
64 qreal zValue() const override;
65
66 /**
67 * @reimp
68 */
69 bool render( GeoPainter *painter, ViewportParams *viewport,
70 const QString &renderPos = QLatin1String("NONE"),
71 GeoSceneLayer *layer = nullptr ) override;
72
73 RenderState renderState() const override;
74
75 QString runtimeTrace() const override;
76
77 /**
78 * Returns a list of model indexes that are at position @p pos.
79 */
80 QVector<const GeoDataFeature *> whichPlacemarkAt( const QPoint &pos );
81
82 bool hasPlacemarkAt(const QPoint &pos);
83
84 bool isDebugModeEnabled() const;
85 void setDebugModeEnabled(bool enabled);
86
87 void setLevelTagDebugModeEnabled(bool enabled);
88 bool levelTagDebugModeEnabled() const;
89 void setDebugLevelTag(int level);
90
91 public Q_SLOTS:
92 // earth
93 void setShowPlaces( bool show );
94 void setShowCities( bool show );
95 void setShowTerrain( bool show );
96 void setShowOtherPlaces( bool show );
97
98 // other planets
99 void setShowLandingSites( bool show );
100 void setShowCraters( bool show );
101 void setShowMaria( bool show );
102
103 void requestStyleReset();
104 void setTileLevel(int tileLevel);
105
106 Q_SIGNALS:
107 void repaintNeeded();
108
109 private:
110 void renderDebug(GeoPainter *painter, ViewportParams *viewport, const QVector<VisiblePlacemark*> & placemarks) const;
111
112 PlacemarkLayout m_layout;
113 bool m_debugModeEnabled;
114 bool m_levelTagDebugModeEnabled;
115 int m_tileLevel;
116 int m_debugLevelTag;
117};
118
119}
120
121#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
T qobject_cast(QObject *object)
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.