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 
124 
128 
133 
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 
167 
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 
258  double pcoords[3],
259  double *val) = 0;
261 
263 
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,
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 
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:
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkGenericAdaptorCell::Vertex
vtkVertex * Vertex
Definition: vtkGenericAdaptorCell.h:513
vtkGenericAdaptorCell::Wedge
vtkWedge * Wedge
Definition: vtkGenericAdaptorCell.h:516
vtkGenericAdaptorCell::GetAttributeOrder
virtual int GetAttributeOrder(vtkGenericAttribute *a)=0
vtkGenericPointIterator
iterator used to traverse points
Definition: vtkGenericPointIterator.h:42
vtkGenericAdaptorCell::GetNumberOfDOFNodes
virtual int GetNumberOfDOFNodes()=0
vtkGenericAdaptorCell::InterpolateTuple
virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3], double *val)=0
vtkGenericAdaptorCell::FindClosestBoundary
virtual int FindClosestBoundary(int subId, double pcoords[3], vtkGenericCellIterator *&boundary)=0
vtkGenericAdaptorCell::InterpolateTuple
virtual void InterpolateTuple(vtkGenericAttributeCollection *c, double pcoords[3], double *val)=0
vtkGenericAdaptorCell::GetNumberOfPoints
virtual int GetNumberOfPoints()=0
vtkGenericAdaptorCell::CellData
vtkCellData * CellData
Definition: vtkGenericAdaptorCell.h:534
vtkHexahedron
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:47
vtkGenericAdaptorCell::GetDimension
virtual int GetDimension()=0
vtkGenericAdaptorCell::Tessellate
virtual void Tessellate(vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkPoints *points, vtkIncrementalPointLocator *locator, vtkCellArray *cellArray, vtkPointData *internalPd, vtkPointData *pd, vtkCellData *cd, vtkUnsignedCharArray *types)
vtkGenericAdaptorCell::Triangle
vtkTriangle * Triangle
Definition: vtkGenericAdaptorCell.h:511
vtkGenericAdaptorCell::EvaluateLocation
virtual void EvaluateLocation(int subId, double pcoords[3], double x[3])=0
vtkGenericAdaptorCell::IsPrimary
virtual int IsPrimary()=0
vtkGenericAdaptorCell::GetPointIterator
virtual void GetPointIterator(vtkGenericPointIterator *it)=0
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkGenericAdaptorCell::Tetra
vtkTetra * Tetra
Definition: vtkGenericAdaptorCell.h:510
vtkCommonDataModelModule.h
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
vtkGenericAdaptorCell::IsAttributeLinear
int IsAttributeLinear(vtkGenericAttribute *a)
vtkGenericAdaptorCell::GetPointIds
virtual void GetPointIds(vtkIdType *id)=0
vtkGenericAdaptorCell::~vtkGenericAdaptorCell
virtual ~vtkGenericAdaptorCell()
vtkgl::types
GLsizei GLenum GLenum * types
Definition: vtkgl.h:14417
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkGenericAdaptorCell::InternalPoints
vtkDoubleArray * InternalPoints
Definition: vtkGenericAdaptorCell.h:524
vtkGenericAdaptorCell::PointDataScalars
vtkDoubleArray * PointDataScalars
Definition: vtkGenericAdaptorCell.h:527
vtkGenericAdaptorCell
defines cell interface
Definition: vtkGenericAdaptorCell.h:95
vtkGenericAdaptorCell::IsInDataSet
virtual int IsInDataSet()=0
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkGenericCellIterator
iterator used to traverse cells
Definition: vtkGenericCellIterator.h:44
vtkPyramid
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:49
vtkVertex
a cell that represents a 3D point
Definition: vtkVertex.h:36
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkGenericAdaptorCell::Reset
void Reset()
vtkGenericAdaptorCell::InternalScalars
vtkDoubleArray * InternalScalars
Definition: vtkGenericAdaptorCell.h:526
vtkLine
cell represents a 1D line
Definition: vtkLine.h:35
vtkOrderedTriangulator
helper class to generate triangulations
Definition: vtkOrderedTriangulator.h:117
vtkGenericAdaptorCell::Contour
virtual void Contour(vtkContourValues *values, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *outPd, vtkCellData *outCd, vtkPointData *internalPd, vtkPointData *secondaryPd, vtkCellData *secondaryCd)
vtkGenericAdaptorCell::AllocateTuples
void AllocateTuples(int size)
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:58
vtkGenericCellTessellator
helper class to perform cell tessellation
Definition: vtkGenericCellTessellator.h:58
vtkGenericAdaptorCell::GetType
virtual int GetType()=0
vtkGenericAdaptorCell::IsFaceOnBoundary
virtual int IsFaceOnBoundary(vtkIdType faceId)=0
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkGenericAdaptorCell::GetEdgeArray
virtual int * GetEdgeArray(int edgeId)=0
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkGenericAdaptorCell::IntersectWithLine
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
vtkGenericAdaptorCell::GetBounds
virtual double * GetBounds()
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkGenericAdaptorCell::EvaluatePosition
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2)=0
vtkWedge
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:49
vtkGenericAdaptorCell::Clip
virtual void Clip(double value, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int insideOut, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *outPd, vtkCellData *outCd, vtkPointData *internalPd, vtkPointData *secondaryPd, vtkCellData *secondaryCd)
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkGenericAdaptorCell::GetBoundaryIterator
virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries, int dim=-1)=0
vtkGenericAdaptorCell::GetParametricCoords
virtual double * GetParametricCoords()=0
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkGenericAdaptorCell::CountNeighbors
virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGenericAdaptorCell::TuplesCapacity
int TuplesCapacity
Definition: vtkGenericAdaptorCell.h:539
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkGenericAdaptorCell::Scalars
vtkDoubleArray * Scalars
Definition: vtkGenericAdaptorCell.h:532
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:54
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkGenericAdaptorCell::Line
vtkLine * Line
Definition: vtkGenericAdaptorCell.h:512
vtkGenericAdaptorCell::GetNumberOfBoundaries
virtual int GetNumberOfBoundaries(int dim=-1)=0
vtkGenericAdaptorCell::vtkGenericAdaptorCell
vtkGenericAdaptorCell()
vtkGenericAdaptorCell::InternalCellArray
vtkCellArray * InternalCellArray
Definition: vtkGenericAdaptorCell.h:525
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkTriangle
a cell that represents a triangle
Definition: vtkTriangle.h:41
vtkGenericAdaptorCell::Pyramid
vtkPyramid * Pyramid
Definition: vtkGenericAdaptorCell.h:517
vtkGenericAdaptorCell::InternalIds
vtkIdList * InternalIds
Definition: vtkGenericAdaptorCell.h:529
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkObject.h
vtkGenericAdaptorCell::Quad
vtkQuad * Quad
Definition: vtkGenericAdaptorCell.h:514
vtkGenericAdaptorCell::GetGeometryOrder
virtual int GetGeometryOrder()=0
vtkGenericAdaptorCell::GetParametricCenter
virtual int GetParametricCenter(double pcoords[3])=0
vtkGenericAdaptorCell::GetLength2
virtual double GetLength2()
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkGenericAdaptorCell::NewCellIterator
virtual vtkGenericCellIterator * NewCellIterator()=0
vtkGenericAdaptorCell::CountEdgeNeighbors
virtual void CountEdgeNeighbors(int *sharing)=0
vtkGenericAdaptorCell::GetFaceArray
virtual int * GetFaceArray(int faceId)=0
vtkGenericAdaptorCell::Tuples
double * Tuples
Definition: vtkGenericAdaptorCell.h:538
vtkGenericAdaptorCell::GetNeighbors
virtual void GetNeighbors(vtkGenericAdaptorCell *boundary, vtkGenericCellIterator *neighbors)=0
vtkGenericAdaptorCell::GetHighestOrderAttribute
virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac)
vtkGenericAdaptorCell::IsOnBoundary
virtual int IsOnBoundary()=0
vtkGenericAdaptorCell::IsGeometryLinear
int IsGeometryLinear()
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:36
vtkGenericAttribute
abstract class defined API for attribute data
Definition: vtkGenericAttribute.h:50
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkGenericAdaptorCell::Derivatives
virtual void Derivatives(int subId, double pcoords[3], vtkGenericAttribute *attribute, double *derivs)=0
vtkGenericAdaptorCell::GetId
virtual vtkIdType GetId()=0
vtkGenericAdaptorCell::GetBounds
virtual void GetBounds(double bounds[6])=0
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkGenericAdaptorCell::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGenericAdaptorCell::GetParametricDistance
virtual double GetParametricDistance(double pcoords[3])=0
vtkGenericAdaptorCell::PointData
vtkPointData * PointData
Definition: vtkGenericAdaptorCell.h:533
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
vtkGenericAdaptorCell::Hexa
vtkHexahedron * Hexa
Definition: vtkGenericAdaptorCell.h:515
vtkGenericAdaptorCell::GetNumberOfVerticesOnFace
virtual int GetNumberOfVerticesOnFace(int faceId)=0
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:41
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkGenericAdaptorCell::TriangulateFace
virtual void TriangulateFace(vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int index, vtkPoints *points, vtkIncrementalPointLocator *locator, vtkCellArray *cellArray, vtkPointData *internalPd, vtkPointData *pd, vtkCellData *cd)