VTK
vtkSimpleCellTessellator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSimpleCellTessellator.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 =========================================================================*/
47 #ifndef vtkSimpleCellTessellator_h
48 #define vtkSimpleCellTessellator_h
49 
50 #include "vtkCommonDataModelModule.h" // For export macro
52 
53 class vtkTriangleTile;
54 class vtkTetraTile;
55 class vtkCellArray;
56 class vtkDoubleArray;
62 class vtkPointData;
64 class vtkPolygon;
65 class vtkIdList;
66 
67 //-----------------------------------------------------------------------------
68 //
69 // The tessellation object
71 {
72 public:
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
81 
83 
94  vtkCellArray *cellArray,
95  vtkPointData *internalPd);
97 
99 
108  vtkCellArray *cellArray,
109  vtkPointData *internalPd );
111 
113 
122  vtkCellArray *cellArray,
123  vtkPointData *internalPd);
125 
127  void Reset();
128 
129 
132 
143 
151 
155 
161 
167 
169 
175  void SetSubdivisionLevels(int fixed,
176  int maxLevel);
178 
179 
180 protected:
183 
186  void CopyPoint(vtkIdType pointId);
187 
190 
191  void InsertEdgesIntoEdgeTable( vtkTriangleTile &tri );
192  void RemoveEdgesFromEdgeTable( vtkTriangleTile &tri );
193  void InsertPointsIntoEdgeTable( vtkTriangleTile &tri );
194 
195  void InsertEdgesIntoEdgeTable( vtkTetraTile &tetra );
196  void RemoveEdgesFromEdgeTable( vtkTetraTile &tetra );
197 
199 
209  void InitTetraTile(vtkTetraTile &root,
210  vtkIdType *localIds,
211  vtkIdType *ids,
212  int *edgeIds,
213  int *faceIds);
215 
217 
227  vtkIdType *localIds,
228  vtkIdType *ids,
229  int *edgeIds,
232  vtkCellArray *cellArray,
233  vtkPointData *internalPd);
235 
238 
242 
247  // Scalar buffer that stores the global coordinates, parametric coordinates,
248  // attributes at left, mid and right point. The format is:
249  // lxlylz lrlslt [lalb lcldle...] mxmymz mrmsmt [mamb mcmdme...]
250  // rxryrz rrrsrt [rarb rcrdre...]
251  // The ScalarsCapacity>=(6+attributeCollection->GetNumberOfComponents())*3
252 
253  double *Scalars;
255 
259 
262 
265 
267 
268  vtkDoubleArray *TessellatePoints; //Allow to use GetPointer
272 
273  int FindEdgeReferenceCount(double p1[3], double p2[3],
274  vtkIdType &e1, vtkIdType &e2);
275 
276  int GetNumberOfCellsUsingFace( int faceId );
277  int GetNumberOfCellsUsingEdge( int edgeId );
278 
284  int IsEdgeOnFace(double p1[3], double p2[3]);
285 
291  int FindEdgeParent2D(double p1[3], double p2[3], int &localId);
292 
299  int FindEdgeParent(double p1[3], double p2[3], int &localId);
300 
304 
306 
309  int FacesAreEqual(int *originalFace,
310  int face[3]);
312 
315 
318 
322 
325  int *EdgeIds;
328  int *FaceIds;
329 
330  // The following variables are for complex cells.
331 
332  // Used to create tetra from more complex cells, because the tessellator
333  // is supposed to deal with simplices only.
335 
336  // Used to store the sub-tetra during the tessellation of complex
337  // cells.
339 
340  // Used to create triangles from a face of a complex cell.
342 
343  // Used to store the sub-triangles during the tessellation of complex cells.
345 
348 
349 private:
350  vtkSimpleCellTessellator(const vtkSimpleCellTessellator&); // Not implemented.
351  void operator=(const vtkSimpleCellTessellator&); // Not implemented.
352 
353  //BTX
354  friend class vtkTetraTile;
355  friend class vtkTriangleTile;
356  //ETX
357 };
358 
359 #endif
vtkSimpleCellTessellator::Initialize
void Initialize(vtkGenericDataSet *ds)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkSimpleCellTessellator::RemoveEdgesFromEdgeTable
void RemoveEdgesFromEdgeTable(vtkTetraTile &tetra)
vtkSimpleCellTessellator::InsertPointsIntoEdgeTable
void InsertPointsIntoEdgeTable(vtkTriangleTile &tri)
vtkSimpleCellTessellator::TessellateCellArray
vtkCellArray * TessellateCellArray
Definition: vtkSimpleCellTessellator.h:269
vtkSimpleCellTessellator::GetMaxSubdivisionLevel
int GetMaxSubdivisionLevel()
vtkSimpleCellTessellator::New
static vtkSimpleCellTessellator * New()
vtkSimpleCellTessellator::~vtkSimpleCellTessellator
~vtkSimpleCellTessellator()
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkCommonDataModelModule.h
vtkGenericCellTessellator.h
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
vtkSimpleCellTessellator::SetSubdivisionLevels
void SetSubdivisionLevels(int fixed, int maxLevel)
vtkSimpleCellTessellator::InsertEdgesIntoEdgeTable
void InsertEdgesIntoEdgeTable(vtkTetraTile &tetra)
vtkSimpleCellTessellator::AllocateScalars
void AllocateScalars(int size)
vtkSimpleCellTessellator::TessellatePoints
vtkDoubleArray * TessellatePoints
Definition: vtkSimpleCellTessellator.h:268
vtkSimpleCellTessellator::DataSet
vtkGenericDataSet * DataSet
Definition: vtkSimpleCellTessellator.h:314
vtkSimpleCellTessellator::CurrentSubdivisionLevel
int CurrentSubdivisionLevel
Definition: vtkSimpleCellTessellator.h:321
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSimpleCellTessellator::RemoveEdgesFromEdgeTable
void RemoveEdgesFromEdgeTable(vtkTriangleTile &tri)
vtkSimpleCellTessellator::IsEdgeOnFace
int IsEdgeOnFace(double p1[3], double p2[3])
vtkGenericAdaptorCell
defines cell interface
Definition: vtkGenericAdaptorCell.h:95
vtkSimpleCellTessellator::GetMaxAdaptiveSubdivisions
int GetMaxAdaptiveSubdivisions()
vtkSimpleCellTessellator::Scalars
double * Scalars
Definition: vtkSimpleCellTessellator.h:253
vtkGenericCellIterator
iterator used to traverse cells
Definition: vtkGenericCellIterator.h:44
vtkSimpleCellTessellator::TriangleIds
vtkIdList * TriangleIds
Definition: vtkSimpleCellTessellator.h:344
vtkSimpleCellTessellator::GetNumberOfCellsUsingEdge
int GetNumberOfCellsUsingEdge(int edgeId)
vtkGenericSubdivisionErrorMetric
Objects that compute error during cell tessellation.
Definition: vtkGenericSubdivisionErrorMetric.h:48
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkSimpleCellTessellator::CellIterator
vtkGenericCellIterator * CellIterator
Definition: vtkSimpleCellTessellator.h:261
vtkSimpleCellTessellator
helper class to perform cell tessellation
Definition: vtkSimpleCellTessellator.h:71
vtkGenericDataSet
defines dataset interface
Definition: vtkGenericDataSet.h:69
vtkOrderedTriangulator
helper class to generate triangulations
Definition: vtkOrderedTriangulator.h:117
vtkSimpleCellTessellator::GenericCell
vtkGenericAdaptorCell * GenericCell
Definition: vtkSimpleCellTessellator.h:237
vtkSimpleCellTessellator::AllocatePointIds
void AllocatePointIds(int size)
vtkSimpleCellTessellator::FixedSubdivisions
int FixedSubdivisions
Definition: vtkSimpleCellTessellator.h:319
vtkSimpleCellTessellator::Reset
void Reset()
vtkGenericCellTessellator
helper class to perform cell tessellation
Definition: vtkGenericCellTessellator.h:58
vtkSimpleCellTessellator::SetFixedSubdivisions
void SetFixedSubdivisions(int level)
vtkSimpleCellTessellator::FacesAreEqual
int FacesAreEqual(int *originalFace, int face[3])
vtkgl::ids
GLuint * ids
Definition: vtkgl.h:11831
vtkSimpleCellTessellator::AttributeCollection
vtkGenericAttributeCollection * AttributeCollection
Definition: vtkSimpleCellTessellator.h:264
vtkSimpleCellTessellator::InitTetraTile
void InitTetraTile(vtkTetraTile &root, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, int *faceIds)
vtkSimpleCellTessellator::PointOffset
int PointOffset
Definition: vtkSimpleCellTessellator.h:258
vtkSimpleCellTessellator::Triangulator
vtkOrderedTriangulator * Triangulator
Definition: vtkSimpleCellTessellator.h:334
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSimpleCellTessellator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSimpleCellTessellator::NumberOfPoints
vtkIdType NumberOfPoints
Definition: vtkSimpleCellTessellator.h:317
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkSimpleCellTessellator::GetNumberOfCellsUsingFace
int GetNumberOfCellsUsingFace(int faceId)
vtkSimpleCellTessellator::EdgeTable
vtkGenericEdgeTable * EdgeTable
Definition: vtkSimpleCellTessellator.h:189
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkGenericEdgeTable
keep track of edges (defined by pair of integer id's)
Definition: vtkGenericEdgeTable.h:39
vtkSimpleCellTessellator::CopyPoint
void CopyPoint(vtkIdType pointId)
vtkSimpleCellTessellator::PointIdsCapacity
int PointIdsCapacity
Definition: vtkSimpleCellTessellator.h:347
vtkSimpleCellTessellator::FindEdgeParent2D
int FindEdgeParent2D(double p1[3], double p2[3], int &localId)
vtkSimpleCellTessellator::TriangulateTriangle
void TriangulateTriangle(vtkGenericAdaptorCell *cell, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkSimpleCellTessellator::TessellateFace
void TessellateFace(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkIdType index, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
vtkSimpleCellTessellator::GetFixedSubdivisions
int GetFixedSubdivisions()
vtkSimpleCellTessellator::vtkSimpleCellTessellator
vtkSimpleCellTessellator()
vtkSimpleCellTessellator::Tessellate
void Tessellate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
vtkSimpleCellTessellator::Polygon
vtkPolygon * Polygon
Definition: vtkSimpleCellTessellator.h:341
vtkSimpleCellTessellator::MaxSubdivisionLevel
int MaxSubdivisionLevel
Definition: vtkSimpleCellTessellator.h:320
vtkSimpleCellTessellator::FindEdgeParent
int FindEdgeParent(double p1[3], double p2[3], int &localId)
vtkSimpleCellTessellator::SetMaxSubdivisionLevel
void SetMaxSubdivisionLevel(int level)
vtkSimpleCellTessellator::FindEdgeReferenceCount
int FindEdgeReferenceCount(double p1[3], double p2[3], vtkIdType &e1, vtkIdType &e2)
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:36
vtkgl::face
GLenum GLuint GLint GLenum face
Definition: vtkgl.h:13568
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkSimpleCellTessellator::InsertEdgesIntoEdgeTable
void InsertEdgesIntoEdgeTable(vtkTriangleTile &tri)
vtkSimpleCellTessellator::EdgeIds
int * EdgeIds
Definition: vtkSimpleCellTessellator.h:325
vtkSimpleCellTessellator::Triangulate
void Triangulate(vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
vtkSimpleCellTessellator::PointIds
vtkIdType * PointIds
Definition: vtkSimpleCellTessellator.h:346
vtkSimpleCellTessellator::TessellatePointData
vtkPointData * TessellatePointData
Definition: vtkSimpleCellTessellator.h:270
vtkSimpleCellTessellator::Connectivity
vtkCellArray * Connectivity
Definition: vtkSimpleCellTessellator.h:338
vtkSimpleCellTessellator::ScalarsCapacity
int ScalarsCapacity
Definition: vtkSimpleCellTessellator.h:254
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkSimpleCellTessellator::FaceIds
int * FaceIds
Definition: vtkSimpleCellTessellator.h:328