Marble

LayerManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2006-2008 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2011 Bernahrd Beschow <[email protected]>
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 
15 class QPoint;
16 class QString;
17 
18 namespace Marble
19 {
20 
21 class AbstractDataPlugin;
22 class AbstractDataPluginItem;
23 class GeoPainter;
24 class ViewportParams;
25 class RenderPlugin;
26 class RenderState;
27 class LayerInterface;
28 
29 /**
30  * @short Handles rendering of all active layers in the correct order
31  *
32  */
33 
34 class LayerManager : public QObject
35 {
36  Q_OBJECT
37 
38  public:
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  */
59  QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos ) const;
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 
75  Q_SIGNALS:
76  /**
77  * @brief Signal that a render item has been initialized
78  */
79  void renderPluginInitialized( RenderPlugin *renderPlugin );
80 
81  /**
82  * This signal is emitted when the settings of a plugin changed.
83  */
84  void pluginSettingsChanged();
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 
95  public Q_SLOTS:
96  void setShowBackground( bool show );
97 
98  void setShowRuntimeTrace( bool show );
99 
100  private:
101  Q_PRIVATE_SLOT( d, void updateVisibility( bool, const QString & ) )
102 
103  private:
105 
106  class Private;
107  friend class Private;
108  Private * const d;
109 };
110 
111 }
112 
113 #endif
Q_OBJECTQ_OBJECT
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.
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:38
void repaintNeeded(const QRegion &dirtyRegion=QRegion())
This signal is emitted when the repaint of the view was requested by a plugin.
Q_SLOTSQ_SLOTS
A public class that controls what is visible in the viewport of a Marble map.
Handles rendering of all active layers in the correct order.
Definition: LayerManager.h:34
void removeLayer(LayerInterface *layer)
Remove a layer from being included in rendering.
Binds a QML item to a specific geodetic location in screen coordinates.
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:88
Q_SIGNALSQ_SIGNALS
QList< AbstractDataPlugin * > dataPlugins() const
Returns a list of all DataPlugins on the layer.
Q_DISABLE_COPY(Class)
void renderPluginInitialized(RenderPlugin *renderPlugin)
Signal that a render item has been initialized.
void addLayer(LayerInterface *layer)
Add a layer to be included in rendering.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.