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