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 "vtkCommonDataModelModule.h" // For export macro 00034 #include "vtkCell.h" 00035 00036 class vtkLine; 00037 class vtkIncrementalPointLocator; 00038 00039 class VTKCOMMONDATAMODEL_EXPORT vtkPixel : public vtkCell 00040 { 00041 public: 00042 static vtkPixel *New(); 00043 vtkTypeMacro(vtkPixel,vtkCell); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 00048 int GetCellType() {return VTK_PIXEL;}; 00049 int GetCellDimension() {return 2;}; 00050 int GetNumberOfEdges() {return 4;}; 00051 int GetNumberOfFaces() {return 0;}; 00052 vtkCell *GetEdge(int edgeId); 00053 vtkCell *GetFace(int) {return 0;}; 00054 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00055 void Contour(double value, vtkDataArray *cellScalars, 00056 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00057 vtkCellArray *lines, vtkCellArray *polys, 00058 vtkPointData *inPd, vtkPointData *outPd, 00059 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00060 void Clip(double value, vtkDataArray *cellScalars, 00061 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00062 vtkPointData *inPd, vtkPointData *outPd, 00063 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00064 int insideOut); 00065 int EvaluatePosition(double x[3], double* closestPoint, 00066 int& subId, double pcoords[3], 00067 double& dist2, double *weights); 00068 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00069 double *weights); 00071 00073 int GetParametricCenter(double pcoords[3]); 00074 00075 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00076 double x[3], double pcoords[3], int& subId); 00077 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00078 void Derivatives(int subId, double pcoords[3], double *values, 00079 int dim, double *derivs); 00080 virtual double *GetParametricCoords(); 00081 00083 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00085 static void InterpolationDerivs(double pcoords[3], double derivs[8]); 00087 00089 virtual void InterpolateFunctions(double pcoords[3], double weights[4]) 00090 { 00091 vtkPixel::InterpolationFunctions(pcoords,weights); 00092 } 00093 virtual void InterpolateDerivs(double pcoords[3], double derivs[8]) 00094 { 00095 vtkPixel::InterpolationDerivs(pcoords,derivs); 00096 } 00098 00099 protected: 00100 vtkPixel(); 00101 ~vtkPixel(); 00102 00103 vtkLine *Line; 00104 00105 private: 00106 vtkPixel(const vtkPixel&); // Not implemented. 00107 void operator=(const vtkPixel&); // Not implemented. 00108 }; 00109 00110 //---------------------------------------------------------------------------- 00111 inline int vtkPixel::GetParametricCenter(double pcoords[3]) 00112 { 00113 pcoords[0] = pcoords[1] = 0.5; 00114 pcoords[2] = 0.0; 00115 return 0; 00116 } 00117 00118 #endif 00119 00120