From 7fbe0814d52ba861a02b0560d4e6872845ef241e Mon Sep 17 00:00:00 2001 From: ccolin Date: Tue, 22 Dec 2020 13:15:23 +0100 Subject: initial commit --- src/drone_controller.hh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/drone_controller.hh (limited to 'src/drone_controller.hh') diff --git a/src/drone_controller.hh b/src/drone_controller.hh new file mode 100644 index 0000000..484cd57 --- /dev/null +++ b/src/drone_controller.hh @@ -0,0 +1,57 @@ +#ifndef DRONE_CONTROLLER_HH +#define DRONE_CONTROLLER_HH + +#include +#include +#include + + +struct Waypoint { + int frame; + QVector3D pos; + + Waypoint(unsigned frame, QVector3D pos); + Waypoint(const QJsonObject &json); +}; + + +class Drone { + QVector waypoints; + +public: + Drone(const QJsonObject &json); + const QVector getWaypoints() const; +}; + + +class DroneController : public QObject { + Q_OBJECT + + int framerate; + int frame = 0; + int duration = 0; + QVector drones; + QTimer timer; + bool paused = true; + +public: + DroneController(const QJsonObject &json); + ~DroneController(); + int getDuration() const; + +signals: + void frameChanged(int frame); + +private slots: + void step(); + +public slots: + void play(); + void pause(); + void suspend(); + void resume(); + void seek(int frame); +}; + + +#endif -- cgit v1.2.3-70-g09d2