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 
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
vtkX3D::alpha
@ alpha
Definition: vtkX3D.h:256
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkGenericAdaptorCell
defines cell interface
Definition: vtkGenericAdaptorCell.h:91
vtkGenericCellIterator
iterator used to traverse cells
Definition: vtkGenericCellIterator.h:41
vtkGenericDataSet
defines dataset interface
Definition: vtkGenericDataSet.h:69
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkGenericCellTessellator
helper class to perform cell tessellation
Definition: vtkGenericCellTessellator.h:58
vtkGenericCellTessellator::DataSet
vtkGenericDataSet * DataSet
Dataset to be tessellated.
Definition: vtkGenericCellTessellator.h:202
vtkGenericCellTessellator::MaxErrorsCapacity
int MaxErrorsCapacity
Definition: vtkGenericCellTessellator.h:207
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
vtkGenericCellTessellator::ErrorMetrics
vtkCollection * ErrorMetrics
List of error metrics.
Definition: vtkGenericCellTessellator.h:189
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:33
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkGenericCellTessellator::Measurement
int Measurement
Definition: vtkGenericCellTessellator.h:204
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkGenericCellTessellator::MaxErrors
double * MaxErrors
Definition: vtkGenericCellTessellator.h:205