cleaned old stuff
[engrid.git] / src / gridsmoother.h
blob598d1a1f0651feba73bb66565d8e40b3ae12168a
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
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. +
12 // + +
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. +
17 // + +
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/>. +
20 // + +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 #ifndef gridsmoother_H
25 #define gridsmoother_H
27 class GridSmoother;
29 #include "surfaceoperation.h"
31 #include <vtkCellLocator.h>
32 #include <QSettings>
34 class GridSmoother : public SurfaceOperation
37 private: // attributes
39 QVector<bool> m_NodeMarked;
40 QVector<bool> m_SurfNode;
41 int m_NumMarkedNodes;
43 protected: // attributes
45 int m_NumIterations;
46 int m_NumRelaxations;
47 int m_NumBoundaryCorrections;
48 int m_NumSearch;
49 int m_NumNormalRelaxations;
50 int m_NumHeightRelaxations;
52 double m_Blending;
53 double m_AbsoluteHeight;
54 double m_RelativeHeight;
55 double m_CritAngle;
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;
66 protected: // methods
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);
73 void markNodes();
74 void computeNormals();
75 void relaxNormalVectors();
76 void correctNormalVectors();
77 void computeHeights();
78 void computeFeet();
79 void simpleNodeMovement(int i_nodes);
80 bool noCollision(vtkIdType id_node);
82 void writeDebugFile(QString file_name);
84 public: // methods
86 GridSmoother();
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;
99 #endif