00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00031 #ifndef __vtkCellQuality_h
00032 #define __vtkCellQuality_h
00033
00034 #include "vtkDataSetAlgorithm.h"
00035
00036 class vtkCell;
00037 class vtkDataArray;
00038 class vtkIdList;
00039 class vtkPoints;
00040
00041 class VTK_GRAPHICS_EXPORT vtkCellQuality : public vtkDataSetAlgorithm
00042 {
00043
00044 enum
00045 {
00046 NONE = 0,
00047 AREA,
00048 ASPECT_BETA,
00049 ASPECT_FROBENIUS,
00050 ASPECT_GAMMA,
00051 ASPECT_RATIO,
00052 COLLAPSE_RATIO,
00053 CONDITION,
00054 DIAGONAL,
00055 DIMENSION,
00056 DISTORTION,
00057 EDGE_RATIO,
00058 JACOBIAN,
00059 MAX_ANGLE,
00060 MAX_ASPECT_FROBENIUS,
00061 MAX_EDGE_RATIO,
00062 MED_ASPECT_FROBENIUS,
00063 MIN_ANGLE,
00064 NORMAL,
00065 ODDY,
00066 RADIUS_RATIO,
00067 RELATIVE_SIZE_SQUARED,
00068 SCALED_JACOBIAN,
00069 SHAPE,
00070 SHAPE_AND_SIZE,
00071 SHEAR,
00072 SHEAR_AND_SIZE,
00073 SKEW,
00074 STRETCH,
00075 TAPER,
00076 VOLUME,
00077 WARPAGE,
00078 };
00079
00080
00081 public:
00082 void PrintSelf (ostream&, vtkIndent);
00083 vtkTypeMacro(vtkCellQuality, vtkDataSetAlgorithm);
00084 static vtkCellQuality* New ();
00085
00087
00093 vtkSetMacro(QualityMeasure, int);
00094 vtkGetMacro(QualityMeasure, int);
00096
00097 void SetQualityMeasureToArea ()
00098 {
00099 this->SetQualityMeasure(AREA);
00100 }
00101 void SetQualityMeasureToAspectBeta ()
00102 {
00103 this->SetQualityMeasure(ASPECT_BETA);
00104 }
00105 void SetQualityMeasureToAspectFrobenius ()
00106 {
00107 this->SetQualityMeasure(ASPECT_FROBENIUS);
00108 }
00109 void SetQualityMeasureToAspectGamma ()
00110 {
00111 this->SetQualityMeasure(ASPECT_GAMMA);
00112 }
00113 void SetQualityMeasureToAspectRatio ()
00114 {
00115 this->SetQualityMeasure(ASPECT_RATIO);
00116 }
00117 void SetQualityMeasureToCollapseRatio ()
00118 {
00119 this->SetQualityMeasure(COLLAPSE_RATIO);
00120 }
00121 void SetQualityMeasureToCondition ()
00122 {
00123 this->SetQualityMeasure(CONDITION);
00124 }
00125 void SetQualityMeasureToDiagonal ()
00126 {
00127 this->SetQualityMeasure(DIAGONAL);
00128 }
00129 void SetQualityMeasureToDimension ()
00130 {
00131 this->SetQualityMeasure(DIMENSION);
00132 }
00133 void SetQualityMeasureToDistortion ()
00134 {
00135 this->SetQualityMeasure(DISTORTION);
00136 }
00137 void SetQualityMeasureToJacobian ()
00138 {
00139 this->SetQualityMeasure(JACOBIAN);
00140 }
00141 void SetQualityMeasureToMaxAngle ()
00142 {
00143 this->SetQualityMeasure(MAX_ANGLE);
00144 }
00145 void SetQualityMeasureToMaxAspectFrobenius ()
00146 {
00147 this->SetQualityMeasure(MAX_ASPECT_FROBENIUS);
00148 }
00149 void SetQualityMeasureToMaxEdgeRatio ()
00150 {
00151 this->SetQualityMeasure(MAX_EDGE_RATIO);
00152 }
00153 void SetQualityMeasureToMedAspectFrobenius ()
00154 {
00155 this->SetQualityMeasure(MED_ASPECT_FROBENIUS);
00156 }
00157 void SetQualityMeasureToMinAngle ()
00158 {
00159 this->SetQualityMeasure(MIN_ANGLE);
00160 }
00161 void SetQualityMeasureToOddy ()
00162 {
00163 this->SetQualityMeasure(ODDY);
00164 }
00165 void SetQualityMeasureToRadiusRatio ()
00166 {
00167 this->SetQualityMeasure(RADIUS_RATIO);
00168 }
00169 void SetQualityMeasureToRelativeSizeSquared ()
00170 {
00171 this->SetQualityMeasure(RELATIVE_SIZE_SQUARED);
00172 }
00173 void SetQualityMeasureToScaledJacobian ()
00174 {
00175 this->SetQualityMeasure(SCALED_JACOBIAN);
00176 }
00177 void SetQualityMeasureToShapeAndSize ()
00178 {
00179 this->SetQualityMeasure(SHAPE_AND_SIZE);
00180 }
00181 void SetQualityMeasureToShape ()
00182 {
00183 this->SetQualityMeasure(SHAPE);
00184 }
00185 void SetQualityMeasureToShearAndSize ()
00186 {
00187 this->SetQualityMeasure(SHEAR_AND_SIZE);
00188 }
00189 void SetQualityMeasureToShear ()
00190 {
00191 this->SetQualityMeasure(SHEAR);
00192 }
00193 void SetQualityMeasureToSkew ()
00194 {
00195 this->SetQualityMeasure(SKEW);
00196 }
00197 void SetQualityMeasureToStretch ()
00198 {
00199 this->SetQualityMeasure(STRETCH);
00200 }
00201 void SetQualityMeasureToTaper ()
00202 {
00203 this->SetQualityMeasure(TAPER);
00204 }
00205 void SetQualityMeasureToVolume ()
00206 {
00207 this->SetQualityMeasure(VOLUME);
00208 }
00209 void SetQualityMeasureToWarpage ()
00210 {
00211 this->SetQualityMeasure(WARPAGE);
00212 }
00213
00215
00219 vtkSetMacro(UnsupportedGeometry, double);
00220 vtkGetMacro(UnsupportedGeometry, double);
00222
00224
00229 vtkSetMacro(UndefinedQuality, double);
00230 vtkGetMacro(UndefinedQuality, double);
00232
00233 double TriangleStripArea (vtkCell*);
00234 double PixelArea (vtkCell*);
00235 double PolygonArea (vtkCell*);
00236
00237 protected:
00238 ~vtkCellQuality ();
00239 vtkCellQuality ();
00240
00246 double ComputeTriangleQuality (vtkCell*);
00247
00257 double ComputeQuadQuality (vtkCell*);
00258
00265 double ComputeTetQuality (vtkCell*);
00266
00273 double ComputeHexQuality (vtkCell*);
00274
00278 double ComputeTriangleStripQuality (vtkCell*);
00279
00282 double ComputePixelQuality (vtkCell*);
00283
00284 virtual int RequestData
00285 (vtkInformation*, vtkInformationVector**, vtkInformationVector*);
00286
00288
00292 static int GetCurrentTriangleNormal (double point [3], double normal [3]);
00293 static double CurrentTriNormal [3];
00295
00296 int QualityMeasure;
00297
00298
00299 double UnsupportedGeometry;
00300
00301
00302
00303 double UndefinedQuality;
00304
00305 private:
00306 vtkIdList* PointIds;
00307 vtkPoints* Points;
00308
00309 vtkCellQuality(const vtkCellQuality&);
00310 void operator=(const vtkCellQuality&);
00311 };
00312
00313 #endif // vtkCellQuality_h