Marble

RouteSimulationPositionProviderPlugin.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Konrad Enzensberger <e.konrad@mpegcode.com>
4// SPDX-FileCopyrightText: 2011 Dennis Nienhüser <nienhueser@kde.org>
5// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6//
7
8#ifndef MARBLE_ROUTESIMULATIONPOSITIONPROVIDERPLUGIN_H
9#define MARBLE_ROUTESIMULATIONPOSITIONPROVIDERPLUGIN_H
10
11#include "PositionProviderPlugin.h"
12
13#include "GeoDataLineString.h"
14#include "GeoDataCoordinates.h"
15
16#include <QDateTime>
17#include <QTimer>
18
19namespace Marble
20{
21
22class MarbleModel;
23
24class RouteSimulationPositionProviderPlugin: public PositionProviderPlugin
25{
28
29public:
30 explicit RouteSimulationPositionProviderPlugin(MarbleModel *marbleModel, QObject* parent=nullptr);
31 ~RouteSimulationPositionProviderPlugin() override;
32
33 // Implementing PluginInterface
34 QString name() const override;
35 QString nameId() const override;
36 QString guiString() const override;
37 QString version() const override;
38 QString description() const override;
39 QString copyrightYears() const override;
40 QVector<PluginAuthor> pluginAuthors() const override;
41 QIcon icon() const override;
42 void initialize() override;
43 bool isInitialized() const override;
44 qreal speed() const override;
45 qreal direction() const override;
46 QDateTime timestamp() const override;
47
48 // Implementing PositionProviderPlugin
49 PositionProviderPlugin * newInstance() const override;
50
51 // Implementing PositionProviderPluginInterface
52 PositionProviderStatus status() const override;
53 GeoDataCoordinates position() const override;
54 GeoDataAccuracy accuracy() const override;
55
56private Q_SLOTS:
57 /** Regular (each second) position and status update */
58 void update();
59 void updateRoute();
60
61private:
62 GeoDataCoordinates addNoise(const Marble::GeoDataCoordinates &,const Marble::GeoDataAccuracy &) const;
63 static qreal addNoise(qreal bearing);
64 void changeStatus(PositionProviderStatus status);
65
66 MarbleModel *const m_marbleModel;
67 int m_currentIndex;
68 PositionProviderStatus m_status;
69 GeoDataLineString m_lineString;
70 GeoDataLineString m_lineStringInterpolated;
71 GeoDataCoordinates m_currentPosition;
72 GeoDataCoordinates m_currentPositionWithNoise;
73 QDateTime m_currentDateTime;
74 qreal m_speed;
75 qreal m_direction;
76 qreal m_directionWithNoise;
77 QTimer m_updateTimer;
78};
79
80}
81
82#endif // MARBLE_ROUTESIMULATIONPOSITIONPROVIDERPLUGIN_H
A 3d point representation.
The interface for position provider plugins.
Binds a QML item to a specific geodetic location in screen coordinates.
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:03:13 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.