VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQuad.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 =========================================================================*/ 00030 #ifndef __vtkQuad_h 00031 #define __vtkQuad_h 00032 00033 #include "vtkCell.h" 00034 00035 class vtkLine; 00036 class vtkTriangle; 00037 class vtkIncrementalPointLocator; 00038 00039 class VTK_FILTERING_EXPORT vtkQuad : public vtkCell 00040 { 00041 public: 00042 static vtkQuad *New(); 00043 vtkTypeMacro(vtkQuad,vtkCell); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 00048 int GetCellType() {return VTK_QUAD;}; 00049 int GetCellDimension() {return 2;}; 00050 int GetNumberOfEdges() {return 4;}; 00051 int GetNumberOfFaces() {return 0;}; 00052 vtkCell *GetEdge(int edgeId); 00053 vtkCell *GetFace(int) {return 0;}; 00054 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00055 void Contour(double value, vtkDataArray *cellScalars, 00056 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00057 vtkCellArray *lines, vtkCellArray *polys, 00058 vtkPointData *inPd, vtkPointData *outPd, 00059 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00060 int EvaluatePosition(double x[3], double* closestPoint, 00061 int& subId, double pcoords[3], 00062 double& dist2, double *weights); 00063 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00064 double *weights); 00065 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00066 double x[3], double pcoords[3], int& subId); 00067 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00068 void Derivatives(int subId, double pcoords[3], double *values, 00069 int dim, double *derivs); 00070 virtual double *GetParametricCoords(); 00072 00074 int GetParametricCenter(double pcoords[3]); 00075 00077 00079 void Clip(double value, vtkDataArray *cellScalars, 00080 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00081 vtkPointData *inPd, vtkPointData *outPd, 00082 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00083 int insideOut); 00085 00087 00088 static void InterpolationFunctions(double pcoords[3], double sf[4]); 00089 // Description: 00090 // @deprecated Replaced by vtkQuad::InterpolateDerivs as of VTK 5.2 00091 static void InterpolationDerivs(double pcoords[3], double derivs[8]); 00092 // Description: 00093 // Compute the interpolation functions/derivatives 00094 // (aka shape functions/derivatives) 00095 virtual void InterpolateFunctions(double pcoords[3], double sf[4]) 00096 { 00097 vtkQuad::InterpolationFunctions(pcoords,sf); 00098 } 00099 virtual void InterpolateDerivs(double pcoords[3], double derivs[8]) 00100 { 00101 vtkQuad::InterpolationDerivs(pcoords,derivs); 00102 } 00104 00107 int *GetEdgeArray(int edgeId); 00108 00109 protected: 00110 vtkQuad(); 00111 ~vtkQuad(); 00112 00113 vtkLine *Line; 00114 vtkTriangle *Triangle; 00115 00116 private: 00117 vtkQuad(const vtkQuad&); // Not implemented. 00118 void operator=(const vtkQuad&); // Not implemented. 00119 }; 00120 //---------------------------------------------------------------------------- 00121 inline int vtkQuad::GetParametricCenter(double pcoords[3]) 00122 { 00123 pcoords[0] = pcoords[1] = 0.5; 00124 pcoords[2] = 0.0; 00125 return 0; 00126 } 00127 00128 00129 #endif 00130 00131