set version number back to "dev"
[engrid.git] / src / libengrid / surfacealgorithm.h
bloba41cd36d53a20f442baff6bbf5e3ed14c2136cb1
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008-2013 enGits GmbH +
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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 //
23 #ifndef SURFACEALGORITHM_H
24 #define SURFACEALGORITHM_H
26 #include <vtkUnstructuredGrid.h>
27 #include <vtkPolyData.h>
28 #include <vtkCharArray.h>
30 #include <QSet>
31 #include <QVector>
32 #include <QString>
33 #include <QTextStream>
34 #include <QTime>
36 #include "surfaceoperation.h"
37 #include "vertexmeshdensity.h"
38 #include "geometrytools.h"
40 #include <cmath>
41 #include <iostream>
43 class SurfaceAlgorithm : public SurfaceOperation
46 protected: // attributes
48 int m_NumMaxIter;
49 int m_NumSmoothSteps;
50 double m_MaxEdgeLength;
51 double m_MinEdgeLength;
52 double m_NodesPerQuarterCircle;
53 double m_FeatureResolution2D;
54 double m_FeatureResolution3D;
55 bool m_RespectFeatureEdgesForDeleteNodes;
56 double m_FeatureAngleForDeleteNodes;
57 bool m_PerformGeometricTests;
58 bool m_UseProjectionForSmoothing;
59 bool m_UseNormalCorrectionForSmoothing;
60 bool m_AllowFeatureEdgeSwapping;
61 double m_GrowthFactor;
62 bool m_SmoothSuccess;
63 int m_NumDelaunaySweeps;
64 bool m_AllowSmallAreaSwapping;
65 bool m_InsertNodes;
66 bool m_DeleteNodes;
69 protected: // methods
71 void readSettings();
74 protected: // methods
76 void prepare();
77 void swap();
78 void smooth(int N_iter, bool correct_curvature = false);
79 int insertNodes();
80 int deleteNodes();
81 void computeMeshDensity();
83 public:
85 SurfaceAlgorithm();
87 void setVertexMeshDensityVector(QVector <VertexMeshDensity> a_VMDvector) { m_VMDvector = a_VMDvector; }
88 void setMaxEdgeLength(double l) { m_MaxEdgeLength = l; }
89 void setNodesPerQuarterCircle(double N) { m_NodesPerQuarterCircle = N; }
90 void setCellGrowthFactor(double cgf) { m_GrowthFactor = cgf; }
91 void setMaxNumIterations(int N) { m_NumMaxIter = N; }
92 void setNumSmoothSteps(int N) { m_NumSmoothSteps = N; }
93 void setNumDelaunaySweeps(int N) { m_NumDelaunaySweeps = N; }
94 void setDeleteNodesOn() { m_DeleteNodes = true; }
95 void setDeleteNodesOff() { m_DeleteNodes = false; }
96 void setInsertNodesOn() { m_InsertNodes = true; }
97 void setInsertNodesOff() { m_InsertNodes = false; }
98 void setDeleteNodes(bool s) { m_DeleteNodes = s; }
99 void setInsertNodes(bool s) { m_InsertNodes = s; }
103 #endif // SURFACEALGORITHM_H