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 UPDATEDESIREDMESHDENSITY_H
22 #define UPDATEDESIREDMESHDENSITY_H
24 #include "surfaceoperation.h"
26 #include "vertexmeshdensity.h"
27 #include "edgelengthsourcemanager.h"
30 /// Update desired mesh density, i.e. the field used for surface meshing
32 class UpdateDesiredMeshDensity
: public SurfaceOperation
35 private: // data types
48 double m_GrowthFactor
;
49 double m_MaxEdgeLength
;
50 double m_MinEdgeLength
;
51 double m_NodesPerQuarterCircle
;
52 double m_FeatureResolution2D
;
53 double m_FeatureResolution3D
;
54 double m_FeatureThresholdAngle
;
55 QVector
<double> m_FeatureSize
;
56 QVector
<bool> m_Fixed
;
57 EdgeLengthSourceManager m_ELSManager
;
58 bool m_OnlySurfaceCells
;
63 void computeFeature(const QList
<point_t
> points
, QVector
<double> &cl_pre
, double res
, int restriction_type
);
64 void computeFeature2D(QVector
<double> &cl_pre
);
65 void computeFeature3D(QVector
<double> &cl_pre
);
66 double computeSearchDistance(vtkIdType id_face
);
67 void computeExistingLengths();
72 UpdateDesiredMeshDensity();
73 virtual void operate();
76 void setVertexMeshDensityVector(QVector
<VertexMeshDensity
> const & vmd
) { m_VMDvector
= vmd
; }
77 void setMaxEdgeLength(double l
) { m_MaxEdgeLength
= l
; }
78 void setMinEdgeLength(double l
) { m_MinEdgeLength
= l
; }
79 void setNodesPerQuarterCircle(double N
) { m_NodesPerQuarterCircle
= N
; }
80 void setCellGrowthFactor(double cgf
) { m_GrowthFactor
= cgf
; }
81 void setVolumeCellsOn() { m_OnlySurfaceCells
= false; }
82 void setVolumeCellsOff() { m_OnlySurfaceCells
= true; }
83 void setFeatureResolution2D(double n
) { m_FeatureResolution2D
= n
; }
84 void setFeatureResolution3D(double n
) { m_FeatureResolution3D
= n
; }
85 void setFeatureThresholdAngle(double a
) { m_FeatureThresholdAngle
= a
; }
86 void setRelaxationOff() { m_Relaxation
= false; }
87 void setRelaxationOn() { m_Relaxation
= true; }