VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQuadraticWedge.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 __vtkQuadraticWedge_h 00037 #define __vtkQuadraticWedge_h 00038 00039 #include "vtkNonLinearCell.h" 00040 00041 class vtkQuadraticEdge; 00042 class vtkQuadraticQuad; 00043 class vtkQuadraticTriangle; 00044 class vtkWedge; 00045 class vtkDoubleArray; 00046 00047 class VTK_FILTERING_EXPORT vtkQuadraticWedge : public vtkNonLinearCell 00048 { 00049 public: 00050 static vtkQuadraticWedge *New(); 00051 vtkTypeMacro(vtkQuadraticWedge,vtkNonLinearCell); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 00057 int GetCellType() {return VTK_QUADRATIC_WEDGE;} 00058 int GetCellDimension() {return 3;} 00059 int GetNumberOfEdges() {return 9;} 00060 int GetNumberOfFaces() {return 5;} 00061 vtkCell *GetEdge(int edgeId); 00062 vtkCell *GetFace(int faceId); 00064 00065 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00066 void Contour(double value, vtkDataArray *cellScalars, 00067 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00068 vtkCellArray *lines, vtkCellArray *polys, 00069 vtkPointData *inPd, vtkPointData *outPd, 00070 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00071 int EvaluatePosition(double x[3], double* closestPoint, 00072 int& subId, double pcoords[3], 00073 double& dist2, double *weights); 00074 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00075 double *weights); 00076 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00077 void Derivatives(int subId, double pcoords[3], double *values, 00078 int dim, double *derivs); 00079 virtual double *GetParametricCoords(); 00080 00082 00085 void Clip(double value, vtkDataArray *cellScalars, 00086 vtkIncrementalPointLocator *locator, vtkCellArray *tetras, 00087 vtkPointData *inPd, vtkPointData *outPd, 00088 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00089 int insideOut); 00091 00093 00095 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00096 double x[3], double pcoords[3], int& subId); 00098 00099 00101 int GetParametricCenter(double pcoords[3]); 00102 00105 static void InterpolationFunctions(double pcoords[3], double weights[15]); 00108 static void InterpolationDerivs(double pcoords[3], double derivs[45]); 00110 00112 virtual void InterpolateFunctions(double pcoords[3], double weights[15]) 00113 { 00114 vtkQuadraticWedge::InterpolationFunctions(pcoords,weights); 00115 } 00116 virtual void InterpolateDerivs(double pcoords[3], double derivs[45]) 00117 { 00118 vtkQuadraticWedge::InterpolationDerivs(pcoords,derivs); 00119 } 00121 00122 00124 static int *GetEdgeArray(int edgeId); 00125 static int *GetFaceArray(int faceId); 00127 00131 void JacobianInverse(double pcoords[3], double **inverse, double derivs[45]); 00132 00133 protected: 00134 vtkQuadraticWedge(); 00135 ~vtkQuadraticWedge(); 00136 00137 vtkQuadraticEdge *Edge; 00138 vtkQuadraticTriangle *TriangleFace; 00139 vtkQuadraticQuad *Face; 00140 vtkWedge *Wedge; 00141 vtkPointData *PointData; 00142 vtkCellData *CellData; 00143 vtkDoubleArray *CellScalars; 00144 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00145 00146 void Subdivide(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId, 00147 vtkDataArray *cellScalars); 00148 00149 private: 00150 vtkQuadraticWedge(const vtkQuadraticWedge&); // Not implemented. 00151 void operator=(const vtkQuadraticWedge&); // Not implemented. 00152 }; 00153 //---------------------------------------------------------------------------- 00154 // Return the center of the quadratic wedge in parametric coordinates. 00155 inline int vtkQuadraticWedge::GetParametricCenter(double pcoords[3]) 00156 { 00157 pcoords[0] = pcoords[1] = 1./3; 00158 pcoords[2] = 0.5; 00159 return 0; 00160 } 00161 00162 00163 #endif 00164 00165