VTK
vtkVoxel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVoxel.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 =========================================================================*/
33 #ifndef __vtkVoxel_h
34 #define __vtkVoxel_h
35 
36 #include "vtkCell3D.h"
37 
38 class vtkLine;
39 class vtkPixel;
41 
43 {
44 public:
45  static vtkVoxel *New();
46  vtkTypeMacro(vtkVoxel,vtkCell3D);
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
51  virtual void GetEdgePoints(int edgeId, int* &pts);
52  virtual void GetFacePoints(int faceId, int* &pts);
53  virtual double *GetParametricCoords();
55 
57 
58  int GetCellType() {return VTK_VOXEL;}
59  int GetCellDimension() {return 3;}
60  int GetNumberOfEdges() {return 12;}
61  int GetNumberOfFaces() {return 6;}
62  vtkCell *GetEdge(int edgeId);
63  vtkCell *GetFace(int faceId);
64  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
65  void Contour(double value, vtkDataArray *cellScalars,
67  vtkCellArray *lines, vtkCellArray *polys,
68  vtkPointData *inPd, vtkPointData *outPd,
69  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
70  int EvaluatePosition(double x[3], double* closestPoint,
71  int& subId, double pcoords[3],
72  double& dist2, double *weights);
73  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
74  double *weights);
75  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
76  double x[3], double pcoords[3], int& subId);
77  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
78  void Derivatives(int subId, double pcoords[3], double *values,
79  int dim, double *derivs);
81 
83  static void InterpolationDerivs(double pcoords[3], double derivs[24]);
85 
87  virtual void InterpolateFunctions(double pcoords[3], double weights[8])
88  {
89  vtkVoxel::InterpolationFunctions(pcoords,weights);
90  }
91  virtual void InterpolateDerivs(double pcoords[3], double derivs[24])
92  {
93  vtkVoxel::InterpolationDerivs(pcoords,derivs);
94  }
96 
100  static void InterpolationFunctions(double pcoords[3], double weights[8]);
101 
103 
105  static int *GetEdgeArray(int edgeId);
106  static int *GetFaceArray(int faceId);
108 
109 protected:
110  vtkVoxel();
111  ~vtkVoxel();
112 
113 private:
114  vtkVoxel(const vtkVoxel&); // Not implemented.
115  void operator=(const vtkVoxel&); // Not implemented.
116 
117  vtkLine *Line;
118  vtkPixel *Pixel;
119 };
120 
121 #endif
122 
123