VTK  9.6.1
vtkGenericAdaptorCell.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
49
50#ifndef vtkGenericAdaptorCell_h
51#define vtkGenericAdaptorCell_h
52
53#include "vtkCommonDataModelModule.h" // For export macro
54#include "vtkObject.h"
55
56VTK_ABI_NAMESPACE_BEGIN
57class vtkLine;
58class vtkTetra;
59class vtkPoints;
60class vtkVertex;
61class vtkTriangle;
62class vtkCellData;
63class vtkPointData;
64class vtkCellArray;
65class vtkDoubleArray;
74class vtkIdList;
76class vtkPolygon;
78class vtkQuad;
79class vtkHexahedron;
80class vtkWedge;
81class vtkPyramid;
82
83class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
84{
85public:
87 void PrintSelf(ostream& os, vtkIndent indent) override;
88
93 virtual vtkIdType GetId() = 0;
94
98 virtual int IsInDataSet() = 0;
106 virtual int GetType() = 0;
107
112 virtual int GetDimension() = 0;
113
118 virtual int GetGeometryOrder() = 0;
119
125
132 virtual int GetAttributeOrder(vtkGenericAttribute* a) = 0;
133
140 virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection* ac);
141
147 vtkTypeBool IsAttributeLinear(vtkGenericAttribute* a);
148
152 virtual int IsPrimary() = 0;
153
158 virtual int GetNumberOfPoints() = 0;
159
170 virtual int GetNumberOfBoundaries(int dim = -1) = 0;
171
184 virtual int GetNumberOfDOFNodes() = 0;
185
190 virtual void GetPointIterator(vtkGenericPointIterator* it) = 0;
191
198
205 virtual void GetBoundaryIterator(vtkGenericCellIterator* boundaries, int dim = -1) = 0;
206
208
218 virtual int CountNeighbors(vtkGenericAdaptorCell* boundary) = 0;
219 virtual void CountEdgeNeighbors(int* sharing) = 0;
221
232 virtual void GetNeighbors(vtkGenericAdaptorCell* boundary, vtkGenericCellIterator* neighbors) = 0;
233
241 virtual int FindClosestBoundary(
242 int subId, double pcoords[3], vtkGenericCellIterator*& boundary) = 0;
243
255 virtual int EvaluatePosition(
256 const double x[3], double* closestPoint, int& subId, double pcoords[3], double& dist2) = 0;
257
265 virtual void EvaluateLocation(int subId, double pcoords[3], double x[3]) = 0;
266
277 virtual void InterpolateTuple(vtkGenericAttribute* a, double pcoords[3], double* val) = 0;
278
289 virtual void InterpolateTuple(
290 vtkGenericAttributeCollection* c, double pcoords[3], double* val) = 0;
291
333 virtual void Contour(vtkContourValues* values, vtkImplicitFunction* f,
336 vtkCellArray* polys, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
337 vtkPointData* secondaryPd, vtkCellData* secondaryCd);
338
379 virtual void Clip(double value, vtkImplicitFunction* f, vtkGenericAttributeCollection* attributes,
380 vtkGenericCellTessellator* tess, int insideOut, vtkIncrementalPointLocator* locator,
381 vtkCellArray* connectivity, vtkPointData* outPd, vtkCellData* outCd, vtkPointData* internalPd,
382 vtkPointData* secondaryPd, vtkCellData* secondaryCd);
383
392 virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, double x[3],
393 double pcoords[3], int& subId) = 0;
394
407 virtual void Derivatives(
408 int subId, double pcoords[3], vtkGenericAttribute* attribute, double* derivs) = 0;
409
415 virtual void GetBounds(double bounds[6]) = 0;
416
423 virtual double* GetBounds();
424
429 virtual double GetLength2();
430
437 virtual int GetParametricCenter(double pcoords[3]) = 0;
438
446 virtual double GetParametricDistance(const double pcoords[3]) = 0;
447
458 virtual double* GetParametricCoords() = 0;
459
482 vtkCellArray* cellArray, vtkPointData* internalPd, vtkPointData* pd, vtkCellData* cd,
483 vtkUnsignedCharArray* types);
484
485 // The following methods are for the internals of the tessellation algorithm
486 // (the hash table in particular)
487
493 virtual int IsFaceOnBoundary(vtkIdType faceId) = 0;
494
499 virtual int IsOnBoundary() = 0;
500
507 virtual void GetPointIds(vtkIdType* id) = 0;
508
522 virtual void TriangulateFace(vtkGenericAttributeCollection* attributes,
523 vtkGenericCellTessellator* tess, int index, vtkPoints* points,
524 vtkIncrementalPointLocator* locator, vtkCellArray* cellArray, vtkPointData* internalPd,
525 vtkPointData* pd, vtkCellData* cd);
526
539 virtual const vtkIdType* GetFaceArray(vtkIdType faceId) = 0;
540
547 virtual int GetNumberOfVerticesOnFace(int faceId) = 0;
548
560 virtual const vtkIdType* GetEdgeArray(vtkIdType edgeId) = 0;
561
562protected:
564 ~vtkGenericAdaptorCell() override;
565
569 void Reset();
570
575 void AllocateTuples(int size);
576
577 // Internal tetra used for the contouring/clipping algorithm
581 vtkVertex* Vertex; // is it used ?
586
587 // Internal locator when tessellating on a cell basis, this is different
588 // from the main locator used in contour/clip filter, this locator is used for
589 // points for
590 // Be careful the use of a vtkLocator in conjunction with the table fast
591 // tessellator is very sensitive, we need to keep all the points we used
596
597 vtkIdList* InternalIds; // used by Tessellate() and TriangulateFace()
598
599 // Attributes to mimic the vtk cell look and feel, internal use only
603
604 // Scalar buffer to store the attributes values at some location
605 // There are variable members to reduce memory allocations.
606 double* Tuples;
608
609 // Cached Bounds.
610 double Bounds[6];
611
612private:
614 void operator=(const vtkGenericAdaptorCell&) = delete;
615};
616
617VTK_ABI_NAMESPACE_END
618#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:32
helper object to manage setting and generating contour values
dynamic, self-adjusting array of double
defines cell interface
virtual int GetDimension()=0
Return the topological dimension of the current cell.
virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries, int dim=-1)=0
Return the boundaries' cells of dimension dim' (or all dimensions less than GetDimension() if -1) tha...
virtual vtkGenericCellIterator * NewCellIterator()=0
Return the points of cell into `it'.
virtual int GetGeometryOrder()=0
Return the interpolation order of the geometry.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int IsGeometryLinear()
Does the cell have a non-linear interpolation for the geometry?
virtual int GetType()=0
Does `this' a cell of a dataset?
virtual int GetNumberOfPoints()=0
Return the number of corner points that compose the cell.
virtual int IsPrimary()=0
Return the interpolation order of attribute `a' on the cell (may differ by cell).
virtual int GetNumberOfDOFNodes()=0
Return the number of boundaries of dimension `dim' (or all dimensions greater than 0 and less than Ge...
virtual vtkIdType GetId()=0
Unique identification number of the cell over the whole data set.
abstract class defined API for attribute data
iterator used to traverse cells
helper class to perform cell tessellation
iterator used to traverse points
a cell that represents a linear 3D hexahedron
list of point or cell ids
Definition vtkIdList.h:24
abstract interface for implicit functions
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:29
cell represents a 1D line
Definition vtkLine.h:23
helper class to generate triangulations
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:30
a cell that represents an n-sided polygon
Definition vtkPolygon.h:33
a 3D cell that represents a linear pyramid
Definition vtkPyramid.h:36
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:28
a 3D cell that represents a tetrahedron
Definition vtkTetra.h:34
a cell that represents a triangle
Definition vtkTriangle.h:28
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D point
Definition vtkVertex.h:23
a 3D cell that represents a linear wedge
Definition vtkWedge.h:36
int vtkTypeBool
Definition vtkABI.h:64
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
Line-edge intersection.
vtkPointData * PointData
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *tetras, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Clip this biquadratic hexahedron using scalar value provided.
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
vtkCellData * CellData
vtkDoubleArray * Scalars
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
double * GetParametricCoords() override
int GetParametricCenter(double pcoords[3]) override
Return the center of the quadratic wedge in parametric coordinates.
vtkWedge * Wedge
void Reset()
Initializes the field list to empty.
vtkCellArray * InternalCellArray
vtkHexahedron * Hexa
double Bounds[6]
virtual double GetLength2()
Return the bounding box diagonal squared of the current cell.
void AllocateTuples(int size)
Allocate some memory if Tuples does not exist or is smaller than size.
double * Tuples
virtual int IsOnBoundary()=0
Is the face `faceId' of the current cell on the exterior boundary of the dataset?
vtkQuad * Quad
vtkGenericAdaptorCell vtkObject FindClosestBoundary(int subId, double pcoords[3], vtkGenericCellIterator *&boundary)=0
Put into neighbors' the cells (dimension>boundary->GetDimension()) of the dataset that share the boun...
vtkPyramid * Pyramid
vtkIdList * InternalIds
vtkLine * Line
vtkDoubleArray * PointDataScalars
vtkDoubleArray * InternalScalars
virtual double * GetBounds()
Compute the bounding box of the current cell in `bounds' in global coordinates.
int TuplesCapacity
vtkDoubleArray * InternalPoints
vtkTriangle * Triangle
virtual void Tessellate(vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkPoints *points, vtkIncrementalPointLocator *locator, vtkCellArray *cellArray, vtkPointData *internalPd, vtkPointData *pd, vtkCellData *cd, vtkUnsignedCharArray *types)
Tessellate the cell if it is not linear or if at least one attribute of attributes' is not linear.
vtkTetra * Tetra
vtkVertex * Vertex
double GetParametricDistance(const double pcoords[3]) override
Return the distance of the parametric coordinate provided to the cell.
int vtkIdType
Definition vtkType.h:368
#define VTK_NEWINSTANCE