VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQuadraticLinearQuad.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 =========================================================================*/ 00038 #ifndef __vtkQuadraticLinearQuad_h 00039 #define __vtkQuadraticLinearQuad_h 00040 00041 #include "vtkNonLinearCell.h" 00042 00043 class vtkQuadraticEdge; 00044 class vtkLine; 00045 class vtkQuad; 00046 class vtkDoubleArray; 00047 00048 class VTK_FILTERING_EXPORT vtkQuadraticLinearQuad : public vtkNonLinearCell 00049 { 00050 public: 00051 static vtkQuadraticLinearQuad *New(); 00052 vtkTypeMacro(vtkQuadraticLinearQuad, vtkNonLinearCell); 00053 void PrintSelf(ostream & os, vtkIndent indent); 00054 00056 00058 int GetCellType () { return VTK_QUADRATIC_LINEAR_QUAD; }; 00059 int GetCellDimension () { return 2; } 00060 int GetNumberOfEdges () { return 4; } 00061 int GetNumberOfFaces () { return 0; } 00062 vtkCell *GetEdge (int); 00063 vtkCell *GetFace (int) { return 0; } 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, vtkCellData * inCd, 00071 vtkIdType cellId, vtkCellData * outCd); 00072 int EvaluatePosition (double x[3], double *closestPoint, 00073 int &subId, double pcoords[3], double &dist2, double *weights); 00074 void EvaluateLocation (int &subId, double pcoords[3], double x[3], 00075 double *weights); 00076 int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts); 00077 void Derivatives (int subId, double pcoords[3], double *values, int dim, 00078 double *derivs); 00079 virtual double *GetParametricCoords (); 00080 00082 00084 void Clip (double value, vtkDataArray * cellScalars, 00085 vtkIncrementalPointLocator * locator, vtkCellArray * polys, 00086 vtkPointData * inPd, vtkPointData * outPd, 00087 vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd, 00088 int insideOut); 00090 00092 00094 int IntersectWithLine (double p1[3], double p2[3], double tol, double &t, 00095 double x[3], double pcoords[3], int &subId); 00097 00099 int GetParametricCenter(double pcoords[3]); 00100 00103 static void InterpolationFunctions (double pcoords[3], double weights[6]); 00106 static void InterpolationDerivs (double pcoords[3], double derivs[12]); 00108 00110 virtual void InterpolateFunctions (double pcoords[3], double weights[6]) 00111 { 00112 vtkQuadraticLinearQuad::InterpolationFunctions(pcoords,weights); 00113 } 00114 virtual void InterpolateDerivs (double pcoords[3], double derivs[12]) 00115 { 00116 vtkQuadraticLinearQuad::InterpolationDerivs(pcoords,derivs); 00117 } 00119 00121 static int *GetEdgeArray(int edgeId); 00122 00123 protected: 00124 vtkQuadraticLinearQuad (); 00125 ~vtkQuadraticLinearQuad (); 00126 00127 vtkQuadraticEdge *Edge; 00128 vtkLine *LinEdge; 00129 vtkQuad *Quad; 00130 vtkDoubleArray *Scalars; 00131 00132 private: 00133 vtkQuadraticLinearQuad (const vtkQuadraticLinearQuad &); // Not implemented. 00134 void operator = (const vtkQuadraticLinearQuad &); // Not implemented. 00135 }; 00136 //---------------------------------------------------------------------------- 00137 inline int vtkQuadraticLinearQuad::GetParametricCenter(double pcoords[3]) 00138 { 00139 pcoords[0] = pcoords[1] = 0.5; 00140 pcoords[2] = 0.; 00141 return 0; 00142 } 00143 00144 #endif