VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBiQuadraticTriangle.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 =========================================================================*/ 00040 #ifndef __vtkBiQuadraticTriangle_h 00041 #define __vtkBiQuadraticTriangle_h 00042 00043 #include "vtkNonLinearCell.h" 00044 00045 class vtkQuadraticEdge; 00046 class vtkTriangle; 00047 class vtkDoubleArray; 00048 00049 class VTK_FILTERING_EXPORT vtkBiQuadraticTriangle : public vtkNonLinearCell 00050 { 00051 public: 00052 static vtkBiQuadraticTriangle *New(); 00053 vtkTypeMacro(vtkBiQuadraticTriangle,vtkNonLinearCell); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 00059 int GetCellType() {return VTK_BIQUADRATIC_TRIANGLE;}; 00060 int GetCellDimension() {return 2;} 00061 int GetNumberOfEdges() {return 3;} 00062 int GetNumberOfFaces() {return 0;} 00063 vtkCell *GetEdge(int edgeId); 00064 vtkCell *GetFace(int) {return 0;} 00066 00067 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00068 void Contour(double value, vtkDataArray *cellScalars, 00069 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00070 vtkCellArray *lines, vtkCellArray *polys, 00071 vtkPointData *inPd, vtkPointData *outPd, 00072 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00073 int EvaluatePosition(double x[3], double* closestPoint, 00074 int& subId, double pcoords[3], 00075 double& dist2, double *weights); 00076 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00077 double *weights); 00078 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00079 void Derivatives(int subId, double pcoords[3], double *values, 00080 int dim, double *derivs); 00081 virtual double *GetParametricCoords(); 00082 00084 00087 void Clip(double value, vtkDataArray *cellScalars, 00088 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00089 vtkPointData *inPd, vtkPointData *outPd, 00090 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00091 int insideOut); 00093 00095 00097 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00098 double x[3], double pcoords[3], int& subId); 00100 00101 00104 int GetParametricCenter(double pcoords[3]); 00105 00108 double GetParametricDistance(double pcoords[3]); 00109 00112 static void InterpolationFunctions(double pcoords[3], double weights[7]); 00115 static void InterpolationDerivs(double pcoords[3], double derivs[14]); 00117 00119 virtual void InterpolateFunctions(double pcoords[3], double weights[7]) 00120 { 00121 vtkBiQuadraticTriangle::InterpolationFunctions(pcoords,weights); 00122 } 00123 virtual void InterpolateDerivs(double pcoords[3], double derivs[14]) 00124 { 00125 vtkBiQuadraticTriangle::InterpolationDerivs(pcoords,derivs); 00126 } 00128 00129 protected: 00130 vtkBiQuadraticTriangle(); 00131 ~vtkBiQuadraticTriangle(); 00132 00133 vtkQuadraticEdge *Edge; 00134 vtkTriangle *Face; 00135 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00136 00137 private: 00138 vtkBiQuadraticTriangle(const vtkBiQuadraticTriangle&); // Not implemented. 00139 void operator=(const vtkBiQuadraticTriangle&); // Not implemented. 00140 }; 00141 //---------------------------------------------------------------------------- 00142 inline int vtkBiQuadraticTriangle::GetParametricCenter(double pcoords[3]) 00143 { 00144 pcoords[0] = pcoords[1] = 1./3; 00145 pcoords[2] = 0.0; 00146 return 0; 00147 } 00148 00149 00150 #endif 00151 00152