VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBiQuadraticQuadraticWedge.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 =========================================================================*/ 00043 #ifndef __vtkBiQuadraticQuadraticWedge_h 00044 #define __vtkBiQuadraticQuadraticWedge_h 00045 00046 #include "vtkCommonDataModelModule.h" // For export macro 00047 #include "vtkNonLinearCell.h" 00048 00049 class vtkQuadraticEdge; 00050 class vtkBiQuadraticQuad; 00051 class vtkQuadraticTriangle; 00052 class vtkWedge; 00053 class vtkDoubleArray; 00054 00055 class VTKCOMMONDATAMODEL_EXPORT vtkBiQuadraticQuadraticWedge : public vtkNonLinearCell 00056 { 00057 public: 00058 static vtkBiQuadraticQuadraticWedge *New (); 00059 vtkTypeMacro(vtkBiQuadraticQuadraticWedge,vtkNonLinearCell); 00060 void PrintSelf (ostream & os, vtkIndent indent); 00061 00063 00065 int GetCellType () { return VTK_BIQUADRATIC_QUADRATIC_WEDGE; } 00066 int GetCellDimension () { return 3; } 00067 int GetNumberOfEdges () { return 9; } 00068 int GetNumberOfFaces () { return 5; } 00069 vtkCell *GetEdge (int edgeId); 00070 vtkCell *GetFace (int faceId); 00072 00073 int CellBoundary (int subId, double pcoords[3], vtkIdList * pts); 00074 void Contour (double value, vtkDataArray * cellScalars, 00075 vtkIncrementalPointLocator * locator, vtkCellArray * verts, 00076 vtkCellArray * lines, vtkCellArray * polys, 00077 vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd, 00078 vtkIdType cellId, vtkCellData * outCd); 00079 int EvaluatePosition (double x[3], double *closestPoint, 00080 int &subId, double pcoords[3], double &dist2, double *weights); 00081 void EvaluateLocation (int &subId, double pcoords[3], double x[3], 00082 double *weights); 00083 int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts); 00084 void Derivatives (int subId, double pcoords[3], double *values, int dim, 00085 double *derivs); 00086 virtual double *GetParametricCoords (); 00087 00089 00092 void Clip (double value, vtkDataArray * cellScalars, 00093 vtkIncrementalPointLocator * locator, vtkCellArray * tetras, 00094 vtkPointData * inPd, vtkPointData * outPd, 00095 vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd, 00096 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 00106 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 vtkBiQuadraticQuadraticWedge::InterpolationFunctions(pcoords,weights); 00122 } 00123 virtual void InterpolateDerivs (double pcoords[3], double derivs[45]) 00124 { 00125 vtkBiQuadraticQuadraticWedge::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 vtkBiQuadraticQuadraticWedge (); 00142 ~vtkBiQuadraticQuadraticWedge (); 00143 00144 vtkQuadraticEdge *Edge; 00145 vtkQuadraticTriangle *TriangleFace; 00146 vtkBiQuadraticQuad *Face; 00147 vtkWedge *Wedge; 00148 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00149 00150 private: 00151 vtkBiQuadraticQuadraticWedge (const vtkBiQuadraticQuadraticWedge &); // Not implemented. 00152 void operator = (const vtkBiQuadraticQuadraticWedge &); // Not implemented. 00153 }; 00154 //---------------------------------------------------------------------------- 00155 // Return the center of the quadratic wedge in parametric coordinates. 00156 inline int vtkBiQuadraticQuadraticWedge::GetParametricCenter(double pcoords[3]) 00157 { 00158 pcoords[0] = pcoords[1] = 1./3; 00159 pcoords[2] = 0.5; 00160 return 0; 00161 } 00162 00163 00164 #endif