VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkWedge.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 =========================================================================*/ 00036 #ifndef __vtkWedge_h 00037 #define __vtkWedge_h 00038 00039 #include "vtkCell3D.h" 00040 00041 class vtkLine; 00042 class vtkTriangle; 00043 class vtkQuad; 00044 class vtkUnstructuredGrid; 00045 class vtkIncrementalPointLocator; 00046 00047 class VTK_FILTERING_EXPORT vtkWedge : public vtkCell3D 00048 { 00049 public: 00050 static vtkWedge *New(); 00051 vtkTypeMacro(vtkWedge,vtkCell3D); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 00056 virtual void GetEdgePoints(int edgeId, int* &pts); 00057 virtual void GetFacePoints(int faceId, int* &pts); 00059 00061 00062 int GetCellType() {return VTK_WEDGE;} 00063 int GetCellDimension() {return 3;} 00064 int GetNumberOfEdges() {return 9;} 00065 int GetNumberOfFaces() {return 5;} 00066 vtkCell *GetEdge(int edgeId); 00067 vtkCell *GetFace(int faceId); 00068 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00069 void Contour(double value, vtkDataArray *cellScalars, 00070 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00071 vtkCellArray *lines, vtkCellArray *polys, 00072 vtkPointData *inPd, vtkPointData *outPd, 00073 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00074 int EvaluatePosition(double x[3], double* closestPoint, 00075 int& subId, double pcoords[3], 00076 double& dist2, double *weights); 00077 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00078 double *weights); 00079 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00080 double x[3], double pcoords[3], int& subId); 00081 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00082 void Derivatives(int subId, double pcoords[3], double *values, 00083 int dim, double *derivs); 00084 virtual double *GetParametricCoords(); 00086 00088 int GetParametricCenter(double pcoords[3]); 00089 00091 static void InterpolationFunctions(double pcoords[3], double weights[6]); 00093 static void InterpolationDerivs(double pcoords[3], double derivs[18]); 00095 00097 virtual void InterpolateFunctions(double pcoords[3], double weights[6]) 00098 { 00099 vtkWedge::InterpolationFunctions(pcoords,weights); 00100 } 00101 virtual void InterpolateDerivs(double pcoords[3], double derivs[18]) 00102 { 00103 vtkWedge::InterpolationDerivs(pcoords,derivs); 00104 } 00105 int JacobianInverse(double pcoords[3], double **inverse, double derivs[18]); 00107 00109 00111 static int *GetEdgeArray(int edgeId); 00112 static int *GetFaceArray(int faceId); 00114 00115 protected: 00116 vtkWedge(); 00117 ~vtkWedge(); 00118 00119 vtkLine *Line; 00120 vtkTriangle *Triangle; 00121 vtkQuad *Quad; 00122 00123 private: 00124 vtkWedge(const vtkWedge&); // Not implemented. 00125 void operator=(const vtkWedge&); // Not implemented. 00126 }; 00127 00128 inline int vtkWedge::GetParametricCenter(double pcoords[3]) 00129 { 00130 pcoords[0] = pcoords[1] = 0.333333; 00131 pcoords[2] = 0.5; 00132 return 0; 00133 } 00134 00135 #endif 00136 00137 00138