File indexing completed on 2024-04-28 07:38:00
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org> 0004 // 0005 0006 #ifndef MARBLE_MARBLEPHYSICS_H 0007 #define MARBLE_MARBLEPHYSICS_H 0008 0009 #include <QObject> 0010 0011 #include "MarbleGlobal.h" 0012 0013 namespace Marble 0014 { 0015 0016 class MarblePhysicsPrivate; 0017 class MarbleAbstractPresenter; 0018 class GeoDataLookAt; 0019 0020 class MarblePhysics : public QObject 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 /** 0026 * @brief Constructor 0027 * @param presenter the MarbleWidget that is being animated 0028 */ 0029 explicit MarblePhysics( MarbleAbstractPresenter *presenter ); 0030 0031 /** 0032 * @brief Destructor 0033 */ 0034 ~MarblePhysics() override; 0035 0036 /** 0037 * @brief Initiate an animation to the target according to the given mode. 0038 * @param target camera position indicating the target of the animation 0039 * @param mode animation mode; @code Instant @endcode means no animation 0040 */ 0041 void flyTo( const GeoDataLookAt &target, FlyToMode mode = Instant ); 0042 0043 private Q_SLOTS: 0044 void updateProgress(qreal progress); 0045 0046 /** 0047 * @brief Switch to still mode when an animation is finished 0048 */ 0049 void startStillMode(); 0050 0051 private: 0052 Q_DISABLE_COPY( MarblePhysics ) 0053 0054 MarblePhysicsPrivate* d; 0055 }; 0056 0057 } 0058 0059 #endif