2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #include "guisetboundarycode.h"
24 #include "setboundarycode.h"
25 #include "guimainwindow.h"
27 void GuiSetBoundaryCode::before()
30 QSettings
local_qset("enGits","enGrid_GuiSetBoundaryCode");
31 ui
.doubleSpinBoxFeatureAngle
->setValue(local_qset
.value("FeatureAngle", 45).toDouble());
32 ui
.spinBoxBoundaryCode
->setValue(local_qset
.value("BoundaryCode", 1).toInt());
33 ui
.checkBox_SelectAllVisible
->setCheckState(int2CheckState(local_qset
.value("SelectAllVisible", 0).toInt()));
34 ui
.checkBox_ProcessAll
->setCheckState(int2CheckState(local_qset
.value("ProcessAll", 0).toInt()));
37 void GuiSetBoundaryCode::operate()
40 QSettings
local_qset("enGits","enGrid_GuiSetBoundaryCode");
41 local_qset
.setValue("FeatureAngle", ui
.doubleSpinBoxFeatureAngle
->value());
42 local_qset
.setValue("BoundaryCode", ui
.spinBoxBoundaryCode
->value());
43 local_qset
.setValue("SelectAllVisible", ui
.checkBox_SelectAllVisible
->checkState());
44 local_qset
.setValue("ProcessAll", ui
.checkBox_ProcessAll
->checkState());
46 SetBoundaryCode set_bc
;
47 if (GuiMainWindow::getPickedCell() >= 0) {
48 set_bc
.setFeatureAngle(ui
.doubleSpinBoxFeatureAngle
->value());
49 set_bc
.setBC(ui
.spinBoxBoundaryCode
->value());
50 set_bc
.setProcessAll(ui
.checkBox_ProcessAll
->checkState());
51 set_bc
.setSelectAllVisible(ui
.checkBox_SelectAllVisible
->checkState());
52 set_bc
.setStart(GuiMainWindow::getPickedCell());