-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathControllerMainWindow.h
More file actions
155 lines (137 loc) · 5 KB
/
Copy pathControllerMainWindow.h
File metadata and controls
155 lines (137 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/****************************************************************************
**
** This file is part of the BioTracker Framework
** by Andreas Jörg
**
****************************************************************************/
#ifndef CONTROLLERMAINWINDOW_H
#define CONTROLLERMAINWINDOW_H
#include "IControllerCfg.h"
#include "QPointer"
#include "QStringListModel"
#include "boost/filesystem.hpp"
#include <vector>
#include "util/types.h"
#include "util/camera/base.h"
/**
* The ControllerMainWindow class controlls the IView class MainWindow.
* All user interactions done through the MainWindow class are delegated to the
* controllers of the component that concerns them. Other components can place
* their IView Widgets on the MainWindow.
*/
class ControllerMainWindow : public IControllerCfg
{
Q_OBJECT
public:
ControllerMainWindow(
QObject* parent = 0,
IBioTrackerContext* context = 0,
ENUMS::CONTROLLERTYPE ctr = ENUMS::CONTROLLERTYPE::NO_CTR);
/**
* Receives the a string containing the video file path from the MainWindow
* class. The string is then given to the ControllerPlayer class of the
* MediaPlayer-Component.
*/
void loadVideo(std::vector<boost::filesystem::path> files);
/**
* Receives the a string containing the Plugin file path from the
* MainWindow class. The string is then given to the BioTrackerContext
* class which will hand it over to the ControllerPlugin class.
*/
void loadTracker(QString str);
/**
* Receives the a string containing the pictures file path from the
* MainWindow class. The string is then given to the ControllerPlayer class
* of the MediaPlayer-Component.
*/
void loadPictures(std::vector<boost::filesystem::path> files);
/**
* Receives the a string containing the camera device number from the
* MainWindow class. The string is then given to the ControllerPlayer class
* of the MediaPlayer-Component.
*/
void loadCameraDevice(CameraConfiguration conf);
/**
* Receives a QStringListModel with the names of all currently loades
* BioTracker Plugins from the ControllerPlugin class.
*/
void setTrackerList(QStringListModel* trackerList, QString current);
/**
* Embeds the Parameter Widget devined in the BioTracker Plugins into the
* MainWindow Widget.
*/
void setTrackerParamterWidget(IView* widget);
/**
* Embeds the view for visualization of tracking data devined in the
* BioTracker Plugins into the MainWindow Widget.
*/
void setTrackerElementsWidget(IView* widget);
/**
* Embeds the view for visualization of tracking data from the core app
* into the MainWindow Widget.
*/
void setCoreElementsWidget(IView* widget);
/**
* Embeds the the notification view of the core app into the MainWindow
* Widget.
*/
void setNotificationBrowserWidget(IView* widget);
void loadTrajectoryFile(std::string file);
void saveTrajectoryFile(std::string file);
void deactiveTrackingCheckBox();
void activeTrackingCheckBox();
// Passes exit command to the GUI context
void exit();
public:
signals:
void emitFinalizeExperiment();
void emitOnLoadPlugin(const std::string path);
void emitOnLoadMedia(const std::string path);
void emitPluginLoaded(const std::string path);
void emitMediaLoaded(const std::string path);
void emitTrackLoaded(const std::string path);
void emitUndoCommand();
void emitRedoCommand();
void emitClearUndoStack();
void emitShowActionListCommand();
// view toolbar actions
void emitAddTrack();
void emitDeleteSelectedTracks();
void emitSwapIds();
void emitSelectAll();
void emitChangeColorBorder();
void emitChangeColorFill();
void emitAddLabelAnno();
void emitAddRectAnno();
void emitAddArrAnno();
void emitAddEllAnno();
void emitDelSelAnno();
public slots:
void setCorePermission(std::pair<ENUMS::COREPERMISSIONS, bool> permission);
/**
* Receives the command for activating the Tracking in a BioTracker Plugin
* from the MainWindow class. This command is given to the ControllerPlayer
* class of the MediaPlayer-component.
*/
void activeTracking();
/**
* Receives the command for deactivating the Tracking in a BioTracker
* Plugin from the MainWindow class. This command is given to the
* ControllerPlayer class of the MediaPlayer-component.
*/
void deactiveTrackring();
void receiveSaveTrajData();
// IController interface
protected:
void createModel() override;
void createView() override;
void connectModelToController() override;
void connectControllerToController() override;
private slots:
void rcvSelectPlugin(QString plugin);
void receiveCursorPosition(QPoint pos);
private:
// Internal cleanup callback when a new video or imagestream is loaded.
void onNewMediumLoaded(const std::string path = "");
};
#endif // CONTROLLERMAINWINDOW_H