/
PatchThickenDialog.cpp
61 lines (51 loc) · 1.37 KB
/
PatchThickenDialog.cpp
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
#include "PatchThickenDialog.h"
#include "i18n.h"
#include "imainframe.h"
#include "string/convert.h"
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/radiobut.h>
namespace
{
const char* const WINDOW_TITLE = N_("Patch Thicken");
}
namespace ui
{
PatchThickenDialog::PatchThickenDialog() :
Dialog(_(WINDOW_TITLE), GlobalMainFrame().getWxTopLevelWindow())
{
_dialog->GetSizer()->Add(loadNamedPanel(_dialog, "ThickenDialogMainPanel"), 1, wxEXPAND | wxALL, 12);
wxStaticText* topLabel = findNamedObject<wxStaticText>(_dialog, "ThickenDialogTopLabel");
topLabel->SetFont(topLabel->GetFont().Bold());
}
float PatchThickenDialog::getThickness()
{
wxTextCtrl* entry = findNamedObject<wxTextCtrl>(_dialog, "ThickenDialogThickness");
return string::convert<float>(entry->GetValue(), 0.0f);
}
bool PatchThickenDialog::getCeateSeams()
{
return findNamedObject<wxCheckBox>(_dialog, "ThickenDialogCreateSeams")->GetValue();
}
int PatchThickenDialog::getAxis()
{
if (findNamedObject<wxRadioButton>(_dialog, "ThickenDialogExtrudeAlongX")->GetValue())
{
return 0;
}
else if (findNamedObject<wxRadioButton>(_dialog, "ThickenDialogExtrudeAlongY")->GetValue())
{
return 1;
}
else if (findNamedObject<wxRadioButton>(_dialog, "ThickenDialogExtrudeAlongZ")->GetValue())
{
return 2;
}
else
{
// Extrude along normals
return 3;
}
}
} // namespace ui