forked from kmkolasinski/AwesomeBump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
194 lines (152 loc) · 4.82 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSettings>
#include <QFileDialog>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QDir>
#include "CommonObjects.h"
class QAction;
class QLabel;
class GLWidget;
class GLImage;
class FormImageProp;
class FormMaterialIndicesManager;
class FormSettingsContainer;
class DockWidget3DSettings;
class Dialog3DGeneralSettings;
class DialogLogger;
class DialogShortcuts;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
QSize sizeHint() const;
~MainWindow();
protected:
void closeEvent(QCloseEvent *event);
void resizeEvent(QResizeEvent* event);
void showEvent(QShowEvent* event);
signals:
void initProgress(int perc);
void initMessage(const QString &msg);
public slots:
void aboutQt();
void about();
void initializeApp();
void initializeGL();
void initializeImages();
void saveImages();
void saveCheckedImages();
void saveCompressedForm();
void saveSettings();
void changeGUIFontSize(int);
// loading the application setting from ini file
void loadSettings();
// the same as above but Image is choosen by proper switch using the given type
void loadImageSettings(TextureTypes type);
void showSettingsManager();
void setOutputFormat(int index);
void replotAllImages();
void materialsToggled(bool toggle);
void checkWarnings();
// repaint views after selecting tab
void selectDiffuseTab();
void selectNormalTab();
void selectSpecularTab();
void selectHeightTab();
void selectOcclusionTab();
void selectRoughnessTab();
void selectMetallicTab();
void selectMaterialsTab();
void selectGrungeTab();
void selectGeneralSettingsTab();
void selectUVsTab();
void fitImage();// resize 2D image
// disabling textures
void showHideTextureTypes(bool);
// repaint views after changes
void updateDiffuseImage();
void updateNormalImage();
void updateSpecularImage();
void updateHeightImage();
void updateOcclusionImage();
void updateRoughnessImage();
void updateMetallicImage();
void updateGrungeImage();
// repaint selected tab
void updateImage(int tab);
void updateImageInformation();
// image properties
void changeWidth (int size); // change the combobox index
void changeHeight(int size);
void scaleWidth(double);
void scaleHeight(double);
void applyResizeImage();
void applyResizeImage(int width, int height);
void applyScaleImage();
void applyCurrentUVsTransformations();// copy current image to diffuse and convert to others
// Setting the global parameters
void updateSpinBoxes(int);
void selectShadingModel(int i);
// Conversion functions
void convertFromHtoN();
void convertFromNtoH();
void convertFromBase();
void convertFromHNtoOcc();
// UV tools
void updateSliders();
// Perspective tool
void resetTransform();
void setUVManipulationMethod();
void selectSeamlessMode(int mode);
void randomizeAngles();// in random mode
void resetRandomPatches();
void selectContrastInputImage(int mode);
// batch tool
void selectSourceImages();
void selectOutputPath();
void runBatch();
private:
// saves all textures to given directory
bool saveAllImages(const QString &dir);
// Pointers
Ui::MainWindow *ui;
GLWidget* glWidget;
GLImage* glImage;
bool bSaveCheckedImages;
bool bSaveCompressedFormImages;
QDir recentDir;
QDir recentMeshDir; // path to last loaded OBJ Mesh folder
FormImageProp* diffuseImageProp;
FormImageProp* normalImageProp;
FormImageProp* specularImageProp;
FormImageProp* heightImageProp;
FormImageProp* occlusionImageProp;
FormImageProp* roughnessImageProp;
FormImageProp* metallicImageProp;
FormImageProp* grungeImageProp;
// Material manager
FormMaterialIndicesManager* materialManager;
// Settings container
FormSettingsContainer *settingsContainer;
QtnPropertySetAwesomeBump* abSettings;// use qtn to keep all settings in one place
// 3D settings manager
DockWidget3DSettings *dock3Dsettings;
// 3D shading & display settings dialog
Dialog3DGeneralSettings* dialog3dGeneralSettings;
QAction *aboutQtAction;
QAction *aboutAction;
QAction *logAction; // show logger
QAction *shortcutsAction; // show key shortcuts
QLabel *statusLabel;
DialogLogger* dialogLogger;
DialogShortcuts* dialogShortcuts;
QSettings defaults;
};
#endif // MAINWINDOW_H