VTK
dox/Common/DataModel/vtkQuad.h
Go to the documentation of this file.
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 "vtkCommonDataModelModule.h" // For export macro
00034 #include "vtkCell.h"
00035 
00036 class vtkLine;
00037 class vtkTriangle;
00038 class vtkIncrementalPointLocator;
00039 
00040 class VTKCOMMONDATAMODEL_EXPORT vtkQuad : public vtkCell
00041 {
00042 public:
00043   static vtkQuad *New();
00044   vtkTypeMacro(vtkQuad,vtkCell);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00049   int GetCellType() {return VTK_QUAD;};
00050   int GetCellDimension() {return 2;};
00051   int GetNumberOfEdges() {return 4;};
00052   int GetNumberOfFaces() {return 0;};
00053   vtkCell *GetEdge(int edgeId);
00054   vtkCell *GetFace(int) {return 0;};
00055   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00056   void Contour(double value, vtkDataArray *cellScalars,
00057                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00058                vtkCellArray *lines, vtkCellArray *polys,
00059                vtkPointData *inPd, vtkPointData *outPd,
00060                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00061   int EvaluatePosition(double x[3], double* closestPoint,
00062                        int& subId, double pcoords[3],
00063                        double& dist2, double *weights);
00064   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00065                         double *weights);
00066   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00067                         double x[3], double pcoords[3], int& subId);
00068   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00069   void Derivatives(int subId, double pcoords[3], double *values,
00070                    int dim, double *derivs);
00071   virtual double *GetParametricCoords();
00073 
00075   int GetParametricCenter(double pcoords[3]);
00076 
00078 
00080   void Clip(double value, vtkDataArray *cellScalars,
00081             vtkIncrementalPointLocator *locator, vtkCellArray *polys,
00082             vtkPointData *inPd, vtkPointData *outPd,
00083             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00084             int insideOut);
00086 
00088   static void InterpolationFunctions(double pcoords[3], double sf[4]);
00090   static void InterpolationDerivs(double pcoords[3], double derivs[8]);
00092 
00094   virtual void InterpolateFunctions(double pcoords[3], double sf[4])
00095     {
00096     vtkQuad::InterpolationFunctions(pcoords,sf);
00097     }
00098   virtual void InterpolateDerivs(double pcoords[3], double derivs[8])
00099     {
00100     vtkQuad::InterpolationDerivs(pcoords,derivs);
00101     }
00103 
00106   int *GetEdgeArray(int edgeId);
00107 
00108 protected:
00109   vtkQuad();
00110   ~vtkQuad();
00111 
00112   vtkLine     *Line;
00113   vtkTriangle *Triangle;
00114 
00115 private:
00116   vtkQuad(const vtkQuad&);  // Not implemented.
00117   void operator=(const vtkQuad&);  // Not implemented.
00118 };
00119 //----------------------------------------------------------------------------
00120 inline int vtkQuad::GetParametricCenter(double pcoords[3])
00121 {
00122   pcoords[0] = pcoords[1] = 0.5;
00123   pcoords[2] = 0.0;
00124   return 0;
00125 }
00126 
00127 
00128 #endif
00129 
00130