VTK
dox/Common/DataModel/vtkQuadraticLinearWedge.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadraticLinearWedge.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 =========================================================================*/
00041 #ifndef __vtkQuadraticLinearWedge_h
00042 #define __vtkQuadraticLinearWedge_h
00043 
00044 #include "vtkCommonDataModelModule.h" // For export macro
00045 #include "vtkNonLinearCell.h"
00046 
00047 class vtkQuadraticEdge;
00048 class vtkLine;
00049 class vtkQuadraticLinearQuad;
00050 class vtkQuadraticTriangle;
00051 class vtkWedge;
00052 class vtkDoubleArray;
00053 
00054 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticLinearWedge : public vtkNonLinearCell
00055 {
00056 public:
00057   static vtkQuadraticLinearWedge *New ();
00058   vtkTypeMacro(vtkQuadraticLinearWedge,vtkNonLinearCell);
00059   void PrintSelf (ostream & os, vtkIndent indent);
00060 
00062 
00064   int GetCellType () { return VTK_QUADRATIC_LINEAR_WEDGE; }
00065   int GetCellDimension () { return 3; }
00066   int GetNumberOfEdges () { return 9; }
00067   int GetNumberOfFaces () { return 5; }
00068   vtkCell *GetEdge (int edgeId);
00069   vtkCell *GetFace (int faceId);
00071 
00072   int CellBoundary (int subId, double pcoords[3], vtkIdList * pts);
00073 
00075 
00077   void Contour (double value, vtkDataArray * cellScalars,
00078     vtkIncrementalPointLocator * locator, vtkCellArray * verts,
00079     vtkCellArray * lines, vtkCellArray * polys,
00080     vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
00081     vtkIdType cellId, vtkCellData * outCd);
00082   int EvaluatePosition (double x[3], double *closestPoint,
00083     int &subId, double pcoords[3], double &dist2, double *weights);
00084   void EvaluateLocation (int &subId, double pcoords[3], double x[3], double *weights);
00085   int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
00086   void Derivatives (int subId, double pcoords[3], double *values, int dim, double *derivs);
00087   virtual double *GetParametricCoords ();
00089 
00091 
00094   void Clip (double value, vtkDataArray * cellScalars,
00095        vtkIncrementalPointLocator * locator, vtkCellArray * tetras,
00096        vtkPointData * inPd, vtkPointData * outPd,
00097        vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd, int insideOut);
00099 
00101 
00103   int IntersectWithLine (double p1[3], double p2[3], double tol, double &t,
00104     double x[3], double pcoords[3], int &subId);
00106 
00109   int GetParametricCenter (double pcoords[3]);
00110 
00113   static void InterpolationFunctions (double pcoords[3], double weights[15]);
00116   static void InterpolationDerivs (double pcoords[3], double derivs[45]);
00118 
00120   virtual void InterpolateFunctions (double pcoords[3], double weights[15])
00121     {
00122     vtkQuadraticLinearWedge::InterpolationFunctions(pcoords,weights);
00123     }
00124   virtual void InterpolateDerivs (double pcoords[3], double derivs[45])
00125     {
00126     vtkQuadraticLinearWedge::InterpolationDerivs(pcoords,derivs);
00127     }
00129 
00130 
00132   static int *GetEdgeArray(int edgeId);
00133   static int *GetFaceArray(int faceId);
00135 
00139   void JacobianInverse (double pcoords[3], double **inverse, double derivs[45]);
00140 
00141 protected:
00142   vtkQuadraticLinearWedge ();
00143   ~vtkQuadraticLinearWedge ();
00144 
00145   vtkQuadraticEdge *QuadEdge;
00146   vtkLine *Edge;
00147   vtkQuadraticTriangle *TriangleFace;
00148   vtkQuadraticLinearQuad *Face;
00149   vtkWedge *Wedge;
00150   vtkDoubleArray *Scalars;  //used to avoid New/Delete in contouring/clipping
00151 
00152 private:
00153   vtkQuadraticLinearWedge (const vtkQuadraticLinearWedge &);  // Not implemented.
00154   void operator = (const vtkQuadraticLinearWedge &);  // Not implemented.
00155 };
00156 //----------------------------------------------------------------------------
00157 // Return the center of the quadratic wedge in parametric coordinates.
00158 inline int vtkQuadraticLinearWedge::GetParametricCenter(double pcoords[3])
00159 {
00160   pcoords[0] = pcoords[1] = 1./3;
00161   pcoords[2] = 0.5;
00162   return 0;
00163 }
00164 
00165 
00166 #endif