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 "vtkCommonDataModelModule.h" // For export macro 00044 #include "vtkNonLinearCell.h" 00045 00046 class vtkQuadraticEdge; 00047 class vtkTriangle; 00048 class vtkDoubleArray; 00049 00050 class VTKCOMMONDATAMODEL_EXPORT vtkBiQuadraticTriangle : public vtkNonLinearCell 00051 { 00052 public: 00053 static vtkBiQuadraticTriangle *New(); 00054 vtkTypeMacro(vtkBiQuadraticTriangle,vtkNonLinearCell); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00056 00058 00060 int GetCellType() {return VTK_BIQUADRATIC_TRIANGLE;}; 00061 int GetCellDimension() {return 2;} 00062 int GetNumberOfEdges() {return 3;} 00063 int GetNumberOfFaces() {return 0;} 00064 vtkCell *GetEdge(int edgeId); 00065 vtkCell *GetFace(int) {return 0;} 00067 00068 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00069 void Contour(double value, vtkDataArray *cellScalars, 00070 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00071 vtkCellArray *lines, vtkCellArray *polys, 00072 vtkPointData *inPd, vtkPointData *outPd, 00073 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00074 int EvaluatePosition(double x[3], double* closestPoint, 00075 int& subId, double pcoords[3], 00076 double& dist2, double *weights); 00077 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00078 double *weights); 00079 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00080 void Derivatives(int subId, double pcoords[3], double *values, 00081 int dim, double *derivs); 00082 virtual double *GetParametricCoords(); 00083 00085 00088 void Clip(double value, vtkDataArray *cellScalars, 00089 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00090 vtkPointData *inPd, vtkPointData *outPd, 00091 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00092 int insideOut); 00094 00096 00098 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00099 double x[3], double pcoords[3], int& subId); 00101 00102 00105 int GetParametricCenter(double pcoords[3]); 00106 00109 double GetParametricDistance(double pcoords[3]); 00110 00113 static void InterpolationFunctions(double pcoords[3], double weights[7]); 00116 static void InterpolationDerivs(double pcoords[3], double derivs[14]); 00118 00120 virtual void InterpolateFunctions(double pcoords[3], double weights[7]) 00121 { 00122 vtkBiQuadraticTriangle::InterpolationFunctions(pcoords,weights); 00123 } 00124 virtual void InterpolateDerivs(double pcoords[3], double derivs[14]) 00125 { 00126 vtkBiQuadraticTriangle::InterpolationDerivs(pcoords,derivs); 00127 } 00129 00130 protected: 00131 vtkBiQuadraticTriangle(); 00132 ~vtkBiQuadraticTriangle(); 00133 00134 vtkQuadraticEdge *Edge; 00135 vtkTriangle *Face; 00136 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00137 00138 private: 00139 vtkBiQuadraticTriangle(const vtkBiQuadraticTriangle&); // Not implemented. 00140 void operator=(const vtkBiQuadraticTriangle&); // Not implemented. 00141 }; 00142 //---------------------------------------------------------------------------- 00143 inline int vtkBiQuadraticTriangle::GetParametricCenter(double pcoords[3]) 00144 { 00145 pcoords[0] = pcoords[1] = 1./3; 00146 pcoords[2] = 0.0; 00147 return 0; 00148 } 00149 00150 00151 #endif 00152 00153