hivemind 1.0.0
Loading...
Searching...
No Matches
keyframe_manager.h
Go to the documentation of this file.
1#pragma once
2
3#include "core/serializer.h"
4#include "core/types.h"
5
6#include <QObject>
7#include <vector>
8
10{
11
12 ///
13 /// \brief This is the class that manages keyframes
14 class KeyframeManager : public QObject,
15 JSON
16 {
17 Q_OBJECT
18
19 public:
20 ///
21 /// \brief Returns the singleton instance of the KeyframeManager
22 /// \return A reference to the singleton instance of the KeyframeManager
23 ///
24 static KeyframeManager&
26 {
27 static KeyframeManager instance;
28 return instance;
29 }
30
31 ///
32 /// \brief Adds a keyframe to the keyframe list using x, y, and z
33 /// coordinates
34 /// \param agentId The ID of the agent
35 /// \param timeStamp The timestamp of the keyframe
36 /// \param x The x coordinate
37 /// \param y The y coordinate
38 /// \param z The z coordinate
39 ///
40 void AddKeyframe(int agentId, float timeStamp, float x, float y,
41 float z);
42
43 ///
44 /// \brief Adds a keyframe to the keyframe list using a
45 /// CartesianCoordinate \param agentId The ID of the agent \param
46 /// timeStamp The timestamp of the keyframe \param position The
47 /// CartesianCoordinate representing the position
48 ///
49 void AddKeyframe(int agentId, float timeStamp,
51
52 ///
53 /// \brief Adds a keyframe object to the keyframe list
54 /// \param keyframe The keyframe object to add
55 ///
56 void AddKeyframe(Core::Keyframe& keyframe);
57
58 ///
59 /// \brief Removes a keyframe from the keyframe list
60 /// \param keyframe The keyframe to remove
61 ///
62 void RemoveKeyframe(const Core::Keyframe& keyframe);
63
64 ///
65 /// \brief Dumps keyframe information to the console for debugging
66 /// purposes
67 ///
68 void DebugDump(void) const;
69
70 ///
71 /// \brief Returns a reference to the list of keyframes
72 /// \return A reference to the list of keyframes
73 ///
74 inline std::vector<Core::Keyframe>&
76 {
77 return m_Keyframes;
78 }
79
80 signals:
82
83 private:
84 KeyframeManager() {} ///< Private constructor for singleton pattern
85
86 ~KeyframeManager() {} ///< Private destructor for singleton pattern
87
90
91 std::vector<Core::Keyframe> m_Keyframes;
92
96 };
97
98} // namespace KeyframeManagement
This is the class that manages keyframes.
void RemoveKeyframe(const Core::Keyframe &keyframe)
Removes a keyframe from the keyframe list.
void DebugDump(void) const
Dumps keyframe information to the console for debugging purposes.
~KeyframeManager()
Private destructor for singleton pattern.
static KeyframeManager & Instance()
Returns the singleton instance of the KeyframeManager.
KeyframeManager()
Private constructor for singleton pattern.
std::vector< Core::Keyframe > m_Keyframes
KeyframeManager(const KeyframeManager &)=delete
KeyframeManager & operator=(const KeyframeManager &)=delete
std::vector< Core::Keyframe > & GetKeyframes()
Returns a reference to the list of keyframes.
void AddKeyframe(int agentId, float timeStamp, float x, float y, float z)
Adds a keyframe to the keyframe list using x, y, and z coordinates.
#define JSONEND
Definition: serializer.h:590
#define JSONSTART
Definition: serializer.h:529
#define JSON
Macros To serialize an object you need to have the GetProperty() function in the object.
Definition: serializer.h:525
#define JSONMEMBERVECTOR(T, m)
Definition: serializer.h:581
A structure that represents a cartesian coordinate.
Definition: types.h:12
A structure representing an agent's position in cartesian space at a given point in time.
Definition: types.h:69