VTK  9.2.6
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 =========================================================================*/
37 #ifndef vtkPixel_h
38 #define vtkPixel_h
39 
40 #include "vtkCell.h"
41 #include "vtkCommonDataModelModule.h" // For export macro
42 
43 class vtkLine;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkPixel : public vtkCell
47 {
48 public:
49  static vtkPixel* New();
50  vtkTypeMacro(vtkPixel, vtkCell);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  int GetCellType() override { return VTK_PIXEL; }
58  int GetCellDimension() override { return 2; }
59  int GetNumberOfEdges() override { return 4; }
60  int GetNumberOfFaces() override { return 0; }
61  vtkCell* GetEdge(int edgeId) override;
62  vtkCell* GetFace(int) override { return nullptr; }
63  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
64  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
65  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
66  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
67  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
68  vtkCellArray* polys, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
69  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
70  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
71  double& dist2, double weights[]) override;
72  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
74 
87  int Inflate(double dist) override;
88 
92  double ComputeBoundingSphere(double center[3]) const override;
93 
97  int GetParametricCenter(double pcoords[3]) override;
98 
99  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
100  double pcoords[3], int& subId) override;
101  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
103  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
104  double* GetParametricCoords() override;
105 
106  static void InterpolationFunctions(const double pcoords[3], double weights[4]);
107  static void InterpolationDerivs(const double pcoords[3], double derivs[8]);
109 
113  void InterpolateFunctions(const double pcoords[3], double weights[4]) override
114  {
115  vtkPixel::InterpolationFunctions(pcoords, weights);
116  }
117  void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
118  {
119  vtkPixel::InterpolationDerivs(pcoords, derivs);
120  }
122 
128  int ComputeNormal(double n[3]);
129 
130 protected:
132  ~vtkPixel() override;
133 
135 
136 private:
137  vtkPixel(const vtkPixel&) = delete;
138  void operator=(const vtkPixel&) = delete;
139 };
140 
141 //----------------------------------------------------------------------------
142 inline int vtkPixel::GetParametricCenter(double pcoords[3])
143 {
144  pcoords[0] = pcoords[1] = 0.5;
145  pcoords[2] = 0.0;
146  return 0;
147 }
148 
149 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:196
represent and manipulate cell attribute data
Definition: vtkCellData.h:51
abstract class to specify cell behavior
Definition: vtkCell.h:70
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
list of point or cell ids
Definition: vtkIdList.h:43
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:49
cell represents a 1D line
Definition: vtkLine.h:43
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:47
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:57
void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkPixel.h:117
int ComputeNormal(double n[3])
vtkPixel's normal cannot be computed using vtkPolygon::ComputeNormal because its points are not sorte...
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
See the vtkCell API for descriptions of these methods.
int GetNumberOfEdges() override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:59
void InterpolateFunctions(const double pcoords[3], double weights[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkPixel.h:113
int GetNumberOfFaces() override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:60
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.
double ComputeBoundingSphere(double center[3]) const override
Computes exact bounding sphere of this pixel.
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
See the vtkCell API for descriptions of these methods.
int GetParametricCenter(double pcoords[3]) override
Return the center of the triangle in parametric coordinates.
Definition: vtkPixel.h:142
int GetCellDimension() override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:58
int Inflate(double dist) override
Inflates this pixel by a distance of dist by moving the edges of the pixel by that distance.
~vtkPixel() override
vtkLine * Line
Definition: vtkPixel.h:134
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
See the vtkCell API for descriptions of these methods.
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
See the vtkCell API for descriptions of these methods.
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
See the vtkCell API for descriptions of these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCell * GetFace(int) override
See the vtkCell API for descriptions of these methods.
Definition: vtkPixel.h:62
vtkCell * GetEdge(int edgeId) override
See the vtkCell API for descriptions of these methods.
represent and manipulate point attribute data
Definition: vtkPointData.h:51
represent and manipulate 3D points
Definition: vtkPoints.h:49
@ value
Definition: vtkX3D.h:226
@ center
Definition: vtkX3D.h:236
@ index
Definition: vtkX3D.h:252
@ VTK_PIXEL
Definition: vtkCellType.h:54
int vtkIdType
Definition: vtkType.h:332