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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 #ifndef gridsmoother_H
25 #define gridsmoother_H
29 #include "surfaceoperation.h"
31 #include <vtkCellLocator.h>
34 class GridSmoother
: public SurfaceOperation
37 private: // attributes
39 QVector
<bool> m_NodeMarked
;
40 QVector
<bool> m_SurfNode
;
43 protected: // attributes
47 int m_NumBoundaryCorrections
;
49 int m_NumNormalRelaxations
;
50 int m_NumHeightRelaxations
;
53 double m_AbsoluteHeight
;
54 double m_RelativeHeight
;
56 double m_LayerClearance
;
58 bool m_StrictPrismChecking
;
60 QVector
<vtkIdType
> m_FootToField
;
62 QVector
<vtkIdType
> m_IdFoot
;
63 QVector
<double> m_Height
;
64 QVector
<vec3_t
> m_NodeNormal
;
68 virtual void operate();
70 bool setNewPosition(vtkIdType id_node
, vec3_t x_new
);
71 void correctDx(int i_nodes
, vec3_t
&Dx
);
72 bool moveNode(int i_nodes
, vec3_t
&Dx
);
74 void computeNormals();
75 void relaxNormalVectors();
76 void correctNormalVectors();
77 void computeHeights();
79 void simpleNodeMovement(int i_nodes
);
80 bool noCollision(vtkIdType id_node
);
82 void writeDebugFile(QString file_name
);
87 void setNumIterations (int N
) { m_NumIterations
= N
; };
88 void setNumRelaxations (int N
) { m_NumRelaxations
= N
; };
89 void setNumBoundaryCorrections(int N
) { m_NumBoundaryCorrections
= N
; };
90 void setRelativeHeight (double h
) { m_RelativeHeight
= h
; }
91 void setAbsoluteHeight (double h
) { m_AbsoluteHeight
= h
; }
92 void setBlending (double b
) { m_Blending
= b
; }
97 typedef GridSmoother SmoothVolumeGrid
;