vtkMeshQualityExtended.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   MIMX Meshing Toolkit
00004 Module:    $RCSfile: vtkMeshQualityExtended.h,v $
00005 Language:  C++
00006 Date:      $Date: 2008/06/28 01:24:43 $
00007 Version:   $Revision: 1.2 $
00008 
00009  Musculoskeletal Imaging, Modelling and Experimentation (MIMX)
00010  Center for Computer Aided Design
00011  The University of Iowa
00012  Iowa City, IA 52242
00013  http://www.ccad.uiowa.edu/mimx/
00014  
00015 Copyright (c) The University of Iowa. All rights reserved.
00016 See MIMXCopyright.txt or http://www.ccad.uiowa.edu/mimx/Copyright.htm for details.
00017 
00018 This software is distributed WITHOUT ANY WARRANTY; without even 
00019 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00020 PURPOSE.  See the above copyright notices for more information.
00021 
00022 =========================================================================*/
00023 // .NAME vtkMeshQualityExtended - Calculate measures of quality of a mesh
00024 //
00025 // .SECTION Description
00026 // vtkMeshQualityExtended extends the metrics provided by vtkMeshQuality
00027 // to also include an edge collaspe and angle out of bound metrics for 
00028 // Hexahedron cells. 
00029 //
00030 // .SECTION Caveats
00031 // 
00032 
00033 #ifndef __vtkMeshQualityExtended_h
00034 #define __vtkMeshQualityExtended_h
00035 
00036 #include "vtkMeshQuality.h"
00037 #include "vtkMimxFilterWin32Header.h"
00038 
00039 class vtkCell;
00040 class vtkDataArray;
00041 
00042 /* Added Mesh Quality Metrics by Curt Lisle */
00043 #define VTK_QUALITY_EDGE_COLLAPSE 30
00044 #define VTK_QUALITY_ANGLE_OUT_OF_BOUNDS 31
00045 
00046 class VTK_MIMXFILTER_EXPORT vtkMeshQualityExtended : public vtkMeshQuality
00047 {
00048 public:
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   vtkTypeRevisionMacro(vtkMeshQualityExtended,vtkMeshQuality);
00051   static vtkMeshQualityExtended* New();
00052 
00053   
00054   // Description:
00055   // Set/Get the particular estimator used to measure the quality of hexahedra.
00056   // Two aditional metrics are now provided:
00057   //   VTK_QUALITY_EDGE_COLLAPSE and VTK_QUALITY_ANGLE_OUT_OF_BOUNDS
00058 
00059   void SetHexQualityMeasureToEdgeCollapse()
00060     {
00061     this->SetHexQualityMeasure( VTK_QUALITY_EDGE_COLLAPSE );
00062     }
00063   void SetHexQualityMeasureToAngleOutOfBounds()
00064     {
00065     this->SetHexQualityMeasure( VTK_QUALITY_ANGLE_OUT_OF_BOUNDS );
00066     }
00067 
00068   void SetTetQualityMeasureToEdgeCollapse()
00069     {
00070     this->SetTetQualityMeasure( VTK_QUALITY_EDGE_COLLAPSE );
00071     }
00072   void SetTetQualityMeasureToAngleOutOfBounds()
00073     {
00074     this->SetTetQualityMeasure( VTK_QUALITY_ANGLE_OUT_OF_BOUNDS );
00075     }
00076 
00077   void SetQuadQualityMeasureToEdgeCollapse()
00078     {
00079     this->SetQuadQualityMeasure( VTK_QUALITY_EDGE_COLLAPSE );
00080     }
00081   void SetQuadQualityMeasureToAngleOutOfBounds()
00082     {
00083     this->SetQuadQualityMeasure( VTK_QUALITY_ANGLE_OUT_OF_BOUNDS );
00084     }
00085   
00086   void SetTriangleQualityMeasureToEdgeCollapse()
00087     {
00088     this->SetTriangleQualityMeasure( VTK_QUALITY_EDGE_COLLAPSE );
00089     }
00090   void SetTriangleQualityMeasureToAngleOutOfBounds()
00091     {
00092     this->SetTriangleQualityMeasure( VTK_QUALITY_ANGLE_OUT_OF_BOUNDS );
00093     }
00094 
00095   vtkSetMacro(MetricTolerance, double);
00096   vtkGetMacro(MetricTolerance, double);
00097    
00098   // Description:
00099   // This is a static function used to calculate if any of the edges of the hex have collapsed
00100   // to zero length.  This returns a 1 if collapse occured and a 0 otherwise -- no type checking is
00101   // performed because this method is called from the inner loop of the Execute()
00102   // member function.
00103   // HISTORY:  Added for Iowa FE project April 2007
00104   
00105   static double HexEdgeCollapse( vtkCell* cell );
00106   static double HexAngleOutOfBounds(vtkCell* cell);
00107   static double TriangleEdgeCollapse( vtkCell* cell);
00108   static double QuadEdgeCollapse( vtkCell* cell);
00109   static double TetEdgeCollapse( vtkCell* cell);
00110   static double TriangleAngleOutOfBounds( vtkCell* cell);
00111   static double QuadAngleOutOfBounds( vtkCell* cell);
00112   static double TetAngleOutOfBounds( vtkCell* cell);
00113 
00114 protected:
00115   vtkMeshQualityExtended();
00116   ~vtkMeshQualityExtended();
00117 
00118   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00119 
00120 private:
00121   vtkMeshQualityExtended( const vtkMeshQualityExtended& ); // Not implemented.
00122   void operator = ( const vtkMeshQualityExtended& ); // Not implemented.
00123   
00124   double MetricTolerance;
00125 };
00126 
00127 #endif // vtkMeshQualityExtended_h

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1