Marble

GeometryLayer.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
4// SPDX-FileCopyrightText: 2010 Thibaut Gridel <tgridel@free.fr>
5// SPDX-FileCopyrightText: 2011-2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6//
7
8#ifndef MARBLE_GEOMETRYLAYER_H
9#define MARBLE_GEOMETRYLAYER_H
10
11#include "GeoDataCoordinates.h"
12#include "GeoDataRelation.h"
13#include "LayerInterface.h"
14#include <QObject>
15
17class QModelIndex;
18class QPoint;
19
20namespace Marble
21{
22class GeoPainter;
23class GeoDataFeature;
24class GeoDataPlacemark;
25class GeoDataRelation;
26class StyleBuilder;
27class ViewportParams;
28
29class GeometryLayerPrivate;
30
31class GeometryLayer : public QObject, public LayerInterface
32{
34public:
35 explicit GeometryLayer(const QAbstractItemModel *model, const StyleBuilder *styleBuilder);
36 ~GeometryLayer() override;
37
38 QStringList renderPosition() const override;
39
40 bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos = QLatin1String("NONE"), GeoSceneLayer *layer = nullptr) override;
41
42 RenderState renderState() const override;
43
44 QString runtimeTrace() const override;
45
46 bool hasFeatureAt(const QPoint &curpos, const ViewportParams *viewport);
47
48 QList<const GeoDataFeature *> whichFeatureAt(const QPoint &curpos, const ViewportParams *viewport);
49
50 void highlightRouteRelation(qint64 osmId, bool enabled);
51
52 void setVisibleRelationTypes(GeoDataRelation::RelationTypes relationTypes);
53
54 void setLevelTagDebugModeEnabled(bool enabled);
55
56 bool levelTagDebugModeEnabled() const;
57
58 void setDebugLevelTag(int level);
59
60 int debugLevelTag() const;
61
62public Q_SLOTS:
63 void addPlacemarks(const QModelIndex &index, int first, int last);
64 void removePlacemarks(const QModelIndex &index, int first, int last);
65 void resetCacheData();
66 void setTileLevel(int tileLevel);
67
68 /**
69 * Finds all placemarks that contain the clicked point.
70 *
71 * The placemarks under the clicked position may
72 * have their styleUrl set to a style map which
73 * doesn't specify any highlight styleId. Such
74 * placemarks will be fletered out in GeoGraphicsScene
75 * and will not be highlighted.
76 */
77 void handleHighlight(qreal lon, qreal lat, GeoDataCoordinates::Unit unit);
78
80 void repaintNeeded();
81
82 /**
83 * @p selectedPlacemarks may contain placemarks which don't have
84 * their styleUrl set to id of the style map which specifies
85 * a highlight styleId. Such placemarks will be filtered out
86 * in GeoGraphicsScene which will query for placemark->styleUrl()
87 * to decide whether the placemark should be highlighted ot not.
88 */
89 void highlightedPlacemarksChanged(const QList<GeoDataPlacemark *> &clickedPlacemarks);
90
91private:
92 std::unique_ptr<GeometryLayerPrivate> d;
93};
94
95} // namespace Marble
96#endif // MARBLE_GEOMETRYLAYER_H
Unit
enum used constructor to specify the units used
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.