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 =========================================================================*/
59 #ifndef vtkGenericAdaptorCell_h
60 #define vtkGenericAdaptorCell_h
61 
62 
63 #include "vtkCommonDataModelModule.h" // For export macro
64 #include "vtkObject.h"
65 
66 class vtkLine;
67 class vtkTetra;
68 class vtkPoints;
69 class vtkVertex;
70 class vtkTriangle;
71 class vtkCellData;
72 class vtkPointData;
73 class vtkCellArray;
74 class vtkDoubleArray;
77 class vtkContourValues;
83 class vtkIdList;
85 class vtkPolygon;
87 class vtkQuad;
88 class vtkHexahedron;
89 class vtkWedge;
90 class vtkPyramid;
91 
92 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
93 {
94 public:
96  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
97 
102  virtual vtkIdType GetId() = 0;
103 
107  virtual int IsInDataSet()=0;
108 
115  virtual int GetType()=0;
116 
121  virtual int GetDimension() = 0;
122 
127  virtual int GetGeometryOrder()=0;
128 
133  int IsGeometryLinear();
134 
141  virtual int GetAttributeOrder(vtkGenericAttribute *a)=0;
142 
149  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac);
150 
156  int IsAttributeLinear(vtkGenericAttribute *a);
157 
161  virtual int IsPrimary()=0;
162 
167  virtual int GetNumberOfPoints()=0;
168 
179  virtual int GetNumberOfBoundaries(int dim=-1)=0;
180 
193  virtual int GetNumberOfDOFNodes()=0;
194 
199  virtual void GetPointIterator(vtkGenericPointIterator *it)=0;
200 
205  virtual vtkGenericCellIterator *NewCellIterator()=0;
206 
213  virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries,
214  int dim=-1)=0;
215 
217 
227  virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0;
228  virtual void CountEdgeNeighbors( int* sharing ) = 0;
230 
241  virtual void GetNeighbors(vtkGenericAdaptorCell *boundary,
242  vtkGenericCellIterator *neighbors)=0;
243 
251  virtual int FindClosestBoundary(int subId,
252  double pcoords[3],
253  vtkGenericCellIterator* &boundary)=0;
254 
266  virtual int EvaluatePosition(double x[3],
267  double *closestPoint,
268  int &subId,
269  double pcoords[3],
270  double &dist2)=0;
271 
279  virtual void EvaluateLocation(int subId,
280  double pcoords[3],
281  double x[3])=0;
282 
293  virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3],
294  double *val) = 0;
295 
306  virtual void InterpolateTuple(vtkGenericAttributeCollection *c,
307  double pcoords[3],
308  double *val) = 0;
309 
351  virtual void Contour(vtkContourValues *values,
353  vtkGenericAttributeCollection *attributes,
356  vtkCellArray *verts,
357  vtkCellArray *lines,
358  vtkCellArray *polys,
359  vtkPointData *outPd,
360  vtkCellData *outCd,
361  vtkPointData *internalPd,
362  vtkPointData *secondaryPd,
363  vtkCellData *secondaryCd);
364 
405  virtual void Clip(double value,
407  vtkGenericAttributeCollection *attributes,
409  int insideOut,
411  vtkCellArray *connectivity,
412  vtkPointData *outPd,
413  vtkCellData *outCd,
414  vtkPointData *internalPd,
415  vtkPointData *secondaryPd,
416  vtkCellData *secondaryCd);
417 
426  virtual int IntersectWithLine(double p1[3],
427  double p2[3],
428  double tol,
429  double &t,
430  double x[3],
431  double pcoords[3],
432  int &subId)=0;
433 
446  virtual void Derivatives(int subId,
447  double pcoords[3],
448  vtkGenericAttribute *attribute,
449  double *derivs)=0;
450 
456  virtual void GetBounds(double bounds[6])=0;
457 
464  virtual double *GetBounds();
465 
470  virtual double GetLength2();
471 
478  virtual int GetParametricCenter(double pcoords[3])=0;
479 
487  virtual double GetParametricDistance(double pcoords[3])=0;
488 
499  virtual double *GetParametricCoords()=0;
500 
521  virtual void Tessellate(vtkGenericAttributeCollection *attributes,
523  vtkPoints *points,
525  vtkCellArray* cellArray,
526  vtkPointData *internalPd,
527  vtkPointData *pd, vtkCellData* cd,
528  vtkUnsignedCharArray *types);
529 
530  // The following methods are for the internals of the tesselation algorithm
531  // (the hash table in particular)
532 
538  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
539 
544  virtual int IsOnBoundary() = 0;
545 
552  virtual void GetPointIds(vtkIdType *id) = 0;
553 
567  virtual void TriangulateFace(vtkGenericAttributeCollection *attributes,
568  vtkGenericCellTessellator *tess, int index,
569  vtkPoints *points,
571  vtkCellArray *cellArray,
572  vtkPointData *internalPd,
573  vtkPointData *pd, vtkCellData *cd );
574 
583  virtual int *GetFaceArray(int faceId)=0;
584 
591  virtual int GetNumberOfVerticesOnFace(int faceId)=0;
592 
601  virtual int *GetEdgeArray(int edgeId)=0;
602 
603 protected:
605  ~vtkGenericAdaptorCell() VTK_OVERRIDE;
606 
610  void Reset();
611 
616  void AllocateTuples(int size);
617 
618  //Internal tetra used for the contouring/clipping algorithm
619  vtkTetra *Tetra;
620  vtkTriangle *Triangle;
621  vtkLine *Line;
622  vtkVertex *Vertex; //is it used ?
623  vtkQuad *Quad;
625  vtkWedge *Wedge;
626  vtkPyramid *Pyramid;
627 
628  // Internal locator when tessellating on a cell basis, this is different
629  // from the main locator used in contour/clip filter, this locator is used for
630  // points for
631  // Be careful the use of a vtkLocator in conjunction with the table fast
632  // tessellator is very sensitive, we need to keep all the points we used
633  vtkDoubleArray *InternalPoints;
634  vtkCellArray *InternalCellArray;
635  vtkDoubleArray *InternalScalars;
636  vtkDoubleArray *PointDataScalars;
637 
638  vtkIdList *InternalIds; // used by Tessellate() and TriangulateFace()
639 
640  //Attributes to mimic the vtk cell look and feel, internal use only
641  vtkDoubleArray *Scalars;
642  vtkPointData *PointData;
643  vtkCellData *CellData;
644 
645  // Scalar buffer to store the attributes values at some location
646  // There are variable members to reduce memory allocations.
647  double *Tuples;
648  int TuplesCapacity;
649 
650  // Cached Bounds.
651  double Bounds[6];
652 
653 private:
654  vtkGenericAdaptorCell(const vtkGenericAdaptorCell&) VTK_DELETE_FUNCTION;
655  void operator=(const vtkGenericAdaptorCell&) VTK_DELETE_FUNCTION;
656 };
657 
658 #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:53
represent and manipulate point attribute data
Definition: vtkPointData.h:31
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:30
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:43
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
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:35
int vtkIdType
Definition: vtkType.h:345
iterator used to traverse points
abstract class defined API for attribute data
dynamic, self-adjusting array of double
iterator used to traverse cells
defines cell interface
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
cell represents a 1D line
Definition: vtkLine.h:29
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:41
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:44
a cell that represents a triangle
Definition: vtkTriangle.h:35
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:43
represent and manipulate 3D points
Definition: vtkPoints.h:33