VTK
dox/Filtering/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 "vtkNonLinearCell.h"
00046 
00047 class vtkQuadraticEdge;
00048 class vtkQuad;
00049 class vtkTriangle;
00050 class vtkDoubleArray;
00051 
00052 class VTK_FILTERING_EXPORT vtkBiQuadraticQuad : public vtkNonLinearCell
00053 {
00054 public:
00055   static vtkBiQuadraticQuad *New ();
00056   vtkTypeMacro(vtkBiQuadraticQuad,vtkNonLinearCell);
00057   void PrintSelf (ostream & os, vtkIndent indent);
00058 
00060 
00062   int GetCellType () { return VTK_BIQUADRATIC_QUAD; }
00063   int GetCellDimension () { return 2; }
00064   int GetNumberOfEdges () { return 4; }
00065   int GetNumberOfFaces () { return 0; }
00066   vtkCell *GetEdge (int);
00067   vtkCell *GetFace (int) { return 0; }
00069 
00070   int CellBoundary (int subId, double pcoords[3], vtkIdList * pts);
00071   int EvaluatePosition (double x[3], double *closestPoint,
00072                         int &subId, double pcoords[3],
00073                         double &dist2, double *weights);
00074   void EvaluateLocation (int &subId, double pcoords[3], double x[3],
00075                          double *weights);
00076   int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
00077   void Derivatives (int subId, double pcoords[3], double *values,
00078                     int dim, double *derivs);
00079   virtual double *GetParametricCoords();
00080 
00081   void Contour (double value, vtkDataArray * cellScalars,
00082                 vtkIncrementalPointLocator * locator, vtkCellArray * verts,
00083                 vtkCellArray * lines, vtkCellArray * polys,
00084                 vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
00085                 vtkIdType cellId, vtkCellData * outCd);
00086 
00088 
00091   void Clip (double value, vtkDataArray * cellScalars,
00092              vtkIncrementalPointLocator * locator, vtkCellArray * polys,
00093              vtkPointData * inPd, vtkPointData * outPd,
00094              vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd,
00095              int insideOut);
00097 
00099 
00101   int IntersectWithLine (double p1[3], double p2[3], double tol, double &t,
00102                          double x[3], double pcoords[3], int &subId);
00104 
00106   int GetParametricCenter(double pcoords[3]);
00107 
00110   static void InterpolationFunctions (double pcoords[3], double weights[9]);
00113   static void InterpolationDerivs (double pcoords[3], double derivs[18]);
00115 
00117   virtual void InterpolateFunctions (double pcoords[3], double weights[9])
00118     {
00119     vtkBiQuadraticQuad::InterpolationFunctions(pcoords,weights);
00120     }
00121   virtual void InterpolateDerivs (double pcoords[3], double derivs[18])
00122     {
00123     vtkBiQuadraticQuad::InterpolationDerivs(pcoords,derivs);
00124     }
00126 
00127 protected:
00128   vtkBiQuadraticQuad();
00129   ~vtkBiQuadraticQuad();
00130 
00131   vtkQuadraticEdge *Edge;
00132   vtkQuad          *Quad;
00133   vtkTriangle      *Triangle;
00134   vtkDoubleArray   *Scalars;
00135 
00136 private:
00137   vtkBiQuadraticQuad(const vtkBiQuadraticQuad&);  // Not implemented.
00138   void operator=(const vtkBiQuadraticQuad&);  // Not implemented.
00139 };
00140 //----------------------------------------------------------------------------
00141 inline int vtkBiQuadraticQuad::GetParametricCenter(double pcoords[3])
00142 {
00143   pcoords[0] = pcoords[1] = 0.5;
00144   pcoords[2] = 0.;
00145   return 0;
00146 }
00147 
00148 #endif