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 
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  static void InterpolationFunctions(double pcoords[3], double weights[4]);
84  static void InterpolationDerivs(double pcoords[3], double derivs[8]);
86 
88  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
89  {
90  vtkPixel::InterpolationFunctions(pcoords,weights);
91  }
92  virtual void InterpolateDerivs(double pcoords[3], double derivs[8])
93  {
94  vtkPixel::InterpolationDerivs(pcoords,derivs);
95  }
97 
98 protected:
99  vtkPixel();
100  ~vtkPixel();
101 
103 
104 private:
105  vtkPixel(const vtkPixel&); // Not implemented.
106  void operator=(const vtkPixel&); // Not implemented.
107 };
108 
109 //----------------------------------------------------------------------------
110 inline int vtkPixel::GetParametricCenter(double pcoords[3])
111 {
112  pcoords[0] = pcoords[1] = 0.5;
113  pcoords[2] = 0.0;
114  return 0;
115 }
116 
117 #endif
118 
119