FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
data.h
1#ifndef DATA_H
2#define DATA_H
3
4#include <QApplication>
5#include <QDebug>
6#include <QDir>
7#include <QFile>
8#include <QHash>
9#include <QMap>
10#include <QMapIterator>
11#include <QMessageBox>
12#include <QSqlDatabase>
13#include <QSqlDriver>
14#include <QSqlError>
15#include <QSqlQuery>
16#include <QSqlRecord>
17#include <QString>
18#include <QTextStream>
19#include <QThread>
20#include <QUndoCommand>
21#include <QWidget>
22#include "tracking.h"
23
24class Data {
25 private:
26 QString dir;
27 int actions;
28
29 public:
30 Data();
31 explicit Data(const QString &dataPath);
32 Data(const Data &T) = delete;
33 Data &operator=(const Data &T) = delete;
34 ~Data();
35
36 bool setPath(const QString &dataPath);
37 QHash<QString, double> getData(int imageIndex, int id) const;
38 QList<QHash<QString, double>> getData(int imageIndex) const;
39 QHash<QString, QList<double>> getDataId(int id) const;
40 QList<int> getId(int imageIndex) const;
41 QList<int> getId(int imageIndexFirst, int imageIndexLast) const;
42 int getObjectInformation(int objectId) const;
43 void swapData(int firstObject, int secondObject, int from);
44 void deleteData(int objectId, int from, int to);
45 void insertData(int objectId, int from, int to);
46 void save(bool force = true, int eachActions = 30);
47 void clear();
48 int maxId;
49 int maxFrameIndex;
50 bool isEmpty;
51};
52
53class SwapData : public QUndoCommand {
54 public:
55 SwapData(int firstObject, int secondObject, int from, Data *data);
56 void undo() override;
57 void redo() override;
58
59 private:
60 int m_firstObject;
61 int m_secondObject;
62 int m_from;
63 Data *m_data;
64};
65
66class DeleteData : public QUndoCommand {
67 public:
68 DeleteData(int object, int from, int to, Data *data);
69 void undo() override;
70 void redo() override;
71
72 private:
73 int m_object;
74 int m_from;
75 int m_to;
76 Data *m_data;
77};
78#endif
This class allows to load tracking data produced by the Tracking class.
Definition: data.h:24
void insertData(int objectId, int from, int to)
Insert the tracking data for one object from a selected index to the end.
Definition: data.cpp:271
bool setPath(const QString &dataPath)
Set the path to a tracking data file.
Definition: data.cpp:55
void clear()
Clear data.
Definition: data.cpp:36
void swapData(int firstObject, int secondObject, int from)
In the tracking data, swaps two objects from a selected index to the end.
Definition: data.cpp:232
QList< int > getId(int imageIndex) const
Get the ids of all the objects in the frame.
Definition: data.cpp:173
QHash< QString, QList< double > > getDataId(int id) const
Get the tracking data for the selected id.
Definition: data.cpp:149
QHash< QString, double > getData(int imageIndex, int id) const
Get the tracking data at the selected image number for one selected object.
Definition: data.cpp:102
QString dir
Definition: data.h:26
int getObjectInformation(int objectId) const
Get the object's information.
Definition: data.cpp:213
void deleteData(int objectId, int from, int to)
Delete the tracking data of one object from a selected index to the end.
Definition: data.cpp:249
void save(bool force=true, int eachActions=30)
Save the data in the tracking result file.
Definition: data.cpp:292
Data()
Construct the data object from a tracking result file.
Definition: data.cpp:91
Definition: data.h:66
Definition: data.h:53