VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGenericCellTessellator.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00039 #ifndef __vtkGenericCellTessellator_h 00040 #define __vtkGenericCellTessellator_h 00041 00042 #include "vtkObject.h" 00043 00044 class vtkCellArray; 00045 class vtkDoubleArray; 00046 class vtkCollection; 00047 class vtkGenericAttributeCollection; 00048 class vtkGenericAdaptorCell; 00049 class vtkGenericCellIterator; 00050 class vtkPointData; 00051 class vtkGenericDataSet; 00052 00053 //----------------------------------------------------------------------------- 00054 // 00055 // The tessellation object 00056 class VTK_FILTERING_EXPORT vtkGenericCellTessellator : public vtkObject 00057 { 00058 public: 00059 vtkTypeMacro(vtkGenericCellTessellator,vtkObject); 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 00070 virtual void TessellateFace(vtkGenericAdaptorCell *cell, 00071 vtkGenericAttributeCollection *att, 00072 vtkIdType index, 00073 vtkDoubleArray *points, 00074 vtkCellArray *cellArray, 00075 vtkPointData *internalPd)=0; 00077 00079 00085 virtual void Tessellate(vtkGenericAdaptorCell *cell, 00086 vtkGenericAttributeCollection *att, 00087 vtkDoubleArray *points, 00088 vtkCellArray *cellArray, 00089 vtkPointData *internalPd )=0; 00091 00093 00099 virtual void Triangulate(vtkGenericAdaptorCell *cell, 00100 vtkGenericAttributeCollection *att, 00101 vtkDoubleArray *points, 00102 vtkCellArray *cellArray, 00103 vtkPointData *internalPd)=0; 00105 00107 00110 virtual void SetErrorMetrics(vtkCollection *someErrorMetrics); 00111 vtkGetObjectMacro(ErrorMetrics,vtkCollection); 00113 00115 virtual void Initialize(vtkGenericDataSet *ds)=0; 00116 00119 void InitErrorMetrics(vtkGenericDataSet *ds); 00120 00122 00123 vtkGetMacro(Measurement,int); 00124 vtkSetMacro(Measurement,int); 00126 00130 void GetMaxErrors(double *errors); 00131 00132 protected: 00133 vtkGenericCellTessellator(); 00134 ~vtkGenericCellTessellator(); 00135 00137 00149 int RequiresEdgeSubdivision(double *left, double *mid, double *right, 00150 double alpha); 00152 00153 00155 00164 virtual void UpdateMaxError(double *leftPoint, double *midPoint, 00165 double *rightPoint, double alpha); 00167 00170 void ResetMaxErrors(); 00171 00173 vtkCollection *ErrorMetrics; 00174 00178 void SetGenericCell(vtkGenericAdaptorCell *cell); 00179 00180 vtkGenericDataSet *DataSet; 00181 00182 int Measurement; // if true, measure the quality of the fixed subdivision. 00183 double *MaxErrors; // max error for each error metric, for measuring the 00184 // quality of a fixed subdivision. 00185 int MaxErrorsCapacity; 00186 00187 private: 00188 vtkGenericCellTessellator(const vtkGenericCellTessellator&); // Not implemented. 00189 void operator=(const vtkGenericCellTessellator&); // Not implemented. 00190 }; 00191 00192 #endif