VTK
dox/Filtering/vtkBiQuadraticQuadraticWedge.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBiQuadraticQuadraticWedge.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 =========================================================================*/
00043 #ifndef __vtkBiQuadraticQuadraticWedge_h
00044 #define __vtkBiQuadraticQuadraticWedge_h
00045 
00046 #include "vtkNonLinearCell.h"
00047 
00048 class vtkQuadraticEdge;
00049 class vtkBiQuadraticQuad;
00050 class vtkQuadraticTriangle;
00051 class vtkWedge;
00052 class vtkDoubleArray;
00053 
00054 class VTK_FILTERING_EXPORT vtkBiQuadraticQuadraticWedge : public vtkNonLinearCell
00055 {
00056 public:
00057   static vtkBiQuadraticQuadraticWedge *New ();
00058   vtkTypeMacro(vtkBiQuadraticQuadraticWedge,vtkNonLinearCell);
00059   void PrintSelf (ostream & os, vtkIndent indent);
00060 
00062 
00064   int GetCellType () { return VTK_BIQUADRATIC_QUADRATIC_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   void Contour (double value, vtkDataArray * cellScalars,
00074     vtkIncrementalPointLocator * locator, vtkCellArray * verts,
00075     vtkCellArray * lines, vtkCellArray * polys,
00076     vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
00077     vtkIdType cellId, vtkCellData * outCd);
00078   int EvaluatePosition (double x[3], double *closestPoint,
00079       int &subId, double pcoords[3], double &dist2, double *weights);
00080   void EvaluateLocation (int &subId, double pcoords[3], double x[3],
00081     double *weights);
00082   int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
00083   void Derivatives (int subId, double pcoords[3], double *values, int dim,
00084     double *derivs);
00085   virtual double *GetParametricCoords ();
00086 
00088 
00091   void Clip (double value, vtkDataArray * cellScalars,
00092        vtkIncrementalPointLocator * locator, vtkCellArray * tetras,
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 
00105 
00107   int GetParametricCenter (double pcoords[3]);
00108 
00111   static void InterpolationFunctions (double pcoords[3], double weights[15]);
00114   static void InterpolationDerivs (double pcoords[3], double derivs[45]);
00116 
00118   virtual void InterpolateFunctions (double pcoords[3], double weights[15])
00119     {
00120     vtkBiQuadraticQuadraticWedge::InterpolationFunctions(pcoords,weights);
00121     }
00122   virtual void InterpolateDerivs (double pcoords[3], double derivs[45])
00123     {
00124     vtkBiQuadraticQuadraticWedge::InterpolationDerivs(pcoords,derivs);
00125     }
00127 
00128 
00130   static int *GetEdgeArray(int edgeId);
00131   static int *GetFaceArray(int faceId);
00133 
00137   void JacobianInverse (double pcoords[3], double **inverse, double derivs[45]);
00138 
00139 protected:
00140   vtkBiQuadraticQuadraticWedge ();
00141   ~vtkBiQuadraticQuadraticWedge ();
00142 
00143   vtkQuadraticEdge *Edge;
00144   vtkQuadraticTriangle *TriangleFace;
00145   vtkBiQuadraticQuad *Face;
00146   vtkWedge *Wedge;
00147   vtkDoubleArray *Scalars;  //used to avoid New/Delete in contouring/clipping
00148 
00149 private:
00150   vtkBiQuadraticQuadraticWedge (const vtkBiQuadraticQuadraticWedge &);  // Not implemented.
00151   void operator = (const vtkBiQuadraticQuadraticWedge &);  // Not implemented.
00152 };
00153 //----------------------------------------------------------------------------
00154 // Return the center of the quadratic wedge in parametric coordinates.
00155 inline int vtkBiQuadraticQuadraticWedge::GetParametricCenter(double pcoords[3])
00156 {
00157   pcoords[0] = pcoords[1] = 1./3;
00158   pcoords[2] = 0.5;
00159   return 0;
00160 }
00161 
00162 
00163 #endif