VTK
dox/Common/DataModel/vtkGenericCellTessellator.h
Go to the documentation of this file.
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 "vtkCommonDataModelModule.h" // For export macro
00043 #include "vtkObject.h"
00044 
00045 class vtkCellArray;
00046 class vtkDoubleArray;
00047 class vtkCollection;
00048 class vtkGenericAttributeCollection;
00049 class vtkGenericAdaptorCell;
00050 class vtkGenericCellIterator;
00051 class vtkPointData;
00052 class vtkGenericDataSet;
00053 
00054 //-----------------------------------------------------------------------------
00055 //
00056 // The tessellation object
00057 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCellTessellator : public vtkObject
00058 {
00059 public:
00060   vtkTypeMacro(vtkGenericCellTessellator,vtkObject);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00064 
00071   virtual void TessellateFace(vtkGenericAdaptorCell *cell,
00072                               vtkGenericAttributeCollection *att,
00073                               vtkIdType index,
00074                               vtkDoubleArray *points,
00075                               vtkCellArray *cellArray,
00076                               vtkPointData *internalPd)=0;
00078 
00080 
00086   virtual void Tessellate(vtkGenericAdaptorCell *cell,
00087                           vtkGenericAttributeCollection *att,
00088                           vtkDoubleArray *points,
00089                           vtkCellArray *cellArray,
00090                           vtkPointData *internalPd )=0;
00092 
00094 
00100   virtual void Triangulate(vtkGenericAdaptorCell *cell,
00101                            vtkGenericAttributeCollection *att,
00102                            vtkDoubleArray *points,
00103                            vtkCellArray *cellArray,
00104                            vtkPointData *internalPd)=0;
00106 
00108 
00111   virtual void SetErrorMetrics(vtkCollection *someErrorMetrics);
00112   vtkGetObjectMacro(ErrorMetrics,vtkCollection);
00114 
00116   virtual void Initialize(vtkGenericDataSet *ds)=0;
00117 
00120   void InitErrorMetrics(vtkGenericDataSet *ds);
00121 
00123 
00124   vtkGetMacro(Measurement,int);
00125   vtkSetMacro(Measurement,int);
00127 
00131   void GetMaxErrors(double *errors);
00132 
00133 protected:
00134   vtkGenericCellTessellator();
00135   ~vtkGenericCellTessellator();
00136 
00138 
00150   int RequiresEdgeSubdivision(double *left, double *mid, double *right,
00151                               double alpha);
00153 
00154 
00156 
00165   virtual void UpdateMaxError(double *leftPoint, double *midPoint,
00166                               double *rightPoint, double alpha);
00168 
00171   void ResetMaxErrors();
00172 
00174   vtkCollection *ErrorMetrics;
00175 
00179   void SetGenericCell(vtkGenericAdaptorCell *cell);
00180 
00181   vtkGenericDataSet *DataSet;
00182 
00183   int Measurement; // if true, measure the quality of the fixed subdivision.
00184   double *MaxErrors; // max error for each error metric, for measuring the
00185   // quality of a fixed subdivision.
00186   int MaxErrorsCapacity;
00187 
00188 private:
00189   vtkGenericCellTessellator(const vtkGenericCellTessellator&);  // Not implemented.
00190   void operator=(const vtkGenericCellTessellator&);  // Not implemented.
00191 };
00192 
00193 #endif