-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathalgorithmwidget.h
82 lines (67 loc) · 2.13 KB
/
algorithmwidget.h
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
#ifndef TVSEG_UI_ALGORITHMWIDGET_H
#define TVSEG_UI_ALGORITHMWIDGET_H
#include "cvimagedisplaywidget.h"
#include "settingseditor.h"
#include "tvseg/cvalgorithminterface.h"
#include "tvseg/cvalgorithminterfacebase.h"
#include <QWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QSignalMapper>
#include <QFutureWatcher>
#include <QComboBox>
namespace tvseg_ui {
class AlgorithmWidget : public QWidget
{
Q_OBJECT
public:
explicit AlgorithmWidget(QWidget *parent = 0);
void addAlgorithm(const tvseg::CVAlgorithmInterface *algorithmInterface);
void clear();
void updateFromSettings();
void addPreset(QString name);
signals:
void algorithmStarted();
void algorithmStopped();
void saveResult();
void runAll();
void computeMetrics();
void setPreset(QString name);
public slots:
void computeButtonClicked(int id);
void clearButtonClicked(int id);
void showButtonClicked(int id);
void settingsValueChanged(QtProperty* property, QVariant value);
private slots:
void algorithmCompleted();
void setPresetClicked();
private:
void clearActions();
private:
CvImageDisplayWidget *display_;
QVBoxLayout *sidePane_;
QGroupBox *actionsGroup_;
QGridLayout *groupLayout_;
SettingsEditor *settingsEditor_;
QSignalMapper *computeButtonMapper_;
QSignalMapper *clearButtonMapper_;
QSignalMapper *showButtonMapper_;
QVector<QPushButton*> clearButtons_;
QVector<QPushButton*> showButtons_;
QVector<tvseg::CVAlgorithmInterface::Action> actions_;
QVector<tvseg::CVAlgorithmInterfaceBase> algorithms_;
QMap<QtProperty*,QPair<int,int> > propertyMap_; // pair of (algoId, firstActionId)
QFutureWatcher<void> *watcher_;
int runningAction_;
QVector<QString> settingsInSetup_; // list of settings entries being currenlty set up
QPushButton *runAllButton_;
QPushButton *saveResultButton_;
QPushButton *computeMetricsButton_;
QGroupBox *commandsGroup_;
QGroupBox *presetsGroup_;
QComboBox *presetsComboBox_;
QPushButton *presetsSetButton_;
};
} // namespace tvseg_ui
#endif // TVSEG_UI_ALGORITHMWIDGET_H