VTK  9.0.1
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 
78  vtkIdType index, vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
79 
91  vtkDoubleArray* points, vtkCellArray* cellArray, vtkPointData* internalPd) = 0;
92 
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 
125 
127 
130  vtkGetMacro(Measurement, int);
131  vtkSetMacro(Measurement, int);
133 
139  void GetMaxErrors(double* errors);
140 
141 protected:
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 
185 
190 
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
object to represent cell connectivity
Definition: vtkCellArray.h:180
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
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:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
represent and manipulate point attribute data
Definition: vtkPointData.h:32
@ points
Definition: vtkX3D.h:452
@ alpha
Definition: vtkX3D.h:256
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:338