VTK
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 
81  vtkCellArray *cellArray,
82  vtkPointData *internalPd)=0;
83 
94  virtual void Tessellate(vtkGenericAdaptorCell *cell,
97  vtkCellArray *cellArray,
98  vtkPointData *internalPd )=0;
99 
110  virtual void Triangulate(vtkGenericAdaptorCell *cell,
113  vtkCellArray *cellArray,
114  vtkPointData *internalPd)=0;
115 
117 
121  virtual void SetErrorMetrics(vtkCollection *someErrorMetrics);
122  vtkGetObjectMacro(ErrorMetrics,vtkCollection);
124 
128  virtual void Initialize(vtkGenericDataSet *ds)=0;
129 
135 
137 
140  vtkGetMacro(Measurement,int);
141  vtkSetMacro(Measurement,int);
143 
149  void GetMaxErrors(double *errors);
150 
151 protected:
154 
172  int RequiresEdgeSubdivision(double *left, double *mid, double *right,
173  double alpha);
174 
175 
189  virtual void UpdateMaxError(double *leftPoint, double *midPoint,
190  double *rightPoint, double alpha);
191 
197 
202 
210 
215 
216  int Measurement; // if true, measure the quality of the fixed subdivision.
217  double *MaxErrors; // max error for each error metric, for measuring the
218  // quality of a fixed subdivision.
220 
221 private:
223  void operator=(const vtkGenericCellTessellator&) = delete;
224 };
225 
226 #endif
vtkGenericCellTessellator::Triangulate
virtual void Triangulate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Triangulate a 2D ‘cell’.
vtkX3D::alpha
@ alpha
Definition: vtkX3D.h:250
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkGenericCellTessellator::SetGenericCell
void SetGenericCell(vtkGenericAdaptorCell *cell)
Send the current cell to error metrics.
vtkGenericCellTessellator::Initialize
virtual void Initialize(vtkGenericDataSet *ds)=0
Initialize the tessellator with a data set ‘ds’.
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkGenericCellTessellator::Tessellate
virtual void Tessellate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Tessellate a 3D ‘cell’.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkGenericAdaptorCell
defines cell interface
Definition: vtkGenericAdaptorCell.h:96
vtkGenericCellIterator
iterator used to traverse cells
Definition: vtkGenericCellIterator.h:45
vtkGenericCellTessellator::SetErrorMetrics
virtual void SetErrorMetrics(vtkCollection *someErrorMetrics)
Specify the list of error metrics used to decide if an edge has to be split or not.
vtkGenericDataSet
defines dataset interface
Definition: vtkGenericDataSet.h:70
vtkGenericCellTessellator::vtkGenericCellTessellator
vtkGenericCellTessellator()
vtkGenericCellTessellator::ResetMaxErrors
void ResetMaxErrors()
Reset the maximal error of each error metric.
vtkGenericCellTessellator::GetMaxErrors
void GetMaxErrors(double *errors)
Get the maximum error measured after the fixed subdivision.
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkGenericCellTessellator
helper class to perform cell tessellation
Definition: vtkGenericCellTessellator.h:59
vtkGenericCellTessellator::DataSet
vtkGenericDataSet * DataSet
Dataset to be tessellated.
Definition: vtkGenericCellTessellator.h:214
vtkGenericCellTessellator::MaxErrorsCapacity
int MaxErrorsCapacity
Definition: vtkGenericCellTessellator.h:219
vtkGenericCellTessellator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGenericCellTessellator::RequiresEdgeSubdivision
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...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkGenericCellTessellator::~vtkGenericCellTessellator
~vtkGenericCellTessellator() override
vtkGenericCellTessellator::TessellateFace
virtual void TessellateFace(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkIdType index, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)=0
Tessellate a face of a 3D ‘cell’.
vtkObject.h
vtkGenericCellTessellator::UpdateMaxError
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.
vtkGenericCellTessellator::ErrorMetrics
vtkCollection * ErrorMetrics
List of error metrics.
Definition: vtkGenericCellTessellator.h:201
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:37
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkGenericCellTessellator::Measurement
int Measurement
Definition: vtkGenericCellTessellator.h:216
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkGenericCellTessellator::MaxErrors
double * MaxErrors
Definition: vtkGenericCellTessellator.h:217
vtkGenericCellTessellator::InitErrorMetrics
void InitErrorMetrics(vtkGenericDataSet *ds)
Init the error metric with the dataset.