-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppWindow.h
147 lines (120 loc) · 3.21 KB
/
AppWindow.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
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
/****************************************************************************
AppWindow class header
****************************************************************************/
#ifndef AppWindow_H
#define AppWindow_H
#include <QMainWindow>
#include <QLabel>
#include <QPrinter>
#include <QtGui>
#include <QRect>
#include <QDesktopWidget>
#include <QMatrix>
#include <QToolBar>
#include <math.h>
#include "FilmWidget.h"
#include "AppConfig.h"
#include "LogWidget.h"
#include "ui_GeometryDialog.h"
#include "ui_ImageDialog.h"
#define VERSION "2010-06-21 beta"
class AppWindow : public QMainWindow
{
Q_OBJECT
public:
AppWindow(AppConfig &_appConfig);
~AppWindow();
protected:
void keyPressEvent(QKeyEvent* );
void keyReleaseEvent(QKeyEvent* );
private slots:
void openFilm();
void showPrefs();
void showGeometry();
void updateGeometryValues();
void resetGeometry();
void applyGeometry();
void updateOthersFromCenters();
void updateCentersFromOthers();
void updateActiveGeometryElements();
void zoomIn();
void zoomOut();
void normalSize();
void fitToWindow();
void changeDPI();
void integrate();
void optimize();
void crop();
void deskew();
void showTwoThetaWindow();
void showLogWindow();
void showAboutWindow();
void showImageDialog() { imageDialog->show(); }
void toggleMove(bool b);
void toggleResize(bool b);
void toggleExclude(bool b);
void updateImageDialog();
void updateImage();
void applyAlphaRotation() { gandolfiFilm->rotate(-UiGeo.sbAlpha->value()); gandolfiFilm->getGeometry()->alpha = 0.0; this->updateGeometryValues(); }
private:
void createActions();
void createMenus();
void createToolBar();
void updateActions();
void scaleImage(double factor);
void adjustScrollBar(QScrollBar *scrollBar, double factor);
FilmWidget *gandolfiFilm;
QScrollArea *scrollArea;
LogWidget *log;
QPrinter printer;
//QToolButton *btnRegion;
QToolButton *btnMove;
QToolButton *btnResize;
QToolButton *btnExclude;
//QPoint lastUpperCenter;
//QPoint lastLowerCenter;
// File menu actions
QAction *openAct;
QAction *saveTIFFAct;
QAction *saveCSVAct;
QAction *saveUDFAct;
QAction *closeAct;
QAction *exitAct;
QAction *prefsAct;
// View menu actions
QAction *zoomInAct;
QAction *zoomOutAct;
QAction *normalSizeAct;
QAction *fitToWindowAct;
// Image menu actions
QAction *cropAct;
QAction *deskewAct;
QAction *invertAct;
QAction *rotateAct;
QAction *imageAct;
QAction *dpiAct;
// Tools menu actions
QAction *integrateAct;
QAction *optimizeAct;
// Window menu actions
QAction *showAppWindowAct;
QAction *showTwoThetaWindowAct;
QAction *showLogDockAct;
QAction *showAboutWindowAct;
QMenu *fileMenu;
QMenu *viewMenu;
QMenu *toolsMenu;
QMenu *windowMenu;
QToolBar *toolbar;
Ui::GeometryDialog UiGeo;
Ui::ImageDialog UiImage;
QDockWidget *geoDockWidget;
QDockWidget *logDockWidget;
QDialog *geoDialog;
QDialog *imageDialog;
bool moveActive;
bool resizeActive;
bool excludeActive;
AppConfig *appConfig;
};
#endif