00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00058 #ifndef __vtkVoxel_h
00059 #define __vtkVoxel_h
00060
00061 #include "vtkCell3D.h"
00062 #include "vtkLine.h"
00063 #include "vtkPixel.h"
00064
00065 class VTK_COMMON_EXPORT vtkVoxel : public vtkCell3D
00066 {
00067 public:
00068 static vtkVoxel *New();
00069 vtkTypeMacro(vtkVoxel,vtkCell);
00070
00072
00073 virtual void GetEdgePoints(int edgeId, int* &pts);
00074 virtual void GetFacePoints(int faceId, int* &pts);
00076
00078
00079 vtkCell *MakeObject();
00080 int GetCellType() {return VTK_VOXEL;}
00081 int GetCellDimension() {return 3;}
00082 int GetNumberOfEdges() {return 12;}
00083 int GetNumberOfFaces() {return 6;}
00084 vtkCell *GetEdge(int edgeId);
00085 vtkCell *GetFace(int faceId);
00086 int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
00087 void Contour(float value, vtkDataArray *cellScalars,
00088 vtkPointLocator *locator, vtkCellArray *verts,
00089 vtkCellArray *lines, vtkCellArray *polys,
00090 vtkPointData *inPd, vtkPointData *outPd,
00091 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00092 int EvaluatePosition(float x[3], float* closestPoint,
00093 int& subId, float pcoords[3],
00094 float& dist2, float *weights);
00095 void EvaluateLocation(int& subId, float pcoords[3], float x[3],
00096 float *weights);
00097 int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00098 float x[3], float pcoords[3], int& subId);
00099 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00100 void Derivatives(int subId, float pcoords[3], float *values,
00101 int dim, float *derivs);
00103
00105
00106 static void InterpolationFunctions(float pcoords[3], float weights[8]);
00107 static void InterpolationDerivs(float pcoords[3], float derivs[24]);
00108 static int *GetEdgeArray(int edgeId);
00109 static int *GetFaceArray(int faceId);
00111
00112 protected:
00113 vtkVoxel();
00114 ~vtkVoxel();
00115
00116 vtkLine *Line;
00117 vtkPixel *Pixel;
00118
00119 private:
00120 vtkVoxel(const vtkVoxel&);
00121 void operator=(const vtkVoxel&);
00122 };
00123
00124 #endif
00125
00126