updated to modern VTK
[engrid-github.git] / src / libengrid / vtkEgNormalExtrusion.h
blobaaefaae65858efaec31a5720b07c4c625d87cf6c
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
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. +
11 // + +
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. +
16 // + +
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/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #ifndef __vtkEgNormalExtrusion_h
22 #define __vtkEgNormalExtrusion_h
24 class vtkEgNormalExtrusion;
26 #include "vtkEgGridFilter.h"
27 #include "meshpartition.h"
28 #include "curve.h"
30 #include <QVector>
32 class vtkEgNormalExtrusion : public vtkEgGridFilter
35 protected: // attributes
37 enum mode_t { normal, fixed, planar, cylinder, rotation, curve };
38 mode_t m_Mode;
39 QVector<double> layer_y;
41 vec3_t origin, axis, fixed_normal;
42 double min_dist;
43 double m_ScaleX;
44 double m_ScaleY;
45 double m_ScaleZ;
46 bool m_RemoveInternalFaces;
47 int m_UnknownBc;
48 int m_CustomBottomBc;
49 int m_CustomSideBc;
50 int m_CustomTopBc;
52 // data for extrusion along curve
53 Curve* m_Curve1;
54 Curve* m_Curve2;
55 bool m_OrthoExtrusion;
56 QVector<vec3_t> m_InitialBaseCoords;
59 public: // methods
61 static vtkEgNormalExtrusion* New();
62 void SetLayers(const QVector<double> &y);
63 void SetOrigin(vec3_t x) { origin = x; }
64 void SetAxis(vec3_t x) { axis = x; }
65 void SetNormal(vec3_t x) { fixed_normal = x; }
66 void SetMinDist(double d) { min_dist = d; }
67 void SetCylindrical() { m_Mode = cylinder; }
68 void SetFixed() { m_Mode = fixed; }
69 void SetPlanar() { m_Mode = planar; }
70 void SetRotation() { m_Mode = rotation; }
71 void SetCurves(Curve* curve1, Curve* curve2);
72 void OrthoExtrusionOn() { m_OrthoExtrusion = true; }
73 void OrthoExtrusionOff() { m_OrthoExtrusion = false; }
74 void SetRestrictNone() { m_ScaleX = 1; m_ScaleY = 1; m_ScaleZ = 1; }
75 void SetRestrictXY() { m_ScaleX = 1; m_ScaleY = 1; m_ScaleZ = 0; }
76 void SetRestrictXZ() { m_ScaleX = 1; m_ScaleY = 0; m_ScaleZ = 1; }
77 void SetRestrictYZ() { m_ScaleX = 0; m_ScaleY = 1; m_ScaleZ = 1; }
78 void SetRemoveInternalFacesOn() { m_RemoveInternalFaces = true; }
79 void SetRemoveInternalFacesOff() { m_RemoveInternalFaces = false; }
80 void SetCustomBottomBc(int bc) { m_CustomBottomBc = bc; }
81 void SetCustomSideBc(int bc) { m_CustomSideBc = bc; }
82 void SetCustomTopBc(int bc) { m_CustomTopBc = bc; }
85 protected: // methods
87 vtkEgNormalExtrusion();
88 ~vtkEgNormalExtrusion() {}
89 virtual void ExecuteEg();
91 int getNewBc(MeshPartition *part, vtkIdType id_node1, vtkIdType id_node2);
92 bool PrepareCurveExtrusion(QVector<vtkIdType> nodes);
93 mat3_t ComputeBase(double l);
96 private: // methods
98 vtkEgNormalExtrusion (const vtkEgNormalExtrusion&);
99 void operator= (const vtkEgNormalExtrusion&);
103 #endif