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 <QObject>
12#include "LayerInterface.h"
13#include "GeoDataCoordinates.h"
14#include "GeoDataRelation.h"
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,
41 const QString& renderPos = QLatin1String("NONE"),
42 GeoSceneLayer * layer = nullptr ) override;
43
44 RenderState renderState() const override;
45
46 QString runtimeTrace() const override;
47
48 bool hasFeatureAt(const QPoint& curpos, const ViewportParams * viewport);
49
50 QVector<const GeoDataFeature*> whichFeatureAt( const QPoint& curpos, const ViewportParams * viewport );
51
52 void highlightRouteRelation(qint64 osmId, bool enabled);
53
54 void setVisibleRelationTypes(GeoDataRelation::RelationTypes relationTypes);
55
56 void setLevelTagDebugModeEnabled(bool enabled);
57
58 bool levelTagDebugModeEnabled() const;
59
60 void setDebugLevelTag(int level);
61
62 int debugLevelTag() const;
63
64public Q_SLOTS:
65 void addPlacemarks( const QModelIndex& index, int first, int last );
66 void removePlacemarks( const QModelIndex& index, int first, int last );
67 void resetCacheData();
68 void setTileLevel(int tileLevel);
69
70 /**
71 * Finds all placemarks that contain the clicked point.
72 *
73 * The placemarks under the clicked position may
74 * have their styleUrl set to a style map which
75 * doesn't specify any highlight styleId. Such
76 * placemarks will be fletered out in GeoGraphicsScene
77 * and will not be highlighted.
78 */
79 void handleHighlight( qreal lon, qreal lat, GeoDataCoordinates::Unit unit );
80
82 void repaintNeeded();
83
84 /**
85 * @p selectedPlacemarks may contain placemarks which don't have
86 * their styleUrl set to id of the style map which specifies
87 * a highlight styleId. Such placemarks will be filtered out
88 * in GeoGraphicsScene which will query for placemark->styleUrl()
89 * to decide whether the placemark should be highlighted ot not.
90 */
91 void highlightedPlacemarksChanged( const QVector<GeoDataPlacemark*>& clickedPlacemarks );
92
93private:
94 GeometryLayerPrivate *d;
95};
96
97} // namespace Marble
98#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
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.