VTK  9.3.20240419
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 
67  vtkIdType index, vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
68 
80  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
81 
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 
114 
116 
119  vtkGetMacro(Measurement, int);
120  vtkSetMacro(Measurement, int);
122 
128  void GetMaxErrors(double* errors);
129 
130 protected:
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 
174 
179 
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
object to represent cell connectivity
Definition: vtkCellArray.h:286
create and manipulate ordered lists of objects
Definition: vtkCollection.h:46
dynamic, self-adjusting array of double
defines cell interface
iterator used to traverse cells
helper class to perform cell tessellation
virtual void Initialize(vtkGenericDataSet *ds)=0
Initialize the tessellator with a data set ‘ds’.
int RequiresEdgeSubdivision(double *left, double *mid, double *right, double alpha)
Does the edge need to be subdivided according to at least one error metric? The edge is defined by it...
void SetGenericCell(vtkGenericAdaptorCell *cell)
Send the current cell to error metrics.
~vtkGenericCellTessellator() override
virtual void SetErrorMetrics(vtkCollection *someErrorMetrics)
Specify the list of error metrics used to decide if an edge has to be split or not.
virtual void TessellateFace(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkIdType index, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Tessellate a face of a 3D ‘cell’.
virtual void Tessellate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Tessellate a 3D ‘cell’.
virtual void UpdateMaxError(double *leftPoint, double *midPoint, double *rightPoint, double alpha)
Update the max error of each error metric according to the error at the mid-point.
vtkGenericDataSet * DataSet
Dataset to be tessellated.
virtual void Triangulate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Triangulate a 2D ‘cell’.
void InitErrorMetrics(vtkGenericDataSet *ds)
Init the error metric with the dataset.
vtkCollection * ErrorMetrics
List of error metrics.
void ResetMaxErrors()
Reset the maximal error of each error metric.
void GetMaxErrors(double *errors)
Get the maximum error measured after the fixed subdivision.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
defines dataset interface
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
represent and manipulate point attribute data
Definition: vtkPointData.h:140
@ points
Definition: vtkX3D.h:446
@ alpha
Definition: vtkX3D.h:250
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315