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 "vtkCommonDataModelModule.h" // For export macro 00040 #include "vtkNonLinearCell.h" 00041 00042 class vtkQuadraticEdge; 00043 class vtkQuadraticQuad; 00044 class vtkQuadraticTriangle; 00045 class vtkWedge; 00046 class vtkDoubleArray; 00047 00048 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticWedge : public vtkNonLinearCell 00049 { 00050 public: 00051 static vtkQuadraticWedge *New(); 00052 vtkTypeMacro(vtkQuadraticWedge,vtkNonLinearCell); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00056 00058 int GetCellType() {return VTK_QUADRATIC_WEDGE;} 00059 int GetCellDimension() {return 3;} 00060 int GetNumberOfEdges() {return 9;} 00061 int GetNumberOfFaces() {return 5;} 00062 vtkCell *GetEdge(int edgeId); 00063 vtkCell *GetFace(int faceId); 00065 00066 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00067 void Contour(double value, vtkDataArray *cellScalars, 00068 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00069 vtkCellArray *lines, vtkCellArray *polys, 00070 vtkPointData *inPd, vtkPointData *outPd, 00071 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00072 int EvaluatePosition(double x[3], double* closestPoint, 00073 int& subId, double pcoords[3], 00074 double& dist2, double *weights); 00075 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00076 double *weights); 00077 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00078 void Derivatives(int subId, double pcoords[3], double *values, 00079 int dim, double *derivs); 00080 virtual double *GetParametricCoords(); 00081 00083 00086 void Clip(double value, vtkDataArray *cellScalars, 00087 vtkIncrementalPointLocator *locator, vtkCellArray *tetras, 00088 vtkPointData *inPd, vtkPointData *outPd, 00089 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00090 int insideOut); 00092 00094 00096 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00097 double x[3], double pcoords[3], int& subId); 00099 00100 00102 int GetParametricCenter(double pcoords[3]); 00103 00106 static void InterpolationFunctions(double pcoords[3], double weights[15]); 00109 static void InterpolationDerivs(double pcoords[3], double derivs[45]); 00111 00113 virtual void InterpolateFunctions(double pcoords[3], double weights[15]) 00114 { 00115 vtkQuadraticWedge::InterpolationFunctions(pcoords,weights); 00116 } 00117 virtual void InterpolateDerivs(double pcoords[3], double derivs[45]) 00118 { 00119 vtkQuadraticWedge::InterpolationDerivs(pcoords,derivs); 00120 } 00122 00123 00125 static int *GetEdgeArray(int edgeId); 00126 static int *GetFaceArray(int faceId); 00128 00132 void JacobianInverse(double pcoords[3], double **inverse, double derivs[45]); 00133 00134 protected: 00135 vtkQuadraticWedge(); 00136 ~vtkQuadraticWedge(); 00137 00138 vtkQuadraticEdge *Edge; 00139 vtkQuadraticTriangle *TriangleFace; 00140 vtkQuadraticQuad *Face; 00141 vtkWedge *Wedge; 00142 vtkPointData *PointData; 00143 vtkCellData *CellData; 00144 vtkDoubleArray *CellScalars; 00145 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00146 00147 void Subdivide(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId, 00148 vtkDataArray *cellScalars); 00149 00150 private: 00151 vtkQuadraticWedge(const vtkQuadraticWedge&); // Not implemented. 00152 void operator=(const vtkQuadraticWedge&); // Not implemented. 00153 }; 00154 //---------------------------------------------------------------------------- 00155 // Return the center of the quadratic wedge in parametric coordinates. 00156 inline int vtkQuadraticWedge::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 00165 00166