VTK
dox/Common/DataModel/vtkBiQuadraticQuad.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBiQuadraticQuad.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 =========================================================================*/
00042 #ifndef __vtkBiQuadraticQuad_h
00043 #define __vtkBiQuadraticQuad_h
00044 
00045 #include "vtkCommonDataModelModule.h" // For export macro
00046 #include "vtkNonLinearCell.h"
00047 
00048 class vtkQuadraticEdge;
00049 class vtkQuad;
00050 class vtkTriangle;
00051 class vtkDoubleArray;
00052 
00053 class VTKCOMMONDATAMODEL_EXPORT vtkBiQuadraticQuad : public vtkNonLinearCell
00054 {
00055 public:
00056   static vtkBiQuadraticQuad *New ();
00057   vtkTypeMacro(vtkBiQuadraticQuad,vtkNonLinearCell);
00058   void PrintSelf (ostream & os, vtkIndent indent);
00059 
00061 
00063   int GetCellType () { return VTK_BIQUADRATIC_QUAD; }
00064   int GetCellDimension () { return 2; }
00065   int GetNumberOfEdges () { return 4; }
00066   int GetNumberOfFaces () { return 0; }
00067   vtkCell *GetEdge (int);
00068   vtkCell *GetFace (int) { return 0; }
00070 
00071   int CellBoundary (int subId, double pcoords[3], vtkIdList * pts);
00072   int EvaluatePosition (double x[3], double *closestPoint,
00073                         int &subId, double pcoords[3],
00074                         double &dist2, double *weights);
00075   void EvaluateLocation (int &subId, double pcoords[3], double x[3],
00076                          double *weights);
00077   int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
00078   void Derivatives (int subId, double pcoords[3], double *values,
00079                     int dim, double *derivs);
00080   virtual double *GetParametricCoords();
00081 
00082   void Contour (double value, vtkDataArray * cellScalars,
00083                 vtkIncrementalPointLocator * locator, vtkCellArray * verts,
00084                 vtkCellArray * lines, vtkCellArray * polys,
00085                 vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
00086                 vtkIdType cellId, vtkCellData * outCd);
00087 
00089 
00092   void Clip (double value, vtkDataArray * cellScalars,
00093              vtkIncrementalPointLocator * locator, vtkCellArray * polys,
00094              vtkPointData * inPd, vtkPointData * outPd,
00095              vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd,
00096              int insideOut);
00098 
00100 
00102   int IntersectWithLine (double p1[3], double p2[3], double tol, double &t,
00103                          double x[3], double pcoords[3], int &subId);
00105 
00107   int GetParametricCenter(double pcoords[3]);
00108 
00111   static void InterpolationFunctions (double pcoords[3], double weights[9]);
00114   static void InterpolationDerivs (double pcoords[3], double derivs[18]);
00116 
00118   virtual void InterpolateFunctions (double pcoords[3], double weights[9])
00119     {
00120     vtkBiQuadraticQuad::InterpolationFunctions(pcoords,weights);
00121     }
00122   virtual void InterpolateDerivs (double pcoords[3], double derivs[18])
00123     {
00124     vtkBiQuadraticQuad::InterpolationDerivs(pcoords,derivs);
00125     }
00127 
00128 protected:
00129   vtkBiQuadraticQuad();
00130   ~vtkBiQuadraticQuad();
00131 
00132   vtkQuadraticEdge *Edge;
00133   vtkQuad          *Quad;
00134   vtkTriangle      *Triangle;
00135   vtkDoubleArray   *Scalars;
00136 
00137 private:
00138   vtkBiQuadraticQuad(const vtkBiQuadraticQuad&);  // Not implemented.
00139   void operator=(const vtkBiQuadraticQuad&);  // Not implemented.
00140 };
00141 //----------------------------------------------------------------------------
00142 inline int vtkBiQuadraticQuad::GetParametricCenter(double pcoords[3])
00143 {
00144   pcoords[0] = pcoords[1] = 0.5;
00145   pcoords[2] = 0.;
00146   return 0;
00147 }
00148 
00149 #endif