VTK  9.0.1
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 #include "vtkCommonDataModelModule.h" // For export macro
63 #include "vtkObject.h"
64 
65 class vtkLine;
66 class vtkTetra;
67 class vtkPoints;
68 class vtkVertex;
69 class vtkTriangle;
70 class vtkCellData;
71 class vtkPointData;
72 class vtkCellArray;
73 class vtkDoubleArray;
76 class vtkContourValues;
82 class vtkIdList;
84 class vtkPolygon;
86 class vtkQuad;
87 class vtkHexahedron;
88 class vtkWedge;
89 class vtkPyramid;
90 
91 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
92 {
93 public:
95  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
101  virtual vtkIdType GetId() = 0;
102 
106  virtual int IsInDataSet() = 0;
107 
114  virtual int GetType() = 0;
115 
120  virtual int GetDimension() = 0;
121 
126  virtual int GetGeometryOrder() = 0;
127 
132  int IsGeometryLinear();
133 
140  virtual int GetAttributeOrder(vtkGenericAttribute* a) = 0;
141 
148  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection* ac);
149 
155  vtkTypeBool IsAttributeLinear(vtkGenericAttribute* a);
156 
160  virtual int IsPrimary() = 0;
161 
166  virtual int GetNumberOfPoints() = 0;
167 
178  virtual int GetNumberOfBoundaries(int dim = -1) = 0;
179 
192  virtual int GetNumberOfDOFNodes() = 0;
193 
198  virtual void GetPointIterator(vtkGenericPointIterator* it) = 0;
199 
205  virtual vtkGenericCellIterator* NewCellIterator() = 0;
206 
213  virtual void GetBoundaryIterator(vtkGenericCellIterator* boundaries, int dim = -1) = 0;
214 
216 
226  virtual int CountNeighbors(vtkGenericAdaptorCell* boundary) = 0;
227  virtual void CountEdgeNeighbors(int* sharing) = 0;
229 
240  virtual void GetNeighbors(vtkGenericAdaptorCell* boundary, vtkGenericCellIterator* neighbors) = 0;
241 
249  virtual int FindClosestBoundary(
250  int subId, double pcoords[3], vtkGenericCellIterator*& boundary) = 0;
251 
263  virtual int EvaluatePosition(
264  const double x[3], double* closestPoint, int& subId, double pcoords[3], double& dist2) = 0;
265 
273  virtual void EvaluateLocation(int subId, double pcoords[3], double x[3]) = 0;
274 
285  virtual void InterpolateTuple(vtkGenericAttribute* a, double pcoords[3], double* val) = 0;
286 
297  virtual void InterpolateTuple(
298  vtkGenericAttributeCollection* c, double pcoords[3], double* val) = 0;
299 
341  virtual void Contour(vtkContourValues* values, vtkImplicitFunction* f,
343  vtkIncrementalPointLocator* locator, vtkCellArray* verts, vtkCellArray* lines,
344  vtkCellArray* polys, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
345  vtkPointData* secondaryPd, vtkCellData* secondaryCd);
346 
387  virtual void Clip(double value, vtkImplicitFunction* f, vtkGenericAttributeCollection* attributes,
388  vtkGenericCellTessellator* tess, int insideOut, vtkIncrementalPointLocator* locator,
389  vtkCellArray* connectivity, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
390  vtkPointData* secondaryPd, vtkCellData* secondaryCd);
391 
400  virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, double x[3],
401  double pcoords[3], int& subId) = 0;
402 
415  virtual void Derivatives(
416  int subId, double pcoords[3], vtkGenericAttribute* attribute, double* derivs) = 0;
417 
423  virtual void GetBounds(double bounds[6]) = 0;
424 
431  virtual double* GetBounds();
432 
437  virtual double GetLength2();
438 
445  virtual int GetParametricCenter(double pcoords[3]) = 0;
446 
454  virtual double GetParametricDistance(const double pcoords[3]) = 0;
455 
466  virtual double* GetParametricCoords() = 0;
467 
488  virtual void Tessellate(vtkGenericAttributeCollection* attributes,
490  vtkCellArray* cellArray, vtkPointData* internalPd, vtkPointData* pd, vtkCellData* cd,
491  vtkUnsignedCharArray* types);
492 
493  // The following methods are for the internals of the tessellation algorithm
494  // (the hash table in particular)
495 
501  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
502 
507  virtual int IsOnBoundary() = 0;
508 
515  virtual void GetPointIds(vtkIdType* id) = 0;
516 
530  virtual void TriangulateFace(vtkGenericAttributeCollection* attributes,
532  vtkIncrementalPointLocator* locator, vtkCellArray* cellArray, vtkPointData* internalPd,
533  vtkPointData* pd, vtkCellData* cd);
534 
547  virtual const vtkIdType* GetFaceArray(vtkIdType faceId) = 0;
548 
555  virtual int GetNumberOfVerticesOnFace(int faceId) = 0;
556 
568  virtual const vtkIdType* GetEdgeArray(vtkIdType edgeId) = 0;
569 
570 protected:
572  ~vtkGenericAdaptorCell() override;
573 
577  void Reset();
578 
583  void AllocateTuples(int size);
584 
585  // Internal tetra used for the contouring/clipping algorithm
589  vtkVertex* Vertex; // is it used ?
594 
595  // Internal locator when tessellating on a cell basis, this is different
596  // from the main locator used in contour/clip filter, this locator is used for
597  // points for
598  // Be careful the use of a vtkLocator in conjunction with the table fast
599  // tessellator is very sensitive, we need to keep all the points we used
604 
605  vtkIdList* InternalIds; // used by Tessellate() and TriangulateFace()
606 
607  // Attributes to mimic the vtk cell look and feel, internal use only
611 
612  // Scalar buffer to store the attributes values at some location
613  // There are variable members to reduce memory allocations.
614  double* Tuples;
616 
617  // Cached Bounds.
618  double Bounds[6];
619 
620 private:
622  void operator=(const vtkGenericAdaptorCell&) = delete;
623 };
624 
625 #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:62
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:338
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: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
vtkDoubleArray * InternalScalars
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:41
#define VTK_NEWINSTANCE
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:179
a cell that represents a triangle
Definition: vtkTriangle.h:35
vtkDoubleArray * InternalPoints
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:43
represent and manipulate 3D points
Definition: vtkPoints.h:33