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 "vtkObject.h"
66 
67 class vtkLine;
68 class vtkTetra;
69 class vtkPoints;
70 class vtkVertex;
71 class vtkTriangle;
72 class vtkCellData;
73 class vtkPointData;
74 class vtkCellArray;
75 class vtkDoubleArray;
78 class vtkContourValues;
84 class vtkIdList;
86 class vtkPolygon;
88 class vtkQuad;
89 class vtkHexahedron;
90 class vtkWedge;
91 class vtkPyramid;
92 
94 {
95 public:
97  void PrintSelf(ostream& os, vtkIndent indent);
98 
101  virtual vtkIdType GetId() = 0;
102 
104  virtual int IsInDataSet()=0;
105 
110  virtual int GetType()=0;
111 
114  virtual int GetDimension() = 0;
115 
118  virtual int GetGeometryOrder()=0;
119 
122  int IsGeometryLinear();
123 
126  virtual int GetAttributeOrder(vtkGenericAttribute *a)=0;
127 
131  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac);
132 
135  int IsAttributeLinear(vtkGenericAttribute *a);
136 
138  virtual int IsPrimary()=0;
139 
142  virtual int GetNumberOfPoints()=0;
143 
152  virtual int GetNumberOfBoundaries(int dim=-1)=0;
153 
162  virtual int GetNumberOfDOFNodes()=0;
163 
165  virtual void GetPointIterator(vtkGenericPointIterator *it)=0;
166 
169  virtual vtkGenericCellIterator *NewCellIterator()=0;
170 
172 
176  virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries,
177  int dim=-1)=0;
179 
181 
186  virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0;
187  virtual void CountEdgeNeighbors( int* sharing ) = 0;
189 
191 
197  virtual void GetNeighbors(vtkGenericAdaptorCell *boundary,
198  vtkGenericCellIterator *neighbors)=0;
200 
202 
206  virtual int FindClosestBoundary(int subId,
207  double pcoords[3],
208  vtkGenericCellIterator* &boundary)=0;
210 
212 
220  virtual int EvaluatePosition(double x[3],
221  double *closestPoint,
222  int &subId,
223  double pcoords[3],
224  double &dist2)=0;
226 
228 
233  virtual void EvaluateLocation(int subId,
234  double pcoords[3],
235  double x[3])=0;
237 
239 
245  virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3],
246  double *val) = 0;
248 
250 
256  virtual void InterpolateTuple(vtkGenericAttributeCollection *c,
257  double pcoords[3],
258  double *val) = 0;
260 
262 
291  virtual void Contour(vtkContourValues *values,
293  vtkGenericAttributeCollection *attributes,
296  vtkCellArray *verts,
297  vtkCellArray *lines,
298  vtkCellArray *polys,
299  vtkPointData *outPd,
300  vtkCellData *outCd,
301  vtkPointData *internalPd,
302  vtkPointData *secondaryPd,
303  vtkCellData *secondaryCd);
305 
307 
337  virtual void Clip(double value,
339  vtkGenericAttributeCollection *attributes,
341  int insideOut,
342  vtkIncrementalPointLocator *locator,
343  vtkCellArray *connectivity,
344  vtkPointData *outPd,
345  vtkCellData *outCd,
346  vtkPointData *internalPd,
347  vtkPointData *secondaryPd,
348  vtkCellData *secondaryCd);
350 
352 
358  virtual int IntersectWithLine(double p1[3],
359  double p2[3],
360  double tol,
361  double &t,
362  double x[3],
363  double pcoords[3],
364  int &subId)=0;
366 
368 
377  virtual void Derivatives(int subId,
378  double pcoords[3],
379  vtkGenericAttribute *attribute,
380  double *derivs)=0;
382 
385  virtual void GetBounds(double bounds[6])=0;
386 
390  virtual double *GetBounds();
391 
394  virtual double GetLength2();
395 
400  virtual int GetParametricCenter(double pcoords[3])=0;
401 
408  virtual double GetParametricDistance(double pcoords[3])=0;
409 
418  virtual double *GetParametricCoords()=0;
419 
421 
435  virtual void Tessellate(vtkGenericAttributeCollection *attributes,
437  vtkPoints *points,
439  vtkCellArray* cellArray,
440  vtkPointData *internalPd,
441  vtkPointData *pd, vtkCellData* cd,
442  vtkUnsignedCharArray *types);
444 
445  // The following methods are for the internals of the tesselation algorithm
446  // (the hash table in particular)
447 
450  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
451 
454  virtual int IsOnBoundary() = 0;
455 
459  virtual void GetPointIds(vtkIdType *id) = 0;
460 
462 
468  virtual void TriangulateFace(vtkGenericAttributeCollection *attributes,
469  vtkGenericCellTessellator *tess, int index,
470  vtkPoints *points,
472  vtkCellArray *cellArray,
473  vtkPointData *internalPd,
474  vtkPointData *pd, vtkCellData *cd );
476 
482  virtual int *GetFaceArray(int faceId)=0;
483 
488  virtual int GetNumberOfVerticesOnFace(int faceId)=0;
489 
495  virtual int *GetEdgeArray(int edgeId)=0;
496 
497 protected:
499  virtual ~vtkGenericAdaptorCell();
500 
502  void Reset();
503 
506  void AllocateTuples(int size);
507 
508  //Internal tetra used for the contouring/clipping algorithm
512  vtkVertex *Vertex; //is it used ?
517 
518  // Internal locator when tessellating on a cell basis, this is different
519  // from the main locator used in contour/clip filter, this locator is used for
520  // points for
521  // Be carefull the use of a vtkLocator in conjuction with the table fast
522  // tessellator is very sensitive, we need to keep all the points we used
527 
528  vtkIdList *InternalIds; // used by Tessellate() and TriangulateFace()
529 
530  //Attributes to mimic the vtk cell look and feel, internal use only
534 
535  // Scalar buffer to store the attributes values at some location
536  // There are variable members to reduce memory allocations.
537  double *Tuples;
539 
540  // Cached Bounds.
541  double Bounds[6];
542 
543 private:
544  vtkGenericAdaptorCell(const vtkGenericAdaptorCell&); // Not implemented.
545  void operator=(const vtkGenericAdaptorCell&); // Not implemented.
546 };
547 
548 #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:60
represent and manipulate point attribute data
Definition: vtkPointData.h:35
helper class to perform cell tessellation
#define VTK_FILTERING_EXPORT
a cell that represents a 3D point
Definition: vtkVertex.h:34
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:47
represent and manipulate cell attribute data
Definition: vtkCellData.h:36
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:39
int vtkIdType
Definition: vtkType.h:255
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:45
cell represents a 1D line
Definition: vtkLine.h:33
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
vtkDoubleArray * InternalScalars
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:43
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:45
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:48
a cell that represents a triangle
Definition: vtkTriangle.h:39
vtkDoubleArray * InternalPoints
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:47
represent and manipulate 3D points
Definition: vtkPoints.h:38