VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkVoxel.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 =========================================================================*/ 00033 #ifndef __vtkVoxel_h 00034 #define __vtkVoxel_h 00035 00036 #include "vtkCell3D.h" 00037 00038 class vtkLine; 00039 class vtkPixel; 00040 class vtkIncrementalPointLocator; 00041 00042 class VTK_FILTERING_EXPORT vtkVoxel : public vtkCell3D 00043 { 00044 public: 00045 static vtkVoxel *New(); 00046 vtkTypeMacro(vtkVoxel,vtkCell3D); 00047 void PrintSelf(ostream& os, vtkIndent indent); 00048 00050 00051 virtual void GetEdgePoints(int edgeId, int* &pts); 00052 virtual void GetFacePoints(int faceId, int* &pts); 00053 virtual double *GetParametricCoords(); 00055 00057 00058 int GetCellType() {return VTK_VOXEL;} 00059 int GetCellDimension() {return 3;} 00060 int GetNumberOfEdges() {return 12;} 00061 int GetNumberOfFaces() {return 6;} 00062 vtkCell *GetEdge(int edgeId); 00063 vtkCell *GetFace(int faceId); 00064 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00065 void Contour(double value, vtkDataArray *cellScalars, 00066 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00067 vtkCellArray *lines, vtkCellArray *polys, 00068 vtkPointData *inPd, vtkPointData *outPd, 00069 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00070 int EvaluatePosition(double x[3], double* closestPoint, 00071 int& subId, double pcoords[3], 00072 double& dist2, double *weights); 00073 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00074 double *weights); 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); 00081 00083 00084 static void InterpolationFunctions(double pcoords[3], double weights[8]); 00085 // Description: 00086 // @deprecated Replaced by vtkVoxel::InterpolateDerivs as of VTK 5.2 00087 static void InterpolationDerivs(double pcoords[3], double derivs[24]); 00088 // Description: 00089 // Compute the interpolation functions/derivatives 00090 // (aka shape functions/derivatives) 00091 virtual void InterpolateFunctions(double pcoords[3], double weights[8]) 00092 { 00093 vtkVoxel::InterpolationFunctions(pcoords,weights); 00094 } 00095 virtual void InterpolateDerivs(double pcoords[3], double derivs[24]) 00096 { 00097 vtkVoxel::InterpolationDerivs(pcoords,derivs); 00098 } 00100 00102 00104 static int *GetEdgeArray(int edgeId); 00105 static int *GetFaceArray(int faceId); 00107 00108 protected: 00109 vtkVoxel(); 00110 ~vtkVoxel(); 00111 00112 vtkLine *Line; 00113 vtkPixel *Pixel; 00114 00115 private: 00116 vtkVoxel(const vtkVoxel&); // Not implemented. 00117 void operator=(const vtkVoxel&); // Not implemented. 00118 }; 00119 00120 #endif 00121 00122