VTK  9.2.6
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 #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 
94 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
95 {
96 public:
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
104  virtual vtkIdType GetId() = 0;
105 
109  virtual int IsInDataSet() = 0;
110 
117  virtual int GetType() = 0;
118 
123  virtual int GetDimension() = 0;
124 
129  virtual int GetGeometryOrder() = 0;
130 
135  int IsGeometryLinear();
136 
143  virtual int GetAttributeOrder(vtkGenericAttribute* a) = 0;
144 
151  virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection* ac);
152 
158  vtkTypeBool IsAttributeLinear(vtkGenericAttribute* a);
159 
163  virtual int IsPrimary() = 0;
164 
169  virtual int GetNumberOfPoints() = 0;
170 
181  virtual int GetNumberOfBoundaries(int dim = -1) = 0;
182 
195  virtual int GetNumberOfDOFNodes() = 0;
196 
201  virtual void GetPointIterator(vtkGenericPointIterator* it) = 0;
202 
208  virtual vtkGenericCellIterator* NewCellIterator() = 0;
209 
216  virtual void GetBoundaryIterator(vtkGenericCellIterator* boundaries, int dim = -1) = 0;
217 
219 
229  virtual int CountNeighbors(vtkGenericAdaptorCell* boundary) = 0;
230  virtual void CountEdgeNeighbors(int* sharing) = 0;
232 
243  virtual void GetNeighbors(vtkGenericAdaptorCell* boundary, vtkGenericCellIterator* neighbors) = 0;
244 
252  virtual int FindClosestBoundary(
253  int subId, double pcoords[3], vtkGenericCellIterator*& boundary) = 0;
254 
266  virtual int EvaluatePosition(
267  const double x[3], double* closestPoint, int& subId, double pcoords[3], double& dist2) = 0;
268 
276  virtual void EvaluateLocation(int subId, double pcoords[3], double x[3]) = 0;
277 
288  virtual void InterpolateTuple(vtkGenericAttribute* a, double pcoords[3], double* val) = 0;
289 
300  virtual void InterpolateTuple(
301  vtkGenericAttributeCollection* c, double pcoords[3], double* val) = 0;
302 
344  virtual void Contour(vtkContourValues* values, vtkImplicitFunction* f,
346  vtkIncrementalPointLocator* locator, vtkCellArray* verts, vtkCellArray* lines,
347  vtkCellArray* polys, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
348  vtkPointData* secondaryPd, vtkCellData* secondaryCd);
349 
390  virtual void Clip(double value, vtkImplicitFunction* f, vtkGenericAttributeCollection* attributes,
391  vtkGenericCellTessellator* tess, int insideOut, vtkIncrementalPointLocator* locator,
392  vtkCellArray* connectivity, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
393  vtkPointData* secondaryPd, vtkCellData* secondaryCd);
394 
403  virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, double x[3],
404  double pcoords[3], int& subId) = 0;
405 
418  virtual void Derivatives(
419  int subId, double pcoords[3], vtkGenericAttribute* attribute, double* derivs) = 0;
420 
426  virtual void GetBounds(double bounds[6]) = 0;
427 
434  virtual double* GetBounds();
435 
440  virtual double GetLength2();
441 
448  virtual int GetParametricCenter(double pcoords[3]) = 0;
449 
457  virtual double GetParametricDistance(const double pcoords[3]) = 0;
458 
469  virtual double* GetParametricCoords() = 0;
470 
491  virtual void Tessellate(vtkGenericAttributeCollection* attributes,
493  vtkCellArray* cellArray, vtkPointData* internalPd, vtkPointData* pd, vtkCellData* cd,
494  vtkUnsignedCharArray* types);
495 
496  // The following methods are for the internals of the tessellation algorithm
497  // (the hash table in particular)
498 
504  virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
505 
510  virtual int IsOnBoundary() = 0;
511 
518  virtual void GetPointIds(vtkIdType* id) = 0;
519 
533  virtual void TriangulateFace(vtkGenericAttributeCollection* attributes,
535  vtkIncrementalPointLocator* locator, vtkCellArray* cellArray, vtkPointData* internalPd,
536  vtkPointData* pd, vtkCellData* cd);
537 
550  virtual const vtkIdType* GetFaceArray(vtkIdType faceId) = 0;
551 
558  virtual int GetNumberOfVerticesOnFace(int faceId) = 0;
559 
571  virtual const vtkIdType* GetEdgeArray(vtkIdType edgeId) = 0;
572 
573 protected:
575  ~vtkGenericAdaptorCell() override;
576 
580  void Reset();
581 
586  void AllocateTuples(int size);
587 
588  // Internal tetra used for the contouring/clipping algorithm
592  vtkVertex* Vertex; // is it used ?
597 
598  // Internal locator when tessellating on a cell basis, this is different
599  // from the main locator used in contour/clip filter, this locator is used for
600  // points for
601  // Be careful the use of a vtkLocator in conjunction with the table fast
602  // tessellator is very sensitive, we need to keep all the points we used
607 
608  vtkIdList* InternalIds; // used by Tessellate() and TriangulateFace()
609 
610  // Attributes to mimic the vtk cell look and feel, internal use only
614 
615  // Scalar buffer to store the attributes values at some location
616  // There are variable members to reduce memory allocations.
617  double* Tuples;
619 
620  // Cached Bounds.
621  double Bounds[6];
622 
623 private:
625  void operator=(const vtkGenericAdaptorCell&) = delete;
626 };
627 
628 #endif
abstract interface for implicit functions
helper object to manage setting and generating contour values
void GetBounds(T a, double bds[6])
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate point attribute data
Definition: vtkPointData.h:41
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:33
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:46
represent and manipulate cell attribute data
Definition: vtkCellData.h:41
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:38
int vtkIdType
Definition: vtkType.h:332
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:44
cell represents a 1D line
Definition: vtkLine.h:33
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
vtkDoubleArray * InternalScalars
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:42
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:44
#define VTK_NEWINSTANCE
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:186
a cell that represents a triangle
Definition: vtkTriangle.h:38
vtkDoubleArray * InternalPoints
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:46
represent and manipulate 3D points
Definition: vtkPoints.h:39