VTK  9.1.0
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
65class vtkLine;
66class vtkTetra;
67class vtkPoints;
68class vtkVertex;
69class vtkTriangle;
70class vtkCellData;
71class vtkPointData;
72class vtkCellArray;
73class vtkDoubleArray;
82class vtkIdList;
84class vtkPolygon;
86class vtkQuad;
87class vtkHexahedron;
88class vtkWedge;
89class vtkPyramid;
90
91class VTKCOMMONDATAMODEL_EXPORT vtkGenericAdaptorCell : public vtkObject
92{
93public:
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
133
141
149
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
199
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
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
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
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
531 vtkGenericCellTessellator* tess, int index, vtkPoints* points,
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
570protected:
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
620private:
622 void operator=(const vtkGenericAdaptorCell&) = delete;
623};
624
625#endif
object to represent cell connectivity
Definition: vtkCellArray.h:290
represent and manipulate cell attribute data
Definition: vtkCellData.h:142
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 int IsOnBoundary()=0
Is the cell on the exterior boundary of the dataset?
virtual const vtkIdType * GetFaceArray(vtkIdType faceId)=0
Return the ids of the vertices defining face ‘faceId’.
vtkDoubleArray * InternalScalars
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.
virtual int CountNeighbors(vtkGenericAdaptorCell *boundary)=0
Number of cells (dimension>boundary->GetDimension()) of the dataset that share the boundary ‘boundary...
virtual void GetBoundaryIterator(vtkGenericCellIterator *boundaries, int dim=-1)=0
Return the ‘boundaries’ cells of dimension ‘dim’ (or all dimensions less than GetDimension() if -1) t...
virtual void GetBounds(double bounds[6])=0
Compute the bounding box of the current cell in ‘bounds’ in global coordinates.
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
Is there an intersection between the current cell and the ray (‘p1’,‘p2’) according to a tolerance ‘t...
virtual int GetHighestOrderAttribute(vtkGenericAttributeCollection *ac)
Return the index of the first point centered attribute with the highest order in ‘ac’.
virtual int EvaluatePosition(const double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2)=0
Is ‘x’ inside the current cell? It also evaluates parametric coordinates ‘pcoords’,...
virtual void Contour(vtkContourValues *values, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *outPd, vtkCellData *outCd, vtkPointData *internalPd, vtkPointData *secondaryPd, vtkCellData *secondaryCd)
Generate a contour (contouring primitives) for each ‘values’ or with respect to an implicit function ...
virtual void Clip(double value, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int insideOut, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *outPd, vtkCellData *outCd, vtkPointData *internalPd, vtkPointData *secondaryPd, vtkCellData *secondaryCd)
Cut (or clip) the current cell with respect to the contour defined by the ‘value’ or the implicit fun...
virtual void Derivatives(int subId, double pcoords[3], vtkGenericAttribute *attribute, double *derivs)=0
Compute derivatives ‘derivs’ of the attribute ‘attribute’ (from its values at the corner points of th...
virtual void InterpolateTuple(vtkGenericAttributeCollection *c, double pcoords[3], double *val)=0
Interpolate the whole collection of attributes ‘c’ at local position ‘pcoords’ of the cell into ‘val’...
virtual void CountEdgeNeighbors(int *sharing)=0
Number of cells (dimension>boundary->GetDimension()) of the dataset that share the boundary ‘boundary...
virtual int FindClosestBoundary(int subId, double pcoords[3], vtkGenericCellIterator *&boundary)=0
Compute the closest boundary of the current sub-cell ‘subId’ for point ‘pcoord’ (in parametric coordi...
virtual void EvaluateLocation(int subId, double pcoords[3], double x[3])=0
Determine the global coordinates ‘x’ from sub-cell ‘subId’ and parametric coordinates ‘pcoords’ in th...
virtual void GetPointIds(vtkIdType *id)=0
Put into ‘id’ the list of the dataset points that define the corner points of the cell.
virtual double * GetBounds()
Return the bounding box of the current cell in global coordinates.
virtual vtkGenericCellIterator * NewCellIterator()=0
Create an empty cell iterator.
~vtkGenericAdaptorCell() override
virtual int GetNumberOfBoundaries(int dim=-1)=0
Return the number of boundaries of dimension ‘dim’ (or all dimensions greater than 0 and less than Ge...
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.
virtual int GetNumberOfVerticesOnFace(int faceId)=0
Return the number of vertices defining face ‘faceId’.
virtual void InterpolateTuple(vtkGenericAttribute *a, double pcoords[3], double *val)=0
Interpolate the attribute ‘a’ at local position ‘pcoords’ of the cell into ‘val’.
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.
vtkDoubleArray * InternalPoints
int IsGeometryLinear()
Does the cell have a non-linear interpolation for the geometry?
virtual void GetNeighbors(vtkGenericAdaptorCell *boundary, vtkGenericCellIterator *neighbors)=0
Put into ‘neighbors’ the cells (dimension>boundary->GetDimension()) of the dataset that share the bou...
vtkDoubleArray * PointDataScalars
virtual const vtkIdType * GetEdgeArray(vtkIdType edgeId)=0
Return the ids of the vertices defining edge ‘edgeId’.
virtual int IsInDataSet()=0
Does ‘this’ a cell of a dataset? (otherwise, it is a boundary cell)
virtual int GetParametricCenter(double pcoords[3])=0
Get the center of the current cell (in parametric coordinates) and place it in ‘pcoords’.
virtual int GetType()=0
Return the type of the current cell.
virtual void TriangulateFace(vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int index, vtkPoints *points, vtkIncrementalPointLocator *locator, vtkCellArray *cellArray, vtkPointData *internalPd, vtkPointData *pd, vtkCellData *cd)
Tessellate face ‘index’ of the cell.
virtual int GetAttributeOrder(vtkGenericAttribute *a)=0
Return the interpolation order of attribute ‘a’ on the cell (may differ by cell).
virtual int IsFaceOnBoundary(vtkIdType faceId)=0
Is the face ‘faceId’ of the current cell on the exterior boundary of the dataset?
virtual void GetPointIterator(vtkGenericPointIterator *it)=0
Return the points of cell into ‘it’.
virtual int GetNumberOfPoints()=0
Return the number of corner points that compose the cell.
void Reset()
Reset internal structures.
virtual double * GetParametricCoords()=0
Return a contiguous array of parametric coordinates of the corrner points defining the current cell.
virtual int IsPrimary()=0
Is the cell primary (i.e.
virtual int GetNumberOfDOFNodes()=0
Accumulated number of DOF nodes of the current cell.
vtkTypeBool IsAttributeLinear(vtkGenericAttribute *a)
Does the attribute ‘a’ have a non-linear interpolation?
virtual double GetParametricDistance(const double pcoords[3])=0
Return the distance of the parametric coordinate ‘pcoords’ to the current cell.
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:140
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:113
cell represents a 1D line
Definition: vtkLine.h:140
abstract base class for most VTK objects
Definition: vtkObject.h:82
helper class to generate triangulations
represent and manipulate point attribute data
Definition: vtkPointData.h:142
represent and manipulate 3D points
Definition: vtkPoints.h:143
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:149
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:103
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:95
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:111
a cell that represents a triangle
Definition: vtkTriangle.h:145
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D point
Definition: vtkVertex.h:100
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:93
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
#define VTK_NEWINSTANCE