File indexing completed on 2024-12-08 06:35:36

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0004 //
0005 
0006 #ifndef ELEVATIONPROFILEMARKER_H
0007 #define ELEVATIONPROFILEMARKER_H
0008 
0009 #include "RenderPlugin.h"
0010 
0011 #include "BillboardGraphicsItem.h"
0012 #include "GeoDataCoordinates.h"
0013 #include "LabelGraphicsItem.h"
0014 
0015 
0016 namespace Marble
0017 {
0018 
0019 class GeoDataObject;
0020 class GeoDataPlacemark;
0021 
0022 class ElevationProfileMarker : public RenderPlugin
0023 {
0024     Q_OBJECT
0025     Q_PLUGIN_METADATA(IID "org.kde.marble.ElevationProfileMarker")
0026 
0027     Q_INTERFACES( Marble::RenderPluginInterface )
0028 
0029     MARBLE_PLUGIN( ElevationProfileMarker )
0030 
0031  public:
0032     explicit ElevationProfileMarker( const MarbleModel *marbleModel = nullptr );
0033     ~ElevationProfileMarker() override;
0034 
0035     QStringList backendTypes() const override;
0036 
0037     QString renderPolicy() const override;
0038 
0039     QStringList renderPosition() const override;
0040 
0041     qreal zValue() const override; // Overriding LayerInterface to paint on top of the route
0042 
0043     QString name() const override;
0044 
0045     QString guiString() const override;
0046 
0047     QString nameId() const override;
0048 
0049     QString version() const override;
0050 
0051     QString description() const override;
0052 
0053     QString copyrightYears() const override;
0054 
0055     QVector<PluginAuthor> pluginAuthors() const override;
0056 
0057     QIcon icon() const override;
0058 
0059     void initialize() override;
0060 
0061     bool isInitialized() const override;
0062 
0063     bool render( GeoPainter *painter, ViewportParams *viewport,
0064                  const QString &renderPos, GeoSceneLayer *layer = nullptr ) override;
0065 
0066  private Q_SLOTS:
0067     void onGeoObjectAdded( GeoDataObject *object );
0068     void onGeoObjectRemoved( GeoDataObject *object );
0069 
0070  private:
0071     GeoDataPlacemark *m_markerPlacemark;
0072     GeoDataCoordinates m_currentPosition;
0073 
0074     BillboardGraphicsItem m_markerItem;
0075     LabelGraphicsItem m_markerIcon;
0076     LabelGraphicsItem m_markerText;
0077 };
0078 
0079 
0080 }
0081 
0082 #endif // ELEVATIONPROFILEMARKER_H