VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQuadraticQuad.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 =========================================================================*/ 00035 #ifndef vtkQuadraticQuad_h 00036 #define vtkQuadraticQuad_h 00037 00038 #include "vtkCommonDataModelModule.h" // For export macro 00039 #include "vtkNonLinearCell.h" 00040 00041 class vtkQuadraticEdge; 00042 class vtkQuad; 00043 class vtkDoubleArray; 00044 00045 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticQuad : public vtkNonLinearCell 00046 { 00047 public: 00048 static vtkQuadraticQuad *New(); 00049 vtkTypeMacro(vtkQuadraticQuad,vtkNonLinearCell); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00055 int GetCellType() {return VTK_QUADRATIC_QUAD;}; 00056 int GetCellDimension() {return 2;} 00057 int GetNumberOfEdges() {return 4;} 00058 int GetNumberOfFaces() {return 0;} 00059 vtkCell *GetEdge(int); 00060 vtkCell *GetFace(int) {return 0;} 00062 00063 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00064 void Contour(double value, vtkDataArray *cellScalars, 00065 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00066 vtkCellArray *lines, vtkCellArray *polys, 00067 vtkPointData *inPd, vtkPointData *outPd, 00068 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00069 int EvaluatePosition(double x[3], double* closestPoint, 00070 int& subId, double pcoords[3], 00071 double& dist2, double *weights); 00072 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00073 double *weights); 00074 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00075 void Derivatives(int subId, double pcoords[3], double *values, 00076 int dim, double *derivs); 00077 virtual double *GetParametricCoords(); 00078 00080 00082 void Clip(double value, vtkDataArray *cellScalars, 00083 vtkIncrementalPointLocator *locator, vtkCellArray *polys, 00084 vtkPointData *inPd, vtkPointData *outPd, 00085 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00086 int insideOut); 00088 00090 00092 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00093 double x[3], double pcoords[3], int& subId); 00095 00096 00098 int GetParametricCenter(double pcoords[3]); 00099 00102 static void InterpolationFunctions(double pcoords[3], double weights[8]); 00105 static void InterpolationDerivs(double pcoords[3], double derivs[16]); 00107 00109 virtual void InterpolateFunctions(double pcoords[3], double weights[8]) 00110 { 00111 vtkQuadraticQuad::InterpolationFunctions(pcoords,weights); 00112 } 00113 virtual void InterpolateDerivs(double pcoords[3], double derivs[16]) 00114 { 00115 vtkQuadraticQuad::InterpolationDerivs(pcoords,derivs); 00116 } 00118 00119 protected: 00120 vtkQuadraticQuad(); 00121 ~vtkQuadraticQuad(); 00122 00123 vtkQuadraticEdge *Edge; 00124 vtkQuad *Quad; 00125 vtkPointData *PointData; 00126 vtkDoubleArray *Scalars; 00127 00128 // In order to achieve some functionality we introduce a fake center point 00129 // which require to have some extra functionalities compare to other non-linar 00130 // cells 00131 vtkCellData *CellData; 00132 vtkDoubleArray *CellScalars; 00133 void Subdivide(double *weights); 00134 void InterpolateAttributes(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId, 00135 vtkDataArray *cellScalars); 00136 00137 private: 00138 vtkQuadraticQuad(const vtkQuadraticQuad&); // Not implemented. 00139 void operator=(const vtkQuadraticQuad&); // Not implemented. 00140 }; 00141 //---------------------------------------------------------------------------- 00142 inline int vtkQuadraticQuad::GetParametricCenter(double pcoords[3]) 00143 { 00144 pcoords[0] = pcoords[1] = 0.5; 00145 pcoords[2] = 0.; 00146 return 0; 00147 } 00148 00149 #endif 00150 00151