VTK
vtkGenericAdaptorCell.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericAdaptorCell.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 =========================================================================*/
61 #ifndef vtkGenericAdaptorCell_h
62 #define vtkGenericAdaptorCell_h
63 
64 
65 #include "vtkCommonDataModelModule.h" // For export macro
66 #include "vtkObject.h"
67 
68 class vtkLine;
69 class vtkTetra;
70 class vtkPoints;
71 class vtkVertex;
72 class vtkTriangle;
73 class vtkCellData;
74 class vtkPointData;
75 class vtkCellArray;
76 class vtkDoubleArray;
79 class vtkContourValues;
85 class vtkIdList;
87 class vtkPolygon;
89 class vtkQuad;
90 class vtkHexahedron;
91 class vtkWedge;
92 class vtkPyramid;
93 
95 {
96 public:
98  void PrintSelf(ostream& os, vtkIndent indent);
99 
102  virtual vtkIdType GetId() = 0;
103 
105  virtual int IsInDataSet()=0;
106 
111  virtual int GetType()=0;
112 
115  virtual int GetDimension() = 0;
116 
119  virtual int GetGeometryOrder()=0;
120 
123  int IsGeometryLinear();
124 
127  virtual int GetAttributeOrder(vtkGenericAttribute *a)=0;
128 
132  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac);
133 
136  int IsAttributeLinear(vtkGenericAttribute *a);
137 
139  virtual int IsPrimary()=0;
140 
143  virtual int GetNumberOfPoints()=0;
144 
153  virtual int GetNumberOfBoundaries(int dim=-1)=0;
154 
163  virtual int GetNumberOfDOFNodes()=0;
164 
166  virtual void GetPointIterator(vtkGenericPointIterator *it)=0;
167 
170  virtual vtkGenericCellIterator *NewCellIterator()=0;
171 
173 
177  virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries,
178  int dim=-1)=0;
180 
182 
187  virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0;
188  virtual void CountEdgeNeighbors( int* sharing ) = 0;
190 
192 
198  virtual void GetNeighbors(vtkGenericAdaptorCell *boundary,
199  vtkGenericCellIterator *neighbors)=0;
201 
203 
207  virtual int FindClosestBoundary(int subId,
208  double pcoords[3],
209  vtkGenericCellIterator* &boundary)=0;
211 
213 
221  virtual int EvaluatePosition(double x[3],
222  double *closestPoint,
223  int &subId,
224  double pcoords[3],
225  double &dist2)=0;
227 
229 
234  virtual void EvaluateLocation(int subId,
235  double pcoords[3],
236  double x[3])=0;
238 
240 
246  virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3],
247  double *val) = 0;
249 
251 
257  virtual void InterpolateTuple(vtkGenericAttributeCollection *c,
258  double pcoords[3],
259  double *val) = 0;
261 
263 
292  virtual void Contour(vtkContourValues *values,
294  vtkGenericAttributeCollection *attributes,
297  vtkCellArray *verts,
298  vtkCellArray *lines,
299  vtkCellArray *polys,
300  vtkPointData *outPd,
301  vtkCellData *outCd,
302  vtkPointData *internalPd,
303  vtkPointData *secondaryPd,
304  vtkCellData *secondaryCd);
306 
308 
338  virtual void Clip(double value,
340  vtkGenericAttributeCollection *attributes,
342  int insideOut,
344  vtkCellArray *connectivity,
345  vtkPointData *outPd,
346  vtkCellData *outCd,
347  vtkPointData *internalPd,
348  vtkPointData *secondaryPd,
349  vtkCellData *secondaryCd);
351 
353 
359  virtual int IntersectWithLine(double p1[3],
360  double p2[3],
361  double tol,
362  double &t,
363  double x[3],
364  double pcoords[3],
365  int &subId)=0;
367 
369 
378  virtual void Derivatives(int subId,
379  double pcoords[3],
380  vtkGenericAttribute *attribute,
381  double *derivs)=0;
383 
386  virtual void GetBounds(double bounds[6])=0;
387 
391  virtual double *GetBounds();
392 
395  virtual double GetLength2();
396 
401  virtual int GetParametricCenter(double pcoords[3])=0;
402 
409  virtual double GetParametricDistance(double pcoords[3])=0;
410 
419  virtual double *GetParametricCoords()=0;
420 
422 
436  virtual void Tessellate(vtkGenericAttributeCollection *attributes,
438  vtkPoints *points,
440  vtkCellArray* cellArray,
441  vtkPointData *internalPd,
442  vtkPointData *pd, vtkCellData* cd,
443  vtkUnsignedCharArray *types);
445 
446  // The following methods are for the internals of the tesselation algorithm
447  // (the hash table in particular)
448 
451  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
452 
455  virtual int IsOnBoundary() = 0;
456 
460  virtual void GetPointIds(vtkIdType *id) = 0;
461 
463 
469  virtual void TriangulateFace(vtkGenericAttributeCollection *attributes,
470  vtkGenericCellTessellator *tess, int index,
471  vtkPoints *points,
473  vtkCellArray *cellArray,
474  vtkPointData *internalPd,
475  vtkPointData *pd, vtkCellData *cd );
477 
483  virtual int *GetFaceArray(int faceId)=0;
484 
489  virtual int GetNumberOfVerticesOnFace(int faceId)=0;
490 
496  virtual int *GetEdgeArray(int edgeId)=0;
497 
498 protected:
500  virtual ~vtkGenericAdaptorCell();
501 
503  void Reset();
504 
507  void AllocateTuples(int size);
508 
509  //Internal tetra used for the contouring/clipping algorithm
513  vtkVertex *Vertex; //is it used ?
518 
519  // Internal locator when tessellating on a cell basis, this is different
520  // from the main locator used in contour/clip filter, this locator is used for
521  // points for
522  // Be careful the use of a vtkLocator in conjunction with the table fast
523  // tessellator is very sensitive, we need to keep all the points we used
528 
529  vtkIdList *InternalIds; // used by Tessellate() and TriangulateFace()
530 
531  //Attributes to mimic the vtk cell look and feel, internal use only
535 
536  // Scalar buffer to store the attributes values at some location
537  // There are variable members to reduce memory allocations.
538  double *Tuples;
540 
541  // Cached Bounds.
542  double Bounds[6];
543 
544 private:
545  vtkGenericAdaptorCell(const vtkGenericAdaptorCell&); // Not implemented.
546  void operator=(const vtkGenericAdaptorCell&); // Not implemented.
547 };
548 
549 #endif
abstract interface for implicit functions
helper object to manage setting and generating contour values
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
helper class to perform cell tessellation
a cell that represents a 3D point
Definition: vtkVertex.h:35
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:48
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
helper class to generate triangulations
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:40
int vtkIdType
Definition: vtkType.h:275
iterator used to traverse points
abstract class defined API for attribute data
vtkDoubleArray * PointDataScalars
dynamic, self-adjusting array of double
iterator used to traverse cells
defines cell interface
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
cell represents a 1D line
Definition: vtkLine.h:34
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
vtkDoubleArray * InternalScalars
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:46
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:49
a cell that represents a triangle
Definition: vtkTriangle.h:40
int Contour(vtkDataSet *input, vtkPolyData *output, vtkDataArray *field, float isoValue, bool computeScalars)
vtkDoubleArray * InternalPoints
#define VTKCOMMONDATAMODEL_EXPORT
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:48
represent and manipulate 3D points
Definition: vtkPoints.h:38