VTK
vtkCellQuality.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkObject.cxx
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkCellQuality_h
33 #define vtkCellQuality_h
34 
35 #include "vtkFiltersVerdictModule.h" // For export macro
36 #include "vtkDataSetAlgorithm.h"
37 
38 class vtkCell;
39 class vtkDataArray;
40 class vtkIdList;
41 class vtkPoints;
42 
43 class VTKFILTERSVERDICT_EXPORT vtkCellQuality : public vtkDataSetAlgorithm
44 {
45 
46  enum
47  {
48  NONE = 0,
49  AREA,
50  ASPECT_BETA,
51  ASPECT_FROBENIUS,
52  ASPECT_GAMMA,
53  ASPECT_RATIO,
54  COLLAPSE_RATIO,
55  CONDITION,
56  DIAGONAL,
57  DIMENSION,
58  DISTORTION,
59  EDGE_RATIO,
60  JACOBIAN,
61  MAX_ANGLE,
62  MAX_ASPECT_FROBENIUS,
63  MAX_EDGE_RATIO,
64  MED_ASPECT_FROBENIUS,
65  MIN_ANGLE,
66  NORMAL,
67  ODDY,
68  RADIUS_RATIO,
69  RELATIVE_SIZE_SQUARED,
70  SCALED_JACOBIAN,
71  SHAPE,
72  SHAPE_AND_SIZE,
73  SHEAR,
74  SHEAR_AND_SIZE,
75  SKEW,
76  STRETCH,
77  TAPER,
78  VOLUME,
79  WARPAGE
80  };
81 
82 public:
83  void PrintSelf (ostream&, vtkIndent);
85  static vtkCellQuality* New ();
86 
88 
97  vtkSetMacro(QualityMeasure, int);
98  vtkGetMacro(QualityMeasure, int);
100 
102  {
103  this->SetQualityMeasure(AREA);
104  }
106  {
107  this->SetQualityMeasure(ASPECT_BETA);
108  }
110  {
111  this->SetQualityMeasure(ASPECT_FROBENIUS);
112  }
114  {
115  this->SetQualityMeasure(ASPECT_GAMMA);
116  }
118  {
119  this->SetQualityMeasure(ASPECT_RATIO);
120  }
122  {
123  this->SetQualityMeasure(COLLAPSE_RATIO);
124  }
126  {
127  this->SetQualityMeasure(CONDITION);
128  }
130  {
131  this->SetQualityMeasure(DIAGONAL);
132  }
134  {
135  this->SetQualityMeasure(DIMENSION);
136  }
138  {
139  this->SetQualityMeasure(DISTORTION);
140  }
142  {
143  this->SetQualityMeasure(JACOBIAN);
144  }
146  {
147  this->SetQualityMeasure(MAX_ANGLE);
148  }
150  {
151  this->SetQualityMeasure(MAX_ASPECT_FROBENIUS);
152  }
154  {
155  this->SetQualityMeasure(MAX_EDGE_RATIO);
156  }
158  {
159  this->SetQualityMeasure(MED_ASPECT_FROBENIUS);
160  }
162  {
163  this->SetQualityMeasure(MIN_ANGLE);
164  }
166  {
167  this->SetQualityMeasure(ODDY);
168  }
170  {
171  this->SetQualityMeasure(RADIUS_RATIO);
172  }
174  {
175  this->SetQualityMeasure(RELATIVE_SIZE_SQUARED);
176  }
178  {
179  this->SetQualityMeasure(SCALED_JACOBIAN);
180  }
182  {
183  this->SetQualityMeasure(SHAPE_AND_SIZE);
184  }
186  {
187  this->SetQualityMeasure(SHAPE);
188  }
190  {
191  this->SetQualityMeasure(SHEAR_AND_SIZE);
192  }
194  {
195  this->SetQualityMeasure(SHEAR);
196  }
198  {
199  this->SetQualityMeasure(SKEW);
200  }
202  {
203  this->SetQualityMeasure(STRETCH);
204  }
206  {
207  this->SetQualityMeasure(TAPER);
208  }
210  {
211  this->SetQualityMeasure(VOLUME);
212  }
214  {
215  this->SetQualityMeasure(WARPAGE);
216  }
217 
219 
225  vtkSetMacro(UnsupportedGeometry, double);
226  vtkGetMacro(UnsupportedGeometry, double);
228 
230 
237  vtkSetMacro(UndefinedQuality, double);
238  vtkGetMacro(UndefinedQuality, double);
240 
241  double TriangleStripArea (vtkCell*);
242  double PixelArea (vtkCell*);
243  double PolygonArea (vtkCell*);
244 
245 protected:
246  ~vtkCellQuality ();
247  vtkCellQuality ();
248 
265  double ComputeTriangleQuality (vtkCell*);
266 
295  double ComputeQuadQuality (vtkCell*);
296 
316  double ComputeTetQuality (vtkCell*);
317 
342  double ComputeHexQuality (vtkCell*);
343 
350  double ComputeTriangleStripQuality (vtkCell*);
351 
357  double ComputePixelQuality (vtkCell*);
358 
359  virtual int RequestData
361 
363 
370  static int GetCurrentTriangleNormal (double point [3], double normal [3]);
371  static double CurrentTriNormal [3];
373 
375 
376  // Default return value for unsupported geometry
378 
379  // Default return value for qualities that are not well-defined for certain
380  // types of supported geometries. e.g. volume of a triangle
382 
383 private:
384  vtkIdList* PointIds;
385  vtkPoints* Points;
386 
387  vtkCellQuality(const vtkCellQuality&) VTK_DELETE_FUNCTION;
388  void operator=(const vtkCellQuality&) VTK_DELETE_FUNCTION;
389 };
390 
391 #endif // vtkCellQuality_h
void SetQualityMeasureToMinAngle()
void SetQualityMeasureToVolume()
Store vtkAlgorithm input/output information.
void SetQualityMeasureToShearAndSize()
void SetQualityMeasureToDimension()
void SetQualityMeasureToOddy()
void SetQualityMeasureToJacobian()
void SetQualityMeasureToCollapseRatio()
void SetQualityMeasureToShape()
Calculate functions of quality of the elements of a mesh.
void SetQualityMeasureToShapeAndSize()
void SetQualityMeasureToShear()
void SetQualityMeasureToTaper()
void SetQualityMeasureToMaxAspectFrobenius()
void SetQualityMeasureToAspectBeta()
double UndefinedQuality
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify cell behavior
Definition: vtkCell.h:59
void SetQualityMeasureToAspectFrobenius()
void SetQualityMeasureToDiagonal()
void SetQualityMeasureToScaledJacobian()
void SetQualityMeasureToCondition()
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetQualityMeasureToMedAspectFrobenius()
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void SetQualityMeasureToWarpage()
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetQualityMeasureToMaxAngle()
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetQualityMeasureToRadiusRatio()
void SetQualityMeasureToAspectRatio()
Store zero or more vtkInformation instances.
void SetQualityMeasureToRelativeSizeSquared()
Superclass for algorithms that produce output of the same type as input.
void SetQualityMeasureToSkew()
void SetQualityMeasureToAspectGamma()
static vtkDataSetAlgorithm * New()
void SetQualityMeasureToStretch()
represent and manipulate 3D points
Definition: vtkPoints.h:39
void SetQualityMeasureToMaxEdgeRatio()
double UnsupportedGeometry
void SetQualityMeasureToArea()
void SetQualityMeasureToDistortion()