VTK
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 =========================================================================*/
30 #ifndef __vtkPixel_h
31 #define __vtkPixel_h
32 
33 #include "vtkCell.h"
34 
35 class vtkLine;
37 
38 class VTK_FILTERING_EXPORT vtkPixel : public vtkCell
39 {
40 public:
41  static vtkPixel *New();
42  vtkTypeMacro(vtkPixel,vtkCell);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
47  int GetCellType() {return VTK_PIXEL;};
48  int GetCellDimension() {return 2;};
49  int GetNumberOfEdges() {return 4;};
50  int GetNumberOfFaces() {return 0;};
51  vtkCell *GetEdge(int edgeId);
52  vtkCell *GetFace(int) {return 0;};
53  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
54  void Contour(double value, vtkDataArray *cellScalars,
56  vtkCellArray *lines, vtkCellArray *polys,
57  vtkPointData *inPd, vtkPointData *outPd,
58  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
59  void Clip(double value, vtkDataArray *cellScalars,
61  vtkPointData *inPd, vtkPointData *outPd,
62  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
63  int insideOut);
64  int EvaluatePosition(double x[3], double* closestPoint,
65  int& subId, double pcoords[3],
66  double& dist2, double *weights);
67  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
68  double *weights);
70 
72  int GetParametricCenter(double pcoords[3]);
73 
74  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
75  double x[3], double pcoords[3], int& subId);
76  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
77  void Derivatives(int subId, double pcoords[3], double *values,
78  int dim, double *derivs);
79  virtual double *GetParametricCoords();
80 
82 
83  static void InterpolationFunctions(double pcoords[3], double weights[4]);
84  // Description:
85  // @deprecated Replaced by vtkPixel::InterpolateDerivs as of VTK 5.2
86  static void InterpolationDerivs(double pcoords[3], double derivs[8]);
87  // Description:
88  // Compute the interpolation functions/derivatives
89  // (aka shape functions/derivatives)
90  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
91  {
92  vtkPixel::InterpolationFunctions(pcoords,weights);
93  }
94  virtual void InterpolateDerivs(double pcoords[3], double derivs[8])
95  {
96  vtkPixel::InterpolationDerivs(pcoords,derivs);
97  }
99 
100 protected:
101  vtkPixel();
102  ~vtkPixel();
103 
105 
106 private:
107  vtkPixel(const vtkPixel&); // Not implemented.
108  void operator=(const vtkPixel&); // Not implemented.
109 };
110 
111 //----------------------------------------------------------------------------
112 inline int vtkPixel::GetParametricCenter(double pcoords[3])
113 {
114  pcoords[0] = pcoords[1] = 0.5;
115  pcoords[2] = 0.0;
116  return 0;
117 }
118 
119 #endif
120 
121