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 static void InterpolationFunctions(double pcoords[3], double sf[4]); 00089 static void InterpolationDerivs(double pcoords[3], double derivs[8]); 00091 00093 virtual void InterpolateFunctions(double pcoords[3], double sf[4]) 00094 { 00095 vtkQuad::InterpolationFunctions(pcoords,sf); 00096 } 00097 virtual void InterpolateDerivs(double pcoords[3], double derivs[8]) 00098 { 00099 vtkQuad::InterpolationDerivs(pcoords,derivs); 00100 } 00102 00105 int *GetEdgeArray(int edgeId); 00106 00107 protected: 00108 vtkQuad(); 00109 ~vtkQuad(); 00110 00111 vtkLine *Line; 00112 vtkTriangle *Triangle; 00113 00114 private: 00115 vtkQuad(const vtkQuad&); // Not implemented. 00116 void operator=(const vtkQuad&); // Not implemented. 00117 }; 00118 //---------------------------------------------------------------------------- 00119 inline int vtkQuad::GetParametricCenter(double pcoords[3]) 00120 { 00121 pcoords[0] = pcoords[1] = 0.5; 00122 pcoords[2] = 0.0; 00123 return 0; 00124 } 00125 00126 00127 #endif 00128 00129