VTK  9.2.6
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 =========================================================================*/
40 #ifndef vtkGenericCellTessellator_h
41 #define vtkGenericCellTessellator_h
42 
43 #include "vtkCommonDataModelModule.h" // For export macro
44 #include "vtkObject.h"
45 
46 class vtkCellArray;
47 class vtkDoubleArray;
48 class vtkCollection;
52 class vtkPointData;
53 class vtkGenericDataSet;
54 
55 //-----------------------------------------------------------------------------
56 //
57 // The tessellation object
58 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCellTessellator : public vtkObject
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
77  virtual void TessellateFace(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
78  vtkIdType index, vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
79 
90  virtual void Tessellate(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
91  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
92 
103  virtual void Triangulate(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
104  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
105 
107 
111  virtual void SetErrorMetrics(vtkCollection* someErrorMetrics);
112  vtkGetObjectMacro(ErrorMetrics, vtkCollection);
114 
118  virtual void Initialize(vtkGenericDataSet* ds) = 0;
119 
124  void InitErrorMetrics(vtkGenericDataSet* ds);
125 
127 
130  vtkGetMacro(Measurement, int);
131  vtkSetMacro(Measurement, int);
133 
139  void GetMaxErrors(double* errors);
140 
141 protected:
143  ~vtkGenericCellTessellator() override;
144 
162  int RequiresEdgeSubdivision(double* left, double* mid, double* right, double alpha);
163 
177  virtual void UpdateMaxError(
178  double* leftPoint, double* midPoint, double* rightPoint, double alpha);
179 
184  void ResetMaxErrors();
185 
190 
197  void SetGenericCell(vtkGenericAdaptorCell* cell);
198 
203 
204  int Measurement; // if true, measure the quality of the fixed subdivision.
205  double* MaxErrors; // max error for each error metric, for measuring the
206  // quality of a fixed subdivision.
208 
209 private:
211  void operator=(const vtkGenericCellTessellator&) = delete;
212 };
213 
214 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate point attribute data
Definition: vtkPointData.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
helper class to perform cell tessellation
int vtkIdType
Definition: vtkType.h:332
dynamic, self-adjusting array of double
iterator used to traverse cells
defines cell interface
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCollection * ErrorMetrics
List of error metrics.
object to represent cell connectivity
Definition: vtkCellArray.h:186
create and manipulate ordered lists of objects
Definition: vtkCollection.h:55
vtkGenericDataSet * DataSet
Dataset to be tessellated.
defines dataset interface