FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
Loading...
Searching...
No Matches
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 <QHashIterator>
10#include <QMessageBox>
11#include <QRandomGenerator>
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 int actions;
27 const QStringList columns;
28
29 public:
30 Data();
31 explicit Data(const QString &dataPath);
32 Data(const Data &T);
33 Data &operator=(const Data &T) = delete;
34 Data &operator=(Data &&T) = delete;
35 Data(Data &&T) = delete;
36 ~Data();
37
38 QString dir;
39 const QString connectionName;
40 bool setPath(const QString &dataPath);
41 QHash<QString, double> getData(int imageIndex, int id) const;
42 QList<QHash<QString, double>> getData(int imageIndex) const;
43 QList<QHash<QString, double>> getData(int imageIndexStart, int imageIndexStop, int id) const;
44 QHash<QString, QList<double>> getDataId(int id) const;
45 QList<int> getId(int imageIndex) const;
46 QList<int> getId(int imageIndexFirst, int imageIndexLast) const;
47 int getObjectInformation(int objectId) const;
48 void swapData(int firstObject, int secondObject, int from);
49 void deleteData(int objectId, int from, int to);
50 void insertData(int objectId, int from, int to);
51 void save(bool force = true, int eachActions = 30);
52 void clear();
53 int maxId;
54 int maxFrameIndex;
55 bool isEmpty;
56};
57
58class SwapData : public QUndoCommand {
59 public:
60 SwapData(int firstObject, int secondObject, int from, Data *data);
61 void undo() override;
62 void redo() override;
63
64 private:
65 int m_firstObject;
66 int m_secondObject;
67 int m_from;
68 Data *m_data;
69};
70
71class DeleteData : public QUndoCommand {
72 public:
73 DeleteData(int object, int from, int to, Data *data);
74 void undo() override;
75 void redo() override;
76
77 private:
78 int m_object;
79 int m_from;
80 int m_to;
81 Data *m_data;
82};
83#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:299
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:260
QList< int > getId(int imageIndex) const
Get the ids of all the objects in the frame.
Definition data.cpp:200
QHash< QString, QList< double > > getDataId(int id) const
Get the tracking data for the selected id.
Definition data.cpp:177
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:105
QString dir
Definition data.h:38
int getObjectInformation(int objectId) const
Get the object's information.
Definition data.cpp:241
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:277
void save(bool force=true, int eachActions=30)
Save the data in the tracking result file.
Definition data.cpp:320
Data()
Construct the data object from a tracking result file.
Definition data.cpp:95