-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathControllerCommands.h
More file actions
96 lines (79 loc) · 3.42 KB
/
ControllerCommands.h
File metadata and controls
96 lines (79 loc) · 3.42 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
#ifndef CONTROLLERCOMMANDS_H
#define CONTROLLERCOMMANDS_H
#pragma once
#include "IControllerCfg.h"
#include "Interfaces/IModel/IModelTrackedTrajectory.h"
#include "Model/UndoCommands/TrackCommands.h"
#include "QUndoStack"
#include "QUndoView"
/**
* This class inherits from IController.
* http://doc.qt.io/qt-5/qundo.html
* The commands component controls the commands on an undo/redo stack (model)
* and the undo view
*/
class ControllerCommands : public IControllerCfg
{
Q_OBJECT
public:
ControllerCommands(
QObject* parent = 0,
IBioTrackerContext* context = 0,
ENUMS::CONTROLLERTYPE ctr = ENUMS::CONTROLLERTYPE::NO_CTR);
virtual ~ControllerCommands();
signals:
// signal to ctrPlugin to remove trajectory
void emitRemoveTrajectory(IModelTrackedTrajectory* trajectory);
void emitRemoveTrajectoryId(int id);
// signal to ctrPlugin to remove track entity
void emitRemoveTrackEntity(IModelTrackedTrajectory* trajectory,
uint frameNumber);
// signal to ctrPlugin to add trajectory
void emitAddTrajectory(QPoint pos);
void emitValidateTrajectory(int id);
void emitValidateEntity(IModelTrackedTrajectory* trajectory,
uint frameNumber);
void emitMoveElement(IModelTrackedTrajectory* trajectory,
uint frameNumber,
QPoint pos,
int toMove);
void emitSwapIds(IModelTrackedTrajectory* trajectory0,
IModelTrackedTrajectory* trajectory1);
void emitToggleFixTrack(IModelTrackedTrajectory* trajectory, bool toggle);
void emitEntityRotation(IModelTrackedTrajectory* trajectory,
double angleDeg,
uint frameNumber);
public slots:
void receiveAddTrackCommand(QPoint pos, int id);
void receiveRemoveTrackCommand(IModelTrackedTrajectory* traj);
void receiveRemoveTrackEntityCommand(IModelTrackedTrajectory* traj,
uint frameNumber);
void receiveMoveElementCommand(IModelTrackedTrajectory* traj,
QPoint oldPos,
QPoint newPos,
uint frameNumber,
int toMove);
void receiveSwapIdCommand(IModelTrackedTrajectory* traj0,
IModelTrackedTrajectory* traj1);
void receiveFixTrackCommand(IModelTrackedTrajectory* traj, bool toggle);
void receiveEntityRotation(IModelTrackedTrajectory* traj,
double oldAngleDeg,
double newAngleDeg,
uint frameNumber);
void receiveUndo();
void receiveRedo();
void receiveClear();
void receiveShowActionList();
// IController interface
public:
void connectControllerToController() override;
protected:
void createModel() override;
void createView() override;
void connectModelToController() override;
// member
private:
QUndoStack* _undoStack;
QUndoView* _undoView;
};
#endif // CONTROLLERCOMMANDS_H