VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkCommonDataModelModule.h" // For export macro
43 #include "vtkObject.h"
44 
45 class vtkCellArray;
46 class vtkDoubleArray;
47 class vtkCollection;
48 class vtkGenericAttributeCollection;
50 class vtkGenericCellIterator;
51 class vtkPointData;
52 class vtkGenericDataSet;
53 
54 //-----------------------------------------------------------------------------
55 //
56 // The tessellation object
57 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCellTessellator : public vtkObject
58 {
59 public:
60  vtkTypeMacro(vtkGenericCellTessellator,vtkObject);
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
71  virtual void TessellateFace(vtkGenericAdaptorCell *cell,
72  vtkGenericAttributeCollection *att,
73  vtkIdType index,
74  vtkDoubleArray *points,
75  vtkCellArray *cellArray,
76  vtkPointData *internalPd)=0;
78 
80 
86  virtual void Tessellate(vtkGenericAdaptorCell *cell,
87  vtkGenericAttributeCollection *att,
88  vtkDoubleArray *points,
89  vtkCellArray *cellArray,
90  vtkPointData *internalPd )=0;
92 
94 
100  virtual void Triangulate(vtkGenericAdaptorCell *cell,
101  vtkGenericAttributeCollection *att,
102  vtkDoubleArray *points,
103  vtkCellArray *cellArray,
104  vtkPointData *internalPd)=0;
106 
108 
111  virtual void SetErrorMetrics(vtkCollection *someErrorMetrics);
112  vtkGetObjectMacro(ErrorMetrics,vtkCollection);
114 
116  virtual void Initialize(vtkGenericDataSet *ds)=0;
117 
120  void InitErrorMetrics(vtkGenericDataSet *ds);
121 
123 
124  vtkGetMacro(Measurement,int);
125  vtkSetMacro(Measurement,int);
127 
131  void GetMaxErrors(double *errors);
132 
133 protected:
136 
138 
150  int RequiresEdgeSubdivision(double *left, double *mid, double *right,
151  double alpha);
153 
154 
156 
165  virtual void UpdateMaxError(double *leftPoint, double *midPoint,
166  double *rightPoint, double alpha);
168 
171  void ResetMaxErrors();
172 
174  vtkCollection *ErrorMetrics;
175 
179  void SetGenericCell(vtkGenericAdaptorCell *cell);
180 
181  vtkGenericDataSet *DataSet;
182 
183  int Measurement; // if true, measure the quality of the fixed subdivision.
184  double *MaxErrors; // max error for each error metric, for measuring the
185  // quality of a fixed subdivision.
187 
188 private:
189  vtkGenericCellTessellator(const vtkGenericCellTessellator&); // Not implemented.
190  void operator=(const vtkGenericCellTessellator&); // Not implemented.
191 };
192 
193 #endif
helper class to perform cell tessellation
defines cell interface
object to represent cell connectivity
Definition: vtkCellArray.h:49