forked from arookas/Demolisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OBJExportDialog.cs
338 lines (310 loc) · 13 KB
/
OBJExportDialog.cs
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace Arookas.Demolisher
{
public class OBJExportDialog : Form
{
public bool ExportTextures
{
get
{
return this.chk_textures.Checked;
}
}
public ImageFormat TextureFormat
{
get
{
switch (this.cbx_textureformat.SelectedIndex)
{
case 1:
return ImageFormat.Tiff;
case 2:
return ImageFormat.Bmp;
case 3:
return ImageFormat.Jpeg;
}
return ImageFormat.Png;
}
}
public bool ExportGeometry
{
get
{
return this.chk_geometry.Checked;
}
}
public bool OnlyVisible
{
get
{
return this.chk_onlyvisible.Checked;
}
}
public bool IgnoreTransforms
{
get
{
return this.chk_transforms.Checked;
}
}
public bool SwapU
{
get
{
return this.chk_swapu.Checked;
}
}
public bool SwapV
{
get
{
return this.chk_swapv.Checked;
}
}
public OBJExportDialog()
{
this.InitializeComponent();
this.cbx_textureformat.SelectedIndex = 0;
}
private void chk_geometry_CheckedChanged(object sender, EventArgs e)
{
this.chk_onlyvisible.Enabled = (this.chk_transforms.Enabled = (this.chk_swapu.Enabled = (this.chk_swapv.Enabled = this.chk_geometry.Checked)));
}
private void chk_textures_CheckedChanged(object sender, EventArgs e)
{
this.lbl_textureformat.Enabled = (this.cbx_textureformat.Enabled = this.chk_textures.Checked);
}
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.btn_cancel = new System.Windows.Forms.Button();
this.btn_ok = new System.Windows.Forms.Button();
this.chk_textures = new System.Windows.Forms.CheckBox();
this.grp_geometry = new System.Windows.Forms.GroupBox();
this.chk_swapv = new System.Windows.Forms.CheckBox();
this.chk_onlyvisible = new System.Windows.Forms.CheckBox();
this.chk_swapu = new System.Windows.Forms.CheckBox();
this.chk_transforms = new System.Windows.Forms.CheckBox();
this.chk_geometry = new System.Windows.Forms.CheckBox();
this.grp_textures = new System.Windows.Forms.GroupBox();
this.cbx_textureformat = new System.Windows.Forms.ComboBox();
this.lbl_textureformat = new System.Windows.Forms.Label();
this.grp_geometry.SuspendLayout();
this.grp_textures.SuspendLayout();
this.SuspendLayout();
//
// btn_cancel
//
this.btn_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn_cancel.Location = new System.Drawing.Point(235, 282);
this.btn_cancel.Margin = new System.Windows.Forms.Padding(4);
this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(141, 28);
this.btn_cancel.TabIndex = 0;
this.btn_cancel.Text = "Cancel";
this.btn_cancel.UseVisualStyleBackColor = true;
//
// btn_ok
//
this.btn_ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_ok.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btn_ok.Location = new System.Drawing.Point(85, 282);
this.btn_ok.Margin = new System.Windows.Forms.Padding(4);
this.btn_ok.Name = "btn_ok";
this.btn_ok.Size = new System.Drawing.Size(141, 28);
this.btn_ok.TabIndex = 1;
this.btn_ok.Text = "OK";
this.btn_ok.UseVisualStyleBackColor = true;
//
// chk_textures
//
this.chk_textures.AutoSize = true;
this.chk_textures.Checked = true;
this.chk_textures.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk_textures.Location = new System.Drawing.Point(8, 23);
this.chk_textures.Margin = new System.Windows.Forms.Padding(4);
this.chk_textures.Name = "chk_textures";
this.chk_textures.Size = new System.Drawing.Size(124, 21);
this.chk_textures.TabIndex = 2;
this.chk_textures.Text = "Export textures";
this.chk_textures.UseVisualStyleBackColor = true;
//
// grp_geometry
//
this.grp_geometry.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.grp_geometry.Controls.Add(this.chk_swapv);
this.grp_geometry.Controls.Add(this.chk_onlyvisible);
this.grp_geometry.Controls.Add(this.chk_swapu);
this.grp_geometry.Controls.Add(this.chk_transforms);
this.grp_geometry.Controls.Add(this.chk_geometry);
this.grp_geometry.Location = new System.Drawing.Point(16, 137);
this.grp_geometry.Margin = new System.Windows.Forms.Padding(4);
this.grp_geometry.Name = "grp_geometry";
this.grp_geometry.Padding = new System.Windows.Forms.Padding(4);
this.grp_geometry.Size = new System.Drawing.Size(360, 138);
this.grp_geometry.TabIndex = 3;
this.grp_geometry.TabStop = false;
this.grp_geometry.Text = "Geometry";
this.grp_geometry.Enter += new System.EventHandler(this.grp_geometry_Enter);
//
// chk_swapv
//
this.chk_swapv.AutoSize = true;
this.chk_swapv.Checked = true;
this.chk_swapv.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk_swapv.Location = new System.Drawing.Point(111, 109);
this.chk_swapv.Margin = new System.Windows.Forms.Padding(4);
this.chk_swapv.Name = "chk_swapv";
this.chk_swapv.Size = new System.Drawing.Size(77, 21);
this.chk_swapv.TabIndex = 4;
this.chk_swapv.Text = "Swap V";
this.chk_swapv.UseVisualStyleBackColor = true;
//
// chk_onlyvisible
//
this.chk_onlyvisible.AutoSize = true;
this.chk_onlyvisible.Checked = true;
this.chk_onlyvisible.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk_onlyvisible.Location = new System.Drawing.Point(25, 52);
this.chk_onlyvisible.Margin = new System.Windows.Forms.Padding(4);
this.chk_onlyvisible.Name = "chk_onlyvisible";
this.chk_onlyvisible.Size = new System.Drawing.Size(151, 21);
this.chk_onlyvisible.TabIndex = 7;
this.chk_onlyvisible.Text = "Only visible objects";
this.chk_onlyvisible.UseVisualStyleBackColor = true;
//
// chk_swapu
//
this.chk_swapu.AutoSize = true;
this.chk_swapu.Location = new System.Drawing.Point(25, 109);
this.chk_swapu.Margin = new System.Windows.Forms.Padding(4);
this.chk_swapu.Name = "chk_swapu";
this.chk_swapu.Size = new System.Drawing.Size(78, 21);
this.chk_swapu.TabIndex = 3;
this.chk_swapu.Text = "Swap U";
this.chk_swapu.UseVisualStyleBackColor = true;
//
// chk_transforms
//
this.chk_transforms.AutoSize = true;
this.chk_transforms.Location = new System.Drawing.Point(25, 80);
this.chk_transforms.Margin = new System.Windows.Forms.Padding(4);
this.chk_transforms.Name = "chk_transforms";
this.chk_transforms.Size = new System.Drawing.Size(183, 21);
this.chk_transforms.TabIndex = 6;
this.chk_transforms.Text = "Ignore object transforms";
this.chk_transforms.UseVisualStyleBackColor = true;
//
// chk_geometry
//
this.chk_geometry.AutoSize = true;
this.chk_geometry.Checked = true;
this.chk_geometry.CheckState = System.Windows.Forms.CheckState.Checked;
this.chk_geometry.Location = new System.Drawing.Point(8, 23);
this.chk_geometry.Margin = new System.Windows.Forms.Padding(4);
this.chk_geometry.Name = "chk_geometry";
this.chk_geometry.Size = new System.Drawing.Size(133, 21);
this.chk_geometry.TabIndex = 4;
this.chk_geometry.Text = "Export geometry";
this.chk_geometry.UseVisualStyleBackColor = true;
//
// grp_textures
//
this.grp_textures.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.grp_textures.Controls.Add(this.cbx_textureformat);
this.grp_textures.Controls.Add(this.lbl_textureformat);
this.grp_textures.Controls.Add(this.chk_textures);
this.grp_textures.Location = new System.Drawing.Point(16, 15);
this.grp_textures.Margin = new System.Windows.Forms.Padding(4);
this.grp_textures.Name = "grp_textures";
this.grp_textures.Padding = new System.Windows.Forms.Padding(4);
this.grp_textures.Size = new System.Drawing.Size(360, 114);
this.grp_textures.TabIndex = 7;
this.grp_textures.TabStop = false;
this.grp_textures.Text = "Textures";
//
// cbx_textureformat
//
this.cbx_textureformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbx_textureformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbx_textureformat.FormattingEnabled = true;
this.cbx_textureformat.Items.AddRange(new object[] {
"PNG",
"TIFF",
"BMP",
"JPEG"});
this.cbx_textureformat.Location = new System.Drawing.Point(25, 68);
this.cbx_textureformat.Margin = new System.Windows.Forms.Padding(4);
this.cbx_textureformat.Name = "cbx_textureformat";
this.cbx_textureformat.Size = new System.Drawing.Size(325, 24);
this.cbx_textureformat.TabIndex = 4;
//
// lbl_textureformat
//
this.lbl_textureformat.AutoSize = true;
this.lbl_textureformat.Location = new System.Drawing.Point(21, 48);
this.lbl_textureformat.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbl_textureformat.Name = "lbl_textureformat";
this.lbl_textureformat.Size = new System.Drawing.Size(56, 17);
this.lbl_textureformat.TabIndex = 3;
this.lbl_textureformat.Text = "Format:";
//
// OBJExportDialog
//
this.AcceptButton = this.btn_ok;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btn_cancel;
this.ClientSize = new System.Drawing.Size(392, 325);
this.Controls.Add(this.grp_textures);
this.Controls.Add(this.grp_geometry);
this.Controls.Add(this.btn_ok);
this.Controls.Add(this.btn_cancel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "OBJExportDialog";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Export OBJ";
this.grp_geometry.ResumeLayout(false);
this.grp_geometry.PerformLayout();
this.grp_textures.ResumeLayout(false);
this.grp_textures.PerformLayout();
this.ResumeLayout(false);
}
private IContainer components;
private Button btn_cancel;
private Button btn_ok;
private CheckBox chk_textures;
private GroupBox grp_geometry;
private CheckBox chk_transforms;
private CheckBox chk_geometry;
private CheckBox chk_onlyvisible;
private GroupBox grp_textures;
private CheckBox chk_swapv;
private CheckBox chk_swapu;
private ComboBox cbx_textureformat;
private Label lbl_textureformat;
private void grp_geometry_Enter(object sender, EventArgs e)
{
}
}
}