-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.h
81 lines (72 loc) · 2.12 KB
/
MainWindow.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
/*
* MainWindow.h
*
* Created on: Jun 2, 2010
* Author: Vincent
*/
#ifndef MAINWINDOW_H_
#define MAINWINDOW_H_
#include "ui_MainWindow.h"
#include "Processor.h"
#include "Patch.h"
class QPlainTextEdit;
class MainWindow: public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget * parent = 0);
virtual ~MainWindow();
public slots:
void showStatus(const QString & message);
void updatePatchType();
void on_imageScaleSpin_valueChanged(double scale);
void on_rowColButton_clicked();
void on_actionLoadImage_triggered();
void on_actionLoadProject_triggered();
void on_actionSaveProject_triggered();
void on_actionExportCurrentMatrix_triggered();
void on_canvasSensitivitySlider_valueChanged(int sensitivityValue);
void on_canvasScaleSlider_valueChanged(int scaleValue);
void on_actionInvertImage_triggered();
void on_actionApplyMask_triggered();
void on_actionToggleMask_triggered();
void on_actionResetView_triggered();
void on_actionWhiteBackground_toggled(bool white);
void on_canvasZScaleSlider_valueChanged(int scale);
void updateTypeLabels();
void updateProcessorStartPoint();
void updateProcessorEndPoint();
void updateInspector();
void updateProcessor();
void updateMatrix();
void displayMatrix(const RealMatrix & matrix);
void log(const QString & message);
void calculateAverages();
void updateChannel();
protected:
void closeEvent(QCloseEvent * event);
void initProject();
bool eventFilter(QObject * watched, QEvent * event);
// Transform to real coordinate
inline qint32 trc(qint32 x, double factor);
// Transform to screen coordinate
inline qint32 tsc(qint32 x, double factor);
private:
static QString getFormatName(QImage::Format format);
QStringList getResidues(QPlainTextEdit * edit) const;
void loadSettings();
void saveSettings();
void makeConnections();
// void debugMatrix(const RealMatrix * matrix);
// void debug(const QString &message);
private:
Ui::MainWindow ui;
Processor processor;
qint32 transientPeriod;
Patch::PatchType patchType;
QPolygon patchPolygon;
QString lastImagePath;
QString lastProjectPath;
QString lastExportPath;
bool imageMasked;
};
#endif /* MAINWINDOW_H_ */