2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008-2013 enGits GmbH +
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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef SURFACEALGORITHM_H
24 #define SURFACEALGORITHM_H
26 #include <vtkUnstructuredGrid.h>
27 #include <vtkPolyData.h>
28 #include <vtkCharArray.h>
33 #include <QTextStream>
36 #include "surfaceoperation.h"
37 #include "vertexmeshdensity.h"
38 #include "geometrytools.h"
43 class SurfaceAlgorithm
: public SurfaceOperation
46 protected: // attributes
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
;
63 int m_NumDelaunaySweeps
;
64 bool m_AllowSmallAreaSwapping
;
78 void smooth(int N_iter
, bool correct_curvature
= false);
81 void computeMeshDensity();
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