VTK  9.3.1
vtkGenericCellTessellator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
28 #ifndef vtkGenericCellTessellator_h
29 #define vtkGenericCellTessellator_h
30 
31 #include "vtkCommonDataModelModule.h" // For export macro
32 #include "vtkObject.h"
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkCellArray;
36 class vtkDoubleArray;
37 class vtkCollection;
41 class vtkPointData;
42 class vtkGenericDataSet;
43 
44 //-----------------------------------------------------------------------------
45 //
46 // The tessellation object
47 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCellTessellator : public vtkObject
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
66  virtual void TessellateFace(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
67  vtkIdType index, vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
68 
79  virtual void Tessellate(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
80  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
81 
92  virtual void Triangulate(vtkGenericAdaptorCell* cell, vtkGenericAttributeCollection* att,
93  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
94 
96 
100  virtual void SetErrorMetrics(vtkCollection* someErrorMetrics);
101  vtkGetObjectMacro(ErrorMetrics, vtkCollection);
103 
107  virtual void Initialize(vtkGenericDataSet* ds) = 0;
108 
113  void InitErrorMetrics(vtkGenericDataSet* ds);
114 
116 
119  vtkGetMacro(Measurement, int);
120  vtkSetMacro(Measurement, int);
122 
128  void GetMaxErrors(double* errors);
129 
130 protected:
132  ~vtkGenericCellTessellator() override;
133 
151  int RequiresEdgeSubdivision(double* left, double* mid, double* right, double alpha);
152 
166  virtual void UpdateMaxError(
167  double* leftPoint, double* midPoint, double* rightPoint, double alpha);
168 
173  void ResetMaxErrors();
174 
179 
186  void SetGenericCell(vtkGenericAdaptorCell* cell);
187 
192 
193  int Measurement; // if true, measure the quality of the fixed subdivision.
194  double* MaxErrors; // max error for each error metric, for measuring the
195  // quality of a fixed subdivision.
197 
198 private:
200  void operator=(const vtkGenericCellTessellator&) = delete;
201 };
202 
203 VTK_ABI_NAMESPACE_END
204 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate point attribute data
Definition: vtkPointData.h:29
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:315
dynamic, self-adjusting array of double
iterator used to traverse cells
defines cell interface
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkCollection * ErrorMetrics
List of error metrics.
object to represent cell connectivity
Definition: vtkCellArray.h:175
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
vtkGenericDataSet * DataSet
Dataset to be tessellated.
defines dataset interface