Marble

GeoGraphicsScene.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
4// SPDX-FileCopyrightText: 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com>
5//
6
7#ifndef MARBLE_GEOGRAPHICSSCENE_H
8#define MARBLE_GEOGRAPHICSSCENE_H
9
10#include "MarbleGlobal.h"
11#include "marble_export.h"
12
13#include <QList>
14#include <QObject>
15
16namespace Marble
17{
18
19class GeoGraphicsItem;
20class GeoDataFeature;
21class GeoDataLatLonBox;
22class GeoGraphicsScenePrivate;
23class GeoDataPlacemark;
24
25/**
26 * @short This is the home of all GeoGraphicsItems to be shown on the map.
27 */
28class MARBLE_EXPORT GeoGraphicsScene : public QObject
29{
30 Q_OBJECT
31
32public:
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
75public Q_SLOTS:
76 void applyHighlight(const QList<GeoDataPlacemark *> &);
77
78Q_SIGNALS:
79 void repaintNeeded();
80
81private:
82 GeoGraphicsScenePrivate *const d;
83};
84}
85#endif // MARBLE_GEOGRAPHICSSCENE_H
A base class for all geodata features.
A class that defines a 2D bounding box for geographic data.
This is the home of all GeoGraphicsItems to be shown on the map.
Binds a QML item to a specific geodetic location in screen coordinates.
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.