1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 #include "guifillplane.h"
23 #include "fillplane.h"
24 #include "boundarycondition.h"
25 #include "guimainwindow.h"
27 void GuiFillPlane::fillPlane(vec3_t x
, vec3_t n
, bool inverse
, QString name
)
29 double tol
= m_Ui
.m_LineEditDistTol
->text().toDouble();
34 fill
.setDistanceTolerance(m_Ui
.m_LineEditDistTol
->text().toDouble());
35 fill
.setAngularTolerance(GeometryTools::deg2rad(m_Ui
.m_LineEditAngTol
->text().toDouble()));
37 fill
.setInverseDirectionOn();
39 fill
.setInverseDirectionOff();
42 BoundaryCondition
bc(name
, "patch");
43 GuiMainWindow::pointer()->addBC(fill
.getBC(), bc
);
44 GuiMainWindow::pointer()->updateBoundaryCodes(true);
47 void GuiFillPlane::operate()
49 if (m_Ui
.m_CheckBoxCustom
->isChecked()) {
51 x
[0] = m_Ui
.m_LineEditX
->text().toDouble();
52 x
[1] = m_Ui
.m_LineEditY
->text().toDouble();
53 x
[2] = m_Ui
.m_LineEditZ
->text().toDouble();
54 n
[0] = m_Ui
.m_LineEditNx
->text().toDouble();
55 n
[1] = m_Ui
.m_LineEditNy
->text().toDouble();
56 n
[2] = m_Ui
.m_LineEditNz
->text().toDouble();
57 fillPlane(x
, n
, false, "filled_plane");
59 if (m_Ui
.m_CheckBoxXY
->isChecked()) {
62 fillPlane(x
, n
, m_Ui
.m_CheckBoxXYInv
->isChecked(), "XY_plane");
64 if (m_Ui
.m_CheckBoxYZ
->isChecked()) {
67 fillPlane(x
, n
, m_Ui
.m_CheckBoxYZInv
->isChecked(), "YZ_plane");
69 if (m_Ui
.m_CheckBoxZX
->isChecked()) {
72 fillPlane(x
, n
, m_Ui
.m_CheckBoxZXInv
->isChecked(), "ZX_plane");