Marble

GeometryLayer.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
4 // SPDX-FileCopyrightText: 2010 Thibaut Gridel <[email protected]>
5 // SPDX-FileCopyrightText: 2011-2012 Bernhard Beschow <[email protected]>
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 
16 class QAbstractItemModel;
17 class QModelIndex;
18 class QPoint;
19 
20 namespace Marble
21 {
22 class GeoPainter;
23 class GeoDataFeature;
24 class GeoDataPlacemark;
25 class GeoDataRelation;
26 class StyleBuilder;
27 class ViewportParams;
28 
29 class GeometryLayerPrivate;
30 
31 class GeometryLayer : public QObject, public LayerInterface
32 {
33  Q_OBJECT
34 public:
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 
64 public 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 
81 Q_SIGNALS:
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 
93 private:
94  GeometryLayerPrivate *d;
95 };
96 
97 } // namespace Marble
98 #endif // MARBLE_GEOMETRYLAYER_H
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
Binds a QML item to a specific geodetic location in screen coordinates.
Q_SIGNALSQ_SIGNALS
Unit
enum used constructor to specify the units used
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.