VTK  9.0.3
vtkPixel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPixel.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 =========================================================================*/
25 #ifndef vtkPixel_h
26 #define vtkPixel_h
27 
28 #include "vtkCell.h"
29 #include "vtkCommonDataModelModule.h" // For export macro
30 
31 class vtkLine;
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkPixel : public vtkCell
35 {
36 public:
37  static vtkPixel* New();
38  vtkTypeMacro(vtkPixel, vtkCell);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  int GetCellType() override { return VTK_PIXEL; }
46  int GetCellDimension() override { return 2; }
47  int GetNumberOfEdges() override { return 4; }
48  int GetNumberOfFaces() override { return 0; }
49  vtkCell* GetEdge(int edgeId) override;
50  vtkCell* GetFace(int) override { return nullptr; }
51  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
52  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
53  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
54  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
55  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
56  vtkCellArray* polys, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
57  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
58  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
59  double& dist2, double weights[]) override;
60  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
62 
66  int GetParametricCenter(double pcoords[3]) override;
67 
68  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
69  double pcoords[3], int& subId) override;
70  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
72  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
73  double* GetParametricCoords() override;
74 
75  static void InterpolationFunctions(const double pcoords[3], double weights[4]);
76  static void InterpolationDerivs(const double pcoords[3], double derivs[8]);
78 
82  void InterpolateFunctions(const double pcoords[3], double weights[4]) override
83  {
84  vtkPixel::InterpolationFunctions(pcoords, weights);
85  }
86  void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
87  {
88  vtkPixel::InterpolationDerivs(pcoords, derivs);
89  }
91 
92 protected:
94  ~vtkPixel() override;
95 
97 
98 private:
99  vtkPixel(const vtkPixel&) = delete;
100  void operator=(const vtkPixel&) = delete;
101 };
102 
103 //----------------------------------------------------------------------------
104 inline int vtkPixel::GetParametricCenter(double pcoords[3])
105 {
106  pcoords[0] = pcoords[1] = 0.5;
107  pcoords[2] = 0.0;
108  return 0;
109 }
110 
111 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:180
represent and manipulate cell attribute data
Definition: vtkCellData.h:33
abstract class to specify cell behavior
Definition: vtkCell.h:57
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
list of point or cell ids
Definition: vtkIdList.h:31
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:34
cell represents a 1D line
Definition: vtkLine.h:30
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:35
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:45
void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
Definition: vtkPixel.h:86
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
Given parametric coordinates of a point, return the closest cell boundary, and whether the point is i...
int GetNumberOfEdges() override
Return the number of edges in the cell.
Definition: vtkPixel.h:47
void InterpolateFunctions(const double pcoords[3], double weights[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkPixel.h:82
int GetNumberOfFaces() override
Return the number of faces in the cell.
Definition: vtkPixel.h:48
static void InterpolationDerivs(const double pcoords[3], double derivs[8])
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
Intersect with a ray.
int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override
Generate simplices of proper dimension.
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
Determine global coordinate (x[3]) from subId and parametric coordinates.
int GetParametricCenter(double pcoords[3]) override
Return the center of the triangle in parametric coordinates.
Definition: vtkPixel.h:104
int GetCellDimension() override
Return the topological dimensional of the cell (0,1,2, or 3).
Definition: vtkPixel.h:46
~vtkPixel() override
vtkLine * Line
Definition: vtkPixel.h:96
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
Compute derivatives given cell subId and parametric coordinates.
static void InterpolationFunctions(const double pcoords[3], double weights[4])
static vtkPixel * New()
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
Generate contouring primitives.
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Cut (or clip) the cell based on the input cellScalars and the specified value.
double * GetParametricCoords() override
Return a contiguous array of parametric coordinates of the points defining this cell.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
Given a point x[3] return inside(=1), outside(=0) cell, or (-1) computational problem encountered; ev...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCell * GetFace(int) override
Return the face cell from the faceId of the cell.
Definition: vtkPixel.h:50
vtkCell * GetEdge(int edgeId) override
Return the edge cell from the edgeId of the cell.
represent and manipulate point attribute data
Definition: vtkPointData.h:32
represent and manipulate 3D points
Definition: vtkPoints.h:34
@ value
Definition: vtkX3D.h:226
@ index
Definition: vtkX3D.h:252
@ VTK_PIXEL
Definition: vtkCellType.h:54
int vtkIdType
Definition: vtkType.h:338