VTK
vtkMeshQuality.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMeshQuality.h
5  Language: C++
6 
7  Copyright 2003-2006 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9  license for use of this work by or on behalf of the
10  U.S. Government. Redistribution and use in source and binary forms, with
11  or without modification, are permitted provided that this Notice and any
12  statement of authorship are reproduced on all copies.
13 
14  Contact: dcthomp@sandia.gov,pppebay@sandia.gov
15 
16 =========================================================================*/
64 #ifndef vtkMeshQuality_h
65 #define vtkMeshQuality_h
66 
67 #include "vtkFiltersVerdictModule.h" // For export macro
68 #include "vtkDataSetAlgorithm.h"
69 
70 class vtkCell;
71 class vtkDataArray;
72 
73 #define VTK_QUALITY_EDGE_RATIO 0
74 #define VTK_QUALITY_ASPECT_RATIO 1
75 #define VTK_QUALITY_RADIUS_RATIO 2
76 #define VTK_QUALITY_ASPECT_FROBENIUS 3
77 #define VTK_QUALITY_MED_ASPECT_FROBENIUS 4
78 #define VTK_QUALITY_MAX_ASPECT_FROBENIUS 5
79 #define VTK_QUALITY_MIN_ANGLE 6
80 #define VTK_QUALITY_COLLAPSE_RATIO 7
81 #define VTK_QUALITY_MAX_ANGLE 8
82 #define VTK_QUALITY_CONDITION 9
83 #define VTK_QUALITY_SCALED_JACOBIAN 10
84 #define VTK_QUALITY_SHEAR 11
85 #define VTK_QUALITY_RELATIVE_SIZE_SQUARED 12
86 #define VTK_QUALITY_SHAPE 13
87 #define VTK_QUALITY_SHAPE_AND_SIZE 14
88 #define VTK_QUALITY_DISTORTION 15
89 #define VTK_QUALITY_MAX_EDGE_RATIO 16
90 #define VTK_QUALITY_SKEW 17
91 #define VTK_QUALITY_TAPER 18
92 #define VTK_QUALITY_VOLUME 19
93 #define VTK_QUALITY_STRETCH 20
94 #define VTK_QUALITY_DIAGONAL 21
95 #define VTK_QUALITY_DIMENSION 22
96 #define VTK_QUALITY_ODDY 23
97 #define VTK_QUALITY_SHEAR_AND_SIZE 24
98 #define VTK_QUALITY_JACOBIAN 25
99 #define VTK_QUALITY_WARPAGE 26
100 #define VTK_QUALITY_ASPECT_GAMMA 27
101 #define VTK_QUALITY_AREA 28
102 #define VTK_QUALITY_ASPECT_BETA 29
103 
105 {
106 public:
107  void PrintSelf(ostream& os, vtkIndent indent);
109  static vtkMeshQuality* New();
110 
112 
115  vtkSetMacro(SaveCellQuality,int);
116  vtkGetMacro(SaveCellQuality,int);
117  vtkBooleanMacro(SaveCellQuality,int);
119 
121 
129  vtkSetMacro(TriangleQualityMeasure,int);
130  vtkGetMacro(TriangleQualityMeasure,int);
132  {
133  this->SetTriangleQualityMeasure( VTK_QUALITY_AREA );
134  }
136  {
137  this->SetTriangleQualityMeasure( VTK_QUALITY_EDGE_RATIO );
138  }
140  {
141  this->SetTriangleQualityMeasure( VTK_QUALITY_ASPECT_RATIO );
142  }
144  {
145  this->SetTriangleQualityMeasure( VTK_QUALITY_RADIUS_RATIO );
146  }
148  {
149  this->SetTriangleQualityMeasure( VTK_QUALITY_ASPECT_FROBENIUS );
150  }
152  {
153  this->SetTriangleQualityMeasure( VTK_QUALITY_MIN_ANGLE );
154  }
156  {
157  this->SetTriangleQualityMeasure( VTK_QUALITY_MAX_ANGLE );
158  }
160  {
161  this->SetTriangleQualityMeasure( VTK_QUALITY_CONDITION );
162  }
164  {
165  this->SetTriangleQualityMeasure( VTK_QUALITY_SCALED_JACOBIAN );
166  }
168  {
169  this->SetTriangleQualityMeasure( VTK_QUALITY_RELATIVE_SIZE_SQUARED );
170  }
172  {
173  this->SetTriangleQualityMeasure( VTK_QUALITY_SHAPE );
174  }
176  {
177  this->SetTriangleQualityMeasure( VTK_QUALITY_SHAPE_AND_SIZE );
178  }
180  {
181  this->SetTriangleQualityMeasure( VTK_QUALITY_DISTORTION );
182  }
184 
186 
200  vtkSetMacro(QuadQualityMeasure,int);
201  vtkGetMacro(QuadQualityMeasure,int);
203  {
204  this->SetQuadQualityMeasure( VTK_QUALITY_EDGE_RATIO );
205  }
207  {
208  this->SetQuadQualityMeasure( VTK_QUALITY_ASPECT_RATIO );
209  }
211  {
212  this->SetQuadQualityMeasure( VTK_QUALITY_RADIUS_RATIO );
213  }
215  {
216  this->SetQuadQualityMeasure( VTK_QUALITY_MED_ASPECT_FROBENIUS );
217  }
219  {
220  this->SetQuadQualityMeasure( VTK_QUALITY_MAX_ASPECT_FROBENIUS );
221  }
223  {
224  this->SetQuadQualityMeasure( VTK_QUALITY_MAX_EDGE_RATIO );
225  }
227  {
228  this->SetQuadQualityMeasure( VTK_QUALITY_SKEW );
229  }
231  {
232  this->SetQuadQualityMeasure( VTK_QUALITY_TAPER );
233  }
235  {
236  this->SetQuadQualityMeasure( VTK_QUALITY_WARPAGE );
237  }
239  {
240  this->SetQuadQualityMeasure( VTK_QUALITY_AREA );
241  }
243  {
244  this->SetQuadQualityMeasure( VTK_QUALITY_STRETCH );
245  }
247  {
248  this->SetQuadQualityMeasure( VTK_QUALITY_MIN_ANGLE );
249  }
251  {
252  this->SetQuadQualityMeasure( VTK_QUALITY_MAX_ANGLE );
253  }
255  {
256  this->SetQuadQualityMeasure( VTK_QUALITY_ODDY );
257  }
259  {
260  this->SetQuadQualityMeasure( VTK_QUALITY_CONDITION );
261  }
263  {
264  this->SetQuadQualityMeasure( VTK_QUALITY_JACOBIAN );
265  }
267  {
268  this->SetQuadQualityMeasure( VTK_QUALITY_SCALED_JACOBIAN );
269  }
271  {
272  this->SetQuadQualityMeasure( VTK_QUALITY_SHEAR );
273  }
275  {
276  this->SetQuadQualityMeasure( VTK_QUALITY_SHAPE );
277  }
279  {
280  this->SetQuadQualityMeasure( VTK_QUALITY_RELATIVE_SIZE_SQUARED );
281  }
283  {
284  this->SetQuadQualityMeasure( VTK_QUALITY_SHAPE_AND_SIZE );
285  }
287  {
288  this->SetQuadQualityMeasure( VTK_QUALITY_SHEAR_AND_SIZE );
289  }
291  {
292  this->SetQuadQualityMeasure( VTK_QUALITY_DISTORTION );
293  }
295 
297 
307  vtkSetMacro(TetQualityMeasure,int);
308  vtkGetMacro(TetQualityMeasure,int);
310  {
311  this->SetTetQualityMeasure( VTK_QUALITY_EDGE_RATIO );
312  }
314  {
315  this->SetTetQualityMeasure( VTK_QUALITY_ASPECT_RATIO );
316  }
318  {
319  this->SetTetQualityMeasure( VTK_QUALITY_RADIUS_RATIO );
320  }
322  {
323  this->SetTetQualityMeasure( VTK_QUALITY_ASPECT_FROBENIUS );
324  }
326  {
327  this->SetTetQualityMeasure( VTK_QUALITY_MIN_ANGLE );
328  }
330  {
331  this->SetTetQualityMeasure( VTK_QUALITY_COLLAPSE_RATIO );
332  }
334  {
335  this->SetTetQualityMeasure( VTK_QUALITY_ASPECT_BETA );
336  }
338  {
339  this->SetTetQualityMeasure( VTK_QUALITY_ASPECT_GAMMA );
340  }
342  {
343  this->SetTetQualityMeasure( VTK_QUALITY_VOLUME );
344  }
346  {
347  this->SetTetQualityMeasure( VTK_QUALITY_CONDITION );
348  }
350  {
351  this->SetTetQualityMeasure( VTK_QUALITY_JACOBIAN );
352  }
354  {
355  this->SetTetQualityMeasure( VTK_QUALITY_SCALED_JACOBIAN );
356  }
358  {
359  this->SetTetQualityMeasure( VTK_QUALITY_SHAPE );
360  }
362  {
363  this->SetTetQualityMeasure( VTK_QUALITY_RELATIVE_SIZE_SQUARED );
364  }
366  {
367  this->SetTetQualityMeasure( VTK_QUALITY_SHAPE_AND_SIZE );
368  }
370  {
371  this->SetTetQualityMeasure( VTK_QUALITY_DISTORTION );
372  }
374 
376 
386  vtkSetMacro(HexQualityMeasure,int);
387  vtkGetMacro(HexQualityMeasure,int);
389  {
390  this->SetHexQualityMeasure( VTK_QUALITY_EDGE_RATIO );
391  }
393  {
394  this->SetHexQualityMeasure( VTK_QUALITY_MED_ASPECT_FROBENIUS );
395  }
397  {
398  this->SetHexQualityMeasure( VTK_QUALITY_MAX_ASPECT_FROBENIUS );
399  }
401  {
402  this->SetHexQualityMeasure( VTK_QUALITY_MAX_EDGE_RATIO );
403  }
405  {
406  this->SetHexQualityMeasure( VTK_QUALITY_SKEW );
407  }
409  {
410  this->SetHexQualityMeasure( VTK_QUALITY_TAPER );
411  }
413  {
414  this->SetHexQualityMeasure( VTK_QUALITY_VOLUME );
415  }
417  {
418  this->SetHexQualityMeasure( VTK_QUALITY_STRETCH );
419  }
421  {
422  this->SetHexQualityMeasure( VTK_QUALITY_DIAGONAL );
423  }
425  {
426  this->SetHexQualityMeasure( VTK_QUALITY_DIMENSION );
427  }
429  {
430  this->SetHexQualityMeasure( VTK_QUALITY_ODDY );
431  }
433  {
434  this->SetHexQualityMeasure( VTK_QUALITY_CONDITION );
435  }
437  {
438  this->SetHexQualityMeasure( VTK_QUALITY_JACOBIAN );
439  }
441  {
442  this->SetHexQualityMeasure( VTK_QUALITY_SCALED_JACOBIAN );
443  }
445  {
446  this->SetHexQualityMeasure( VTK_QUALITY_SHEAR );
447  }
449  {
450  this->SetHexQualityMeasure( VTK_QUALITY_SHAPE );
451  }
453  {
454  this->SetHexQualityMeasure( VTK_QUALITY_RELATIVE_SIZE_SQUARED );
455  }
457  {
458  this->SetHexQualityMeasure( VTK_QUALITY_SHAPE_AND_SIZE );
459  }
461  {
462  this->SetHexQualityMeasure( VTK_QUALITY_SHEAR_AND_SIZE );
463  }
465  {
466  this->SetHexQualityMeasure( VTK_QUALITY_DISTORTION );
467  }
469 
474  static double TriangleArea( vtkCell* cell );
475 
483  static double TriangleEdgeRatio( vtkCell* cell );
484 
492  static double TriangleAspectRatio( vtkCell* cell );
493 
500  static double TriangleRadiusRatio( vtkCell* cell );
501 
511  static double TriangleAspectFrobenius( vtkCell* cell );
512 
518  static double TriangleMinAngle( vtkCell* cell );
519 
525  static double TriangleMaxAngle( vtkCell* cell );
526 
531  static double TriangleCondition( vtkCell* cell );
532 
537  static double TriangleScaledJacobian( vtkCell* cell );
538 
543  static double TriangleRelativeSizeSquared( vtkCell* cell );
544 
549  static double TriangleShape( vtkCell* cell );
550 
555  static double TriangleShapeAndSize( vtkCell* cell );
556 
561  static double TriangleDistortion( vtkCell* cell );
562 
570  static double QuadEdgeRatio( vtkCell* cell );
571 
581  static double QuadAspectRatio( vtkCell* cell );
582 
596  static double QuadRadiusRatio( vtkCell* cell );
597 
609  static double QuadMedAspectFrobenius( vtkCell* cell );
610 
622  static double QuadMaxAspectFrobenius( vtkCell* cell );
623 
629  static double QuadMinAngle( vtkCell* cell );
630 
631  static double QuadMaxEdgeRatios( vtkCell* cell );
632  static double QuadSkew( vtkCell* cell );
633  static double QuadTaper( vtkCell* cell );
634  static double QuadWarpage( vtkCell* cell );
635  static double QuadArea( vtkCell* cell );
636  static double QuadStretch( vtkCell* cell );
637  static double QuadMaxAngle( vtkCell* cell );
638  static double QuadOddy( vtkCell* cell );
639  static double QuadCondition( vtkCell* cell );
640  static double QuadJacobian( vtkCell* cell );
641  static double QuadScaledJacobian( vtkCell* cell );
642  static double QuadShear( vtkCell* cell );
643  static double QuadShape( vtkCell* cell );
644  static double QuadRelativeSizeSquared( vtkCell* cell );
645  static double QuadShapeAndSize( vtkCell* cell );
646  static double QuadShearAndSize( vtkCell* cell );
647  static double QuadDistortion( vtkCell* cell );
648 
656  static double TetEdgeRatio( vtkCell* cell );
657 
665  static double TetAspectRatio( vtkCell* cell );
666 
673  static double TetRadiusRatio( vtkCell* cell );
674 
685  static double TetAspectFrobenius( vtkCell* cell );
686 
692  static double TetMinAngle( vtkCell* cell );
693 
695 
702  static double TetCollapseRatio( vtkCell* cell );
703  static double TetAspectBeta( vtkCell* cell );
704  static double TetAspectGamma( vtkCell* cell );
705  static double TetVolume( vtkCell* cell );
706  static double TetCondition( vtkCell* cell );
707  static double TetJacobian( vtkCell* cell );
708  static double TetScaledJacobian( vtkCell* cell );
709  static double TetShape( vtkCell* cell );
710  static double TetRelativeSizeSquared( vtkCell* cell );
711  static double TetShapeandSize( vtkCell* cell );
712  static double TetDistortion( vtkCell* cell );
714 
722  static double HexEdgeRatio( vtkCell* cell );
723 
730  static double HexMedAspectFrobenius( vtkCell* cell );
731 
733 
739  static double HexMaxAspectFrobenius( vtkCell* cell );
740  static double HexMaxEdgeRatio( vtkCell* cell );
741  static double HexSkew( vtkCell* cell );
742  static double HexTaper( vtkCell* cell );
743  static double HexVolume( vtkCell* cell );
744  static double HexStretch( vtkCell* cell );
745  static double HexDiagonal( vtkCell* cell );
746  static double HexDimension( vtkCell* cell );
747  static double HexOddy( vtkCell* cell );
748  static double HexCondition( vtkCell* cell );
749  static double HexJacobian( vtkCell* cell );
750  static double HexScaledJacobian( vtkCell* cell );
751  static double HexShear( vtkCell* cell );
752  static double HexShape( vtkCell* cell );
753  static double HexRelativeSizeSquared( vtkCell* cell );
754  static double HexShapeAndSize( vtkCell* cell );
755  static double HexShearAndSize( vtkCell* cell );
756  static double HexDistortion( vtkCell* cell );
758 
760 
766  virtual void SetRatio( int r ) { this->SetSaveCellQuality( r ); }
767  int GetRatio() { return this->GetSaveCellQuality(); }
768  vtkBooleanMacro(Ratio,int);
770 
772 
784  virtual void SetVolume( int cv )
785  {
786  if ( ! ((cv != 0) ^ (this->Volume != 0)) )
787  {
788  return;
789  }
790  this->Modified();
791  this->Volume = cv;
792  if ( this->Volume )
793  {
794  this->CompatibilityModeOn();
795  }
796  }
797  int GetVolume()
798  {
799  return this->Volume;
800  }
801  vtkBooleanMacro(Volume,int);
803 
805 
823  virtual void SetCompatibilityMode( int cm )
824  {
825  if ( !((cm != 0) ^ (this->CompatibilityMode != 0)) )
826  {
827  return;
828  }
829  this->CompatibilityMode = cm;
830  this->Modified();
831  if ( this->CompatibilityMode )
832  {
833  this->Volume = 1;
834  this->TetQualityMeasure = VTK_QUALITY_RADIUS_RATIO;
835  }
836  }
837  vtkGetMacro(CompatibilityMode,int);
838  vtkBooleanMacro(CompatibilityMode,int);
840 
841 protected:
842  vtkMeshQuality();
843  ~vtkMeshQuality();
844 
846 
849  static int GetCurrentTriangleNormal( double point[3], double normal[3] );
850 
856 
858  int Volume;
859 
861  static double CurrentTriNormal[3];
862 
863 private:
864  vtkMeshQuality( const vtkMeshQuality& ); // Not implemented.
865  void operator = ( const vtkMeshQuality& ); // Not implemented.
866 };
867 
868 #endif // vtkMeshQuality_h
#define VTK_QUALITY_SHEAR
void SetQuadQualityMeasureToEdgeRatio()
void SetQuadQualityMeasureToWarpage()
void SetQuadQualityMeasureToRelativeSizeSquared()
#define VTK_QUALITY_DIMENSION
void SetHexQualityMeasureToMedAspectFrobenius()
void SetTetQualityMeasureToMinAngle()
void SetHexQualityMeasureToRelativeSizeSquared()
void SetQuadQualityMeasureToRadiusRatio()
void SetTriangleQualityMeasureToAspectFrobenius()
void SetTriangleQualityMeasureToArea()
void SetTriangleQualityMeasureToAspectRatio()
#define VTK_QUALITY_STRETCH
#define VTK_QUALITY_ASPECT_RATIO
void SetHexQualityMeasureToScaledJacobian()
void SetTetQualityMeasureToScaledJacobian()
void SetTetQualityMeasureToEdgeRatio()
void SetHexQualityMeasureToVolume()
void SetQuadQualityMeasureToOddy()
Store vtkAlgorithm input/output information.
void SetHexQualityMeasureToShapeAndSize()
#define VTK_QUALITY_ASPECT_BETA
void SetQuadQualityMeasureToMaxAngle()
void SetHexQualityMeasureToEdgeRatio()
#define VTK_QUALITY_JACOBIAN
virtual void SetRatio(int r)
void SetTetQualityMeasureToRelativeSizeSquared()
#define VTK_QUALITY_EDGE_RATIO
void SetTetQualityMeasureToCondition()
#define VTK_QUALITY_SHEAR_AND_SIZE
void SetTetQualityMeasureToShapeAndSize()
void SetTriangleQualityMeasureToDistortion()
void SetTriangleQualityMeasureToCondition()
#define VTKFILTERSVERDICT_EXPORT
void SetQuadQualityMeasureToMinAngle()
void SetQuadQualityMeasureToMedAspectFrobenius()
#define VTK_QUALITY_ODDY
void SetQuadQualityMeasureToShearAndSize()
#define VTK_QUALITY_RADIUS_RATIO
void SetQuadQualityMeasureToMaxEdgeRatios()
virtual void SetVolume(int cv)
void SetHexQualityMeasureToSkew()
void SetQuadQualityMeasureToMaxAspectFrobenius()
void SetTriangleQualityMeasureToShape()
void SetQuadQualityMeasureToAspectRatio()
void SetTriangleQualityMeasureToScaledJacobian()
virtual void SetCompatibilityMode(int cm)
#define VTK_QUALITY_VOLUME
#define VTK_QUALITY_RELATIVE_SIZE_SQUARED
#define VTK_QUALITY_MIN_ANGLE
void SetTetQualityMeasureToJacobian()
void SetTetQualityMeasureToDistortion()
#define VTK_QUALITY_DIAGONAL
void SetQuadQualityMeasureToScaledJacobian()
void SetQuadQualityMeasureToJacobian()
#define VTK_QUALITY_WARPAGE
#define VTK_QUALITY_SKEW
void SetHexQualityMeasureToDiagonal()
abstract class to specify cell behavior
Definition: vtkCell.h:58
void SetQuadQualityMeasureToStretch()
void SetTriangleQualityMeasureToRadiusRatio()
void SetTriangleQualityMeasureToEdgeRatio()
void SetTetQualityMeasureToCollapseRatio()
void SetTetQualityMeasureToAspectBeta()
void SetTetQualityMeasureToAspectFrobenius()
#define VTK_QUALITY_MAX_ASPECT_FROBENIUS
void SetHexQualityMeasureToDistortion()
a simple class to control print indentation
Definition: vtkIndent.h:38
void SetHexQualityMeasureToJacobian()
void SetTetQualityMeasureToVolume()
#define VTK_QUALITY_SHAPE_AND_SIZE
void SetHexQualityMeasureToMaxEdgeRatios()
void SetHexQualityMeasureToMaxAspectFrobenius()
#define VTK_QUALITY_AREA
void SetTriangleQualityMeasureToMinAngle()
#define VTK_QUALITY_TAPER
void SetTetQualityMeasureToRadiusRatio()
void SetQuadQualityMeasureToShapeAndSize()
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void SetQuadQualityMeasureToShear()
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetTriangleQualityMeasureToRelativeSizeSquared()
#define VTK_QUALITY_MAX_ANGLE
virtual void Modified()
#define VTK_QUALITY_COLLAPSE_RATIO
void SetQuadQualityMeasureToArea()
void SetHexQualityMeasureToStretch()
void SetTriangleQualityMeasureToShapeAndSize()
#define VTK_QUALITY_MED_ASPECT_FROBENIUS
void SetHexQualityMeasureToShearAndSize()
void SetHexQualityMeasureToTaper()
void SetHexQualityMeasureToShear()
void SetHexQualityMeasureToShape()
void SetQuadQualityMeasureToDistortion()
void SetHexQualityMeasureToOddy()
void SetQuadQualityMeasureToSkew()
void SetTetQualityMeasureToAspectRatio()
#define VTK_QUALITY_ASPECT_GAMMA
void SetQuadQualityMeasureToShape()
#define VTK_QUALITY_CONDITION
void SetTriangleQualityMeasureToMaxAngle()
#define VTK_QUALITY_DISTORTION
Store zero or more vtkInformation instances.
vtkDataArray * CellNormals
void SetTetQualityMeasureToAspectGamma()
Calculate functions of quality of the elements of a mesh.
#define VTK_QUALITY_SHAPE
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce output of the same type as input.
void SetHexQualityMeasureToDimension()
#define VTK_QUALITY_MAX_EDGE_RATIO
void SetQuadQualityMeasureToTaper()
void SetTetQualityMeasureToShape()
static vtkDataSetAlgorithm * New()
#define VTK_QUALITY_ASPECT_FROBENIUS
#define VTK_QUALITY_SCALED_JACOBIAN
void SetQuadQualityMeasureToCondition()
void SetHexQualityMeasureToCondition()