VTK
vtkGenericCellTessellator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericCellTessellator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
39 #ifndef __vtkGenericCellTessellator_h
40 #define __vtkGenericCellTessellator_h
41 
42 #include "vtkObject.h"
43 
44 class vtkCellArray;
45 class vtkDoubleArray;
46 class vtkCollection;
50 class vtkPointData;
51 class vtkGenericDataSet;
52 
53 //-----------------------------------------------------------------------------
54 //
55 // The tessellation object
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
70  virtual void TessellateFace(vtkGenericAdaptorCell *cell,
74  vtkCellArray *cellArray,
75  vtkPointData *internalPd)=0;
77 
79 
85  virtual void Tessellate(vtkGenericAdaptorCell *cell,
88  vtkCellArray *cellArray,
89  vtkPointData *internalPd )=0;
91 
93 
99  virtual void Triangulate(vtkGenericAdaptorCell *cell,
102  vtkCellArray *cellArray,
103  vtkPointData *internalPd)=0;
105 
107 
110  virtual void SetErrorMetrics(vtkCollection *someErrorMetrics);
111  vtkGetObjectMacro(ErrorMetrics,vtkCollection);
113 
115  virtual void Initialize(vtkGenericDataSet *ds)=0;
116 
119  void InitErrorMetrics(vtkGenericDataSet *ds);
120 
122 
123  vtkGetMacro(Measurement,int);
124  vtkSetMacro(Measurement,int);
126 
130  void GetMaxErrors(double *errors);
131 
132 protected:
135 
137 
149  int RequiresEdgeSubdivision(double *left, double *mid, double *right,
150  double alpha);
152 
153 
155 
164  virtual void UpdateMaxError(double *leftPoint, double *midPoint,
165  double *rightPoint, double alpha);
167 
170  void ResetMaxErrors();
171 
174 
178  void SetGenericCell(vtkGenericAdaptorCell *cell);
179 
181 
182  int Measurement; // if true, measure the quality of the fixed subdivision.
183  double *MaxErrors; // max error for each error metric, for measuring the
184  // quality of a fixed subdivision.
186 
187 private:
188  vtkGenericCellTessellator(const vtkGenericCellTessellator&); // Not implemented.
189  void operator=(const vtkGenericCellTessellator&); // Not implemented.
190 };
191 
192 #endif