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) VTK_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 
196  void ResetMaxErrors();
197 
201  vtkCollection *ErrorMetrics;
202 
209  void SetGenericCell(vtkGenericAdaptorCell *cell);
210 
212 
213  int Measurement; // if true, measure the quality of the fixed subdivision.
214  double *MaxErrors; // max error for each error metric, for measuring the
215  // quality of a fixed subdivision.
216  int MaxErrorsCapacity;
217 
218 private:
219  vtkGenericCellTessellator(const vtkGenericCellTessellator&) VTK_DELETE_FUNCTION;
220  void operator=(const vtkGenericCellTessellator&) VTK_DELETE_FUNCTION;
221 };
222 
223 #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::Initialize
virtual void Initialize(vtkGenericDataSet *ds)=0
Initialize the tessellator with a data set ‘ds’.
vtkIdType
int vtkIdType
Definition: vtkType.h:287
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 splitted or not.
vtkGenericDataSet
defines dataset interface
Definition: vtkGenericDataSet.h:70
vtkGenericCellTessellator::vtkGenericCellTessellator
vtkGenericCellTessellator()
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 unsorted lists of objects
Definition: vtkCollection.h:52
vtkGenericCellTessellator
helper class to perform cell tessellation
Definition: vtkGenericCellTessellator.h:59
vtkGenericCellTessellator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:37
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkGenericCellTessellator::InitErrorMetrics
void InitErrorMetrics(vtkGenericDataSet *ds)
Init the error metric with the dataset.