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 #ifndef GUICREATEHEXSHELL_H
23 #define GUICREATEHEXSHELL_H
25 #include "ui_guicreatehexshell.h"
26 #include "dialogoperation.h"
30 class GuiCreateHexShell
: public DialogOperation
<Ui::GuiCreateHexShell
, Operation
>
35 private: // attributes
43 int m_TotalNumberOfCells
;
47 double m_Dx
, m_Dy
, m_Dz
;
48 double m_X0
, m_Y0
, m_Z0
;
50 QVector
<vtkIdType
> m_NodeIDs
;
51 QVector
<vtkIdType
> m_CellIDs
;
56 virtual void before();
57 virtual void operate();
59 int indexCell(int i
, int j
, int k
) { return i
*m_NumJCells
*m_NumKCells
+ j
*m_NumKCells
+ k
; }
60 int indexNode(int i
, int j
, int k
) { return i
*m_NumJNodes
*m_NumKNodes
+ j
*m_NumKNodes
+ k
; }
61 void ijkCell(int idx
, int& i
, int& j
, int& k
);
62 void ijkNode(int idx
, int& i
, int& j
, int& k
);
63 void defineBoundaryCodes();
64 void createGridWithNodes(vtkUnstructuredGrid
*grid
);
65 void createHexCells(vtkUnstructuredGrid
*grid
);
66 void createOuterBoundary(vtkUnstructuredGrid
*grid
);
67 void createInnerBoundary(vtkUnstructuredGrid
*grid
);
68 void createSourceBox();
69 double x(int i
) { return m_X0
+ i
*m_Dx
; }
70 double y(int j
) { return m_Y0
+ j
*m_Dy
; }
71 double z(int k
) { return m_Z0
+ k
*m_Dz
; }
82 void updateNumberOfCells(int = 0);
86 #endif // GUICREATEHEXSHELL_H