Marble

LayerManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2008 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2011 Bernahrd Beschow <bbeschow@cs.tu-berlin.de>
5//
6
7#ifndef MARBLE_LAYERMANAGER_H
8#define MARBLE_LAYERMANAGER_H
9
10// Qt
11#include <QList>
12#include <QObject>
13#include <QRegion>
14
15class QPoint;
16class QString;
17
18namespace Marble
19{
20
21class AbstractDataPlugin;
22class AbstractDataPluginItem;
23class GeoPainter;
24class ViewportParams;
25class RenderPlugin;
26class RenderState;
27class LayerInterface;
28
29/**
30 * @short Handles rendering of all active layers in the correct order
31 *
32 */
33
34class LayerManager : public QObject
35{
37
38public:
39 explicit LayerManager(QObject *parent = nullptr);
40 ~LayerManager() override;
41
42 void renderLayers(GeoPainter *painter, ViewportParams *viewport);
43
44 bool showBackground() const;
45
46 bool showRuntimeTrace() const;
47
48 void addRenderPlugin(RenderPlugin *renderPlugin);
49
50 /**
51 * @brief Returns a list of all DataPlugins on the layer
52 * @return the list of DataPlugins
53 */
55
56 /**
57 * @brief Returns all items of dataPlugins on the position curpos
58 */
60
61 /**
62 * @brief Add a layer to be included in rendering.
63 */
64 void addLayer(LayerInterface *layer);
65
66 /**
67 * @brief Remove a layer from being included in rendering.
68 */
69 void removeLayer(LayerInterface *layer);
70
71 QList<LayerInterface *> internalLayers() const;
72
73 RenderState renderState() const;
74
76 /**
77 * @brief Signal that a render item has been initialized
78 */
80
81 /**
82 * This signal is emitted when the settings of a plugin changed.
83 */
85
86 /**
87 * This signal is emitted when the repaint of the view was requested by a plugin.
88 * If available with the @p dirtyRegion which is the region the view will change in.
89 * If dirtyRegion.isEmpty() returns true, the whole viewport has to be repainted.
90 */
91 void repaintNeeded(const QRegion &dirtyRegion = QRegion());
92
93 void visibilityChanged(const QString &nameId, bool visible);
94
95public Q_SLOTS:
96 void setShowBackground(bool show);
97
98 void setShowRuntimeTrace(bool show);
99
100private:
101 Q_PRIVATE_SLOT(d, void updateVisibility(bool, const QString &))
102
103private:
104 Q_DISABLE_COPY(LayerManager)
105
106 class Private;
107 friend class Private;
108 Private *const d;
109};
110
111}
112
113#endif
A painter that allows to draw geometric primitives on the map.
Definition GeoPainter.h:86
Handles rendering of all active layers in the correct order.
void renderPluginInitialized(RenderPlugin *renderPlugin)
Signal that a render item has been initialized.
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
QList< AbstractDataPlugin * > dataPlugins() const
Returns a list of all DataPlugins on the layer.
QList< AbstractDataPluginItem * > whichItemAt(const QPoint &curpos) const
Returns all items of dataPlugins on the position curpos.
void pluginSettingsChanged()
This signal is emitted when the settings of a plugin changed.
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
void repaintNeeded(const QRegion &dirtyRegion=QRegion())
This signal is emitted when the repaint of the view was requested by a plugin.
The abstract class that creates a renderable item.
A public class that controls what is visible in the viewport of a Marble map.
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.