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 =========================================================================*/
62 #ifndef vtkGenericAdaptorCell_h
63 #define vtkGenericAdaptorCell_h
64 
65 
66 #include "vtkCommonDataModelModule.h" // For export macro
67 #include "vtkObject.h"
68 
69 class vtkLine;
70 class vtkTetra;
71 class vtkPoints;
72 class vtkVertex;
73 class vtkTriangle;
74 class vtkCellData;
75 class vtkPointData;
76 class vtkCellArray;
77 class vtkDoubleArray;
80 class vtkContourValues;
86 class vtkIdList;
88 class vtkPolygon;
90 class vtkQuad;
91 class vtkHexahedron;
92 class vtkWedge;
93 class vtkPyramid;
94 
95 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
96 {
97 public:
99  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
105  virtual vtkIdType GetId() = 0;
106 
110  virtual int IsInDataSet()=0;
111 
118  virtual int GetType()=0;
119 
124  virtual int GetDimension() = 0;
125 
130  virtual int GetGeometryOrder()=0;
131 
136  int IsGeometryLinear();
137 
144  virtual int GetAttributeOrder(vtkGenericAttribute *a)=0;
145 
152  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac);
153 
159  vtkTypeBool IsAttributeLinear(vtkGenericAttribute *a);
160 
164  virtual int IsPrimary()=0;
165 
170  virtual int GetNumberOfPoints()=0;
171 
182  virtual int GetNumberOfBoundaries(int dim=-1)=0;
183 
196  virtual int GetNumberOfDOFNodes()=0;
197 
202  virtual void GetPointIterator(vtkGenericPointIterator *it)=0;
203 
208  virtual vtkGenericCellIterator *NewCellIterator()=0;
209 
216  virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries,
217  int dim=-1)=0;
218 
220 
230  virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0;
231  virtual void CountEdgeNeighbors( int* sharing ) = 0;
233 
244  virtual void GetNeighbors(vtkGenericAdaptorCell *boundary,
245  vtkGenericCellIterator *neighbors)=0;
246 
254  virtual int FindClosestBoundary(int subId,
255  double pcoords[3],
256  vtkGenericCellIterator* &boundary)=0;
257 
269  virtual int EvaluatePosition(const double x[3],
270  double *closestPoint,
271  int &subId,
272  double pcoords[3],
273  double &dist2)=0;
274 
282  virtual void EvaluateLocation(int subId,
283  double pcoords[3],
284  double x[3])=0;
285 
296  virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3],
297  double *val) = 0;
298 
309  virtual void InterpolateTuple(vtkGenericAttributeCollection *c,
310  double pcoords[3],
311  double *val) = 0;
312 
354  virtual void Contour(vtkContourValues *values,
356  vtkGenericAttributeCollection *attributes,
359  vtkCellArray *verts,
360  vtkCellArray *lines,
361  vtkCellArray *polys,
362  vtkPointData *outPd,
363  vtkCellData *outCd,
364  vtkPointData *internalPd,
365  vtkPointData *secondaryPd,
366  vtkCellData *secondaryCd);
367 
408  virtual void Clip(double value,
410  vtkGenericAttributeCollection *attributes,
412  int insideOut,
414  vtkCellArray *connectivity,
415  vtkPointData *outPd,
416  vtkCellData *outCd,
417  vtkPointData *internalPd,
418  vtkPointData *secondaryPd,
419  vtkCellData *secondaryCd);
420 
429  virtual int IntersectWithLine(double p1[3],
430  double p2[3],
431  double tol,
432  double &t,
433  double x[3],
434  double pcoords[3],
435  int &subId)=0;
436 
449  virtual void Derivatives(int subId,
450  double pcoords[3],
451  vtkGenericAttribute *attribute,
452  double *derivs)=0;
453 
459  virtual void GetBounds(double bounds[6])=0;
460 
467  virtual double *GetBounds();
468 
473  virtual double GetLength2();
474 
481  virtual int GetParametricCenter(double pcoords[3])=0;
482 
490  virtual double GetParametricDistance(const double pcoords[3])=0;
491 
502  virtual double *GetParametricCoords()=0;
503 
524  virtual void Tessellate(vtkGenericAttributeCollection *attributes,
526  vtkPoints *points,
528  vtkCellArray* cellArray,
529  vtkPointData *internalPd,
530  vtkPointData *pd, vtkCellData* cd,
531  vtkUnsignedCharArray *types);
532 
533  // The following methods are for the internals of the tessellation algorithm
534  // (the hash table in particular)
535 
541  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
542 
547  virtual int IsOnBoundary() = 0;
548 
555  virtual void GetPointIds(vtkIdType *id) = 0;
556 
570  virtual void TriangulateFace(vtkGenericAttributeCollection *attributes,
571  vtkGenericCellTessellator *tess, int index,
572  vtkPoints *points,
574  vtkCellArray *cellArray,
575  vtkPointData *internalPd,
576  vtkPointData *pd, vtkCellData *cd );
577 
586  virtual int *GetFaceArray(int faceId)=0;
587 
594  virtual int GetNumberOfVerticesOnFace(int faceId)=0;
595 
604  virtual int *GetEdgeArray(int edgeId)=0;
605 
606 protected:
608  ~vtkGenericAdaptorCell() override;
609 
613  void Reset();
614 
619  void AllocateTuples(int size);
620 
621  //Internal tetra used for the contouring/clipping algorithm
625  vtkVertex *Vertex; //is it used ?
630 
631  // Internal locator when tessellating on a cell basis, this is different
632  // from the main locator used in contour/clip filter, this locator is used for
633  // points for
634  // Be careful the use of a vtkLocator in conjunction with the table fast
635  // tessellator is very sensitive, we need to keep all the points we used
640 
641  vtkIdList *InternalIds; // used by Tessellate() and TriangulateFace()
642 
643  //Attributes to mimic the vtk cell look and feel, internal use only
647 
648  // Scalar buffer to store the attributes values at some location
649  // There are variable members to reduce memory allocations.
650  double *Tuples;
652 
653  // Cached Bounds.
654  double Bounds[6];
655 
656 private:
658  void operator=(const vtkGenericAdaptorCell&) = delete;
659 };
660 
661 #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:59
represent and manipulate point attribute data
Definition: vtkPointData.h:37
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
helper class to perform cell tessellation
a cell that represents a 3D point
Definition: vtkVertex.h:36
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:49
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
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:41
int vtkIdType
Definition: vtkType.h:347
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
int vtkTypeBool
Definition: vtkABI.h:69
defines cell interface
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
cell represents a 1D line
Definition: vtkLine.h:35
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
vtkDoubleArray * InternalScalars
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:47
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:50
a cell that represents a triangle
Definition: vtkTriangle.h:41
vtkDoubleArray * InternalPoints
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:49
represent and manipulate 3D points
Definition: vtkPoints.h:39