VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPixel.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00030 #ifndef __vtkPixel_h 00031 #define __vtkPixel_h 00032 00033 #include "vtkCell.h" 00034 00035 class vtkLine; 00036 class vtkIncrementalPointLocator; 00037 00038 class VTK_FILTERING_EXPORT vtkPixel : public vtkCell 00039 { 00040 public: 00041 static vtkPixel *New(); 00042 vtkTypeMacro(vtkPixel,vtkCell); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 00047 int GetCellType() {return VTK_PIXEL;}; 00048 int GetCellDimension() {return 2;}; 00049 int GetNumberOfEdges() {return 4;}; 00050 int GetNumberOfFaces() {return 0;}; 00051 vtkCell *GetEdge(int edgeId); 00052 vtkCell *GetFace(int) {return 0;}; 00053 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00054 void Contour(double value, vtkDataArray *cellScalars, 00055 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00056 vtkCellArray *lines, vtkCellArray *polys, 00057 vtkPointData *inPd, vtkPointData *outPd, 00058 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00059 void Clip(double value, vtkDataArray *cellScalars, 00060 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00061 vtkPointData *inPd, vtkPointData *outPd, 00062 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00063 int insideOut); 00064 int EvaluatePosition(double x[3], double* closestPoint, 00065 int& subId, double pcoords[3], 00066 double& dist2, double *weights); 00067 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00068 double *weights); 00070 00072 int GetParametricCenter(double pcoords[3]); 00073 00074 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00075 double x[3], double pcoords[3], int& subId); 00076 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00077 void Derivatives(int subId, double pcoords[3], double *values, 00078 int dim, double *derivs); 00079 virtual double *GetParametricCoords(); 00080 00082 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00084 static void InterpolationDerivs(double pcoords[3], double derivs[8]); 00086 00088 virtual void InterpolateFunctions(double pcoords[3], double weights[4]) 00089 { 00090 vtkPixel::InterpolationFunctions(pcoords,weights); 00091 } 00092 virtual void InterpolateDerivs(double pcoords[3], double derivs[8]) 00093 { 00094 vtkPixel::InterpolationDerivs(pcoords,derivs); 00095 } 00097 00098 protected: 00099 vtkPixel(); 00100 ~vtkPixel(); 00101 00102 vtkLine *Line; 00103 00104 private: 00105 vtkPixel(const vtkPixel&); // Not implemented. 00106 void operator=(const vtkPixel&); // Not implemented. 00107 }; 00108 00109 //---------------------------------------------------------------------------- 00110 inline int vtkPixel::GetParametricCenter(double pcoords[3]) 00111 { 00112 pcoords[0] = pcoords[1] = 0.5; 00113 pcoords[2] = 0.0; 00114 return 0; 00115 } 00116 00117 #endif 00118 00119