VMTK
vtkvmtkBoundaryLayerGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: VMTK
4 Module: $RCSfile: vtkvmtkBoundaryLayerGenerator.h,v $
5 Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
28 #ifndef __vtkvmtkBoundaryLayerGenerator_h
29 #define __vtkvmtkBoundaryLayerGenerator_h
30 
31 #include "vtkUnstructuredGridAlgorithm.h"
32 #include "vtkvmtkWin32Header.h"
33 
34 class vtkPoints;
35 class vtkUnsignedCharArray;
36 class vtkDataArray;
37 
38 class VTK_VMTK_MISC_EXPORT vtkvmtkBoundaryLayerGenerator : public vtkUnstructuredGridAlgorithm
39 {
40  public:
41  vtkTypeMacro(vtkvmtkBoundaryLayerGenerator,vtkUnstructuredGridAlgorithm);
42  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
43 
44  static vtkvmtkBoundaryLayerGenerator *New();
45 
46  vtkGetStringMacro(WarpVectorsArrayName);
47  vtkSetStringMacro(WarpVectorsArrayName);
48 
49  vtkGetStringMacro(LayerThicknessArrayName);
50  vtkSetStringMacro(LayerThicknessArrayName);
51 
52  vtkGetMacro(UseWarpVectorMagnitudeAsThickness,int);
53  vtkSetMacro(UseWarpVectorMagnitudeAsThickness,int);
54  vtkBooleanMacro(UseWarpVectorMagnitudeAsThickness,int);
55 
56  vtkGetMacro(ConstantThickness,int);
57  vtkSetMacro(ConstantThickness,int);
58  vtkBooleanMacro(ConstantThickness,int);
59 
60  vtkGetMacro(IncludeSurfaceCells,int);
61  vtkSetMacro(IncludeSurfaceCells,int);
62  vtkBooleanMacro(IncludeSurfaceCells,int);
63 
64  vtkGetMacro(IncludeSidewallCells,int);
65  vtkSetMacro(IncludeSidewallCells,int);
66  vtkBooleanMacro(IncludeSidewallCells,int);
67 
68  vtkGetMacro(NegateWarpVectors,int);
69  vtkSetMacro(NegateWarpVectors,int);
70  vtkBooleanMacro(NegateWarpVectors,int);
71 
72  vtkGetMacro(LayerThickness,double);
73  vtkSetMacro(LayerThickness,double);
74 
75  vtkGetMacro(LayerThicknessRatio,double);
76  vtkSetMacro(LayerThicknessRatio,double);
77 
78  vtkGetMacro(MaximumLayerThickness,double);
79  vtkSetMacro(MaximumLayerThickness,double);
80 
81  vtkGetMacro(NumberOfSubLayers,int);
82  vtkSetMacro(NumberOfSubLayers,int);
83 
84  vtkGetMacro(SubLayerRatio,double);
85  vtkSetMacro(SubLayerRatio,double);
86 
87  vtkGetMacro(NumberOfSubsteps,int);
88  vtkSetMacro(NumberOfSubsteps,int);
89 
90  vtkGetMacro(Relaxation,double);
91  vtkSetMacro(Relaxation,double);
92 
93  vtkGetMacro(LocalCorrectionFactor,double);
94  vtkSetMacro(LocalCorrectionFactor,double);
95 
96  vtkSetStringMacro(CellEntityIdsArrayName);
97  vtkGetStringMacro(CellEntityIdsArrayName);
98 
99  vtkGetMacro(InnerSurfaceCellEntityId,int);
100  vtkSetMacro(InnerSurfaceCellEntityId,int);
101 
102  vtkGetMacro(OuterSurfaceCellEntityId,int);
103  vtkSetMacro(OuterSurfaceCellEntityId,int);
104 
105  vtkGetMacro(SidewallCellEntityId,int);
106  vtkSetMacro(SidewallCellEntityId,int);
107 
108  vtkGetMacro(VolumeCellEntityId,int);
109  vtkSetMacro(VolumeCellEntityId,int);
110 
111  vtkGetObjectMacro(InnerSurface,vtkUnstructuredGrid);
112 
113  protected:
116 
117  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
118 
119  void BuildWarpVectors(vtkUnstructuredGrid* input);
120  void IncrementalWarpPoints(vtkUnstructuredGrid* input, vtkPoints* basePoints, vtkPoints* warpedPoints, int substep, int numberOfSubsteps, double relaxation);
121  void IncrementalWarpVectors(vtkUnstructuredGrid* input, int numberOfSubsteps, double relaxation);
122  int CheckTangle(vtkUnstructuredGrid* input, vtkUnsignedCharArray* checkArray);
123  void LocalUntangle(vtkUnstructuredGrid* input, vtkUnsignedCharArray* checkArray, double alpha);
124  void WarpPoints(vtkPoints* inputPoints, vtkPoints* warpedPoints, int subLayerId, bool quadratic);
125  void UnwrapSublayers(vtkUnstructuredGrid* input, vtkPoints* outputPoints);
126 
127  vtkDataArray* WarpVectorsArray;
128  vtkDataArray* LayerThicknessArray;
129 
132 
135 
139 
143 
147 
148  vtkUnstructuredGrid* InnerSurface;
149 
155 
156  double Relaxation;
158 
159  private:
161  void operator=(const vtkvmtkBoundaryLayerGenerator&); // Not implemented.
162 };
163 
164 #endif
Generates boundary layers of prismatic elements by warping a surface mesh.