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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #ifndef SURFACEALGORITHM_H
22 #define SURFACEALGORITHM_H
24 #include <vtkUnstructuredGrid.h>
25 #include <vtkPolyData.h>
26 #include <vtkCharArray.h>
31 #include <QTextStream>
34 #include "surfaceoperation.h"
35 #include "vertexmeshdensity.h"
36 #include "geometrytools.h"
41 class SurfaceAlgorithm
: public SurfaceOperation
44 protected: // attributes
48 double m_MaxEdgeLength
;
49 double m_MinEdgeLength
;
50 double m_NodesPerQuarterCircle
;
51 double m_FeatureResolution2D
;
52 double m_FeatureResolution3D
;
53 bool m_RespectFeatureEdgesForDeleteNodes
;
54 double m_FeatureAngleForDeleteNodes
;
55 bool m_PerformGeometricTests
;
56 bool m_UseProjectionForSmoothing
;
57 bool m_UseNormalCorrectionForSmoothing
;
58 bool m_AllowFeatureEdgeSwapping
;
59 double m_GrowthFactor
;
61 int m_NumDelaunaySweeps
;
62 bool m_AllowSmallAreaSwapping
;
75 void swap(double delaunay_threshold
= 1.0, bool verbose
= false);
76 void smooth(int N_iter
, bool correct_curvature
= false);
79 void computeMeshDensity();
85 void setVertexMeshDensityVector(QVector
<VertexMeshDensity
> a_VMDvector
) { m_VMDvector
= a_VMDvector
; }
86 void setMaxEdgeLength(double l
) { m_MaxEdgeLength
= l
; }
87 void setNodesPerQuarterCircle(double N
) { m_NodesPerQuarterCircle
= N
; }
88 void setCellGrowthFactor(double cgf
) { m_GrowthFactor
= cgf
; }
89 void setMaxNumIterations(int N
) { m_NumMaxIter
= N
; }
90 void setNumSmoothSteps(int N
) { m_NumSmoothSteps
= N
; }
91 void setNumDelaunaySweeps(int N
) { m_NumDelaunaySweeps
= N
; }
92 void setDeleteNodesOn() { m_DeleteNodes
= true; }
93 void setDeleteNodesOff() { m_DeleteNodes
= false; }
94 void setInsertNodesOn() { m_InsertNodes
= true; }
95 void setInsertNodesOff() { m_InsertNodes
= false; }
96 void setDeleteNodes(bool s
) { m_DeleteNodes
= s
; }
97 void setInsertNodes(bool s
) { m_InsertNodes
= s
; }
101 #endif // SURFACEALGORITHM_H