Marble

GeoGraphicsScene.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Bastian Holst <[email protected]>
4 // SPDX-FileCopyrightText: 2011 Konstantin Oblaukhov <[email protected]>
5 //
6 
7 #ifndef MARBLE_GEOGRAPHICSSCENE_H
8 #define MARBLE_GEOGRAPHICSSCENE_H
9 
10 #include "marble_export.h"
11 #include "MarbleGlobal.h"
12 
13 #include <QObject>
14 #include <QList>
15 
16 namespace Marble
17 {
18 
19 class GeoGraphicsItem;
20 class GeoDataFeature;
21 class GeoDataLatLonBox;
22 class GeoGraphicsScenePrivate;
23 class GeoDataPlacemark;
24 
25 /**
26  * @short This is the home of all GeoGraphicsItems to be shown on the map.
27  */
28 class MARBLE_EXPORT GeoGraphicsScene : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  /**
34  * Creates a new instance of GeoGraphicsScene
35  * @param parent the QObject parent of the Scene
36  */
37  explicit GeoGraphicsScene( QObject *parent = nullptr );
38  ~GeoGraphicsScene() override;
39 
40  /**
41  * @brief Add an item to the GeoGraphicsScene
42  * Adds the item @p item to the GeoGraphicsScene
43  */
44  void addItem( GeoGraphicsItem *item );
45 
46  /**
47  * @brief Remove all concerned items from the GeoGraphicsScene
48  * Removes all items which are associated with @p object from the GeoGraphicsScene
49  */
50  void removeItem( const GeoDataFeature *feature );
51 
52  /**
53  * @brief Remove all items from the GeoGraphicsScene
54  */
55  void clear();
56 
57  /**
58  * @brief Get the list of items in the specified Box
59  *
60  * @param box The box around the items.
61  * @param maxZoomLevel The max zoom level of tiling
62  * @return The list of items in the specified box in no specific order.
63  */
64  QList<GeoGraphicsItem *> items( const GeoDataLatLonBox &box, int maxZoomLevel ) const;
65 
66  /**
67  * @brief Get the list of items which belong to a placemark
68  * that has been clicked.
69  * @return Returns a list of selected Items
70  */
71  QList<GeoGraphicsItem*> selectedItems() const;
72 
73  void resetStyle();
74 
75 public Q_SLOTS:
76  void applyHighlight( const QVector<GeoDataPlacemark*>& );
77 
78 Q_SIGNALS:
79  void repaintNeeded();
80 
81 private:
82  GeoGraphicsScenePrivate * const d;
83 };
84 }
85 #endif // MARBLE_GEOGRAPHICSSCENE_H
This is the home of all GeoGraphicsItems to be shown on the map.
A base class for all geodata features.
A class that defines a 2D bounding box for geographic data.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.