VTK
dox/Common/DataModel/vtkTriQuadraticHexahedron.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTriQuadraticHexahedron.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 =========================================================================*/
00073 #ifndef __vtkTriQuadraticHexahedron_h
00074 #define __vtkTriQuadraticHexahedron_h
00075 
00076 #include "vtkCommonDataModelModule.h" // For export macro
00077 #include "vtkNonLinearCell.h"
00078 
00079 class vtkQuadraticEdge;
00080 class vtkBiQuadraticQuad;
00081 class vtkHexahedron;
00082 class vtkDoubleArray;
00083 
00084 class VTKCOMMONDATAMODEL_EXPORT vtkTriQuadraticHexahedron : public vtkNonLinearCell
00085 {
00086 public:
00087   static vtkTriQuadraticHexahedron *New ();
00088   vtkTypeMacro(vtkTriQuadraticHexahedron,vtkNonLinearCell);
00089   void PrintSelf (ostream & os, vtkIndent indent);
00090 
00092 
00094   int GetCellType () { return VTK_TRIQUADRATIC_HEXAHEDRON; }
00095   int GetCellDimension () { return 3; }
00096   int GetNumberOfEdges () { return 12; }
00097   int GetNumberOfFaces () { return 6; }
00098   vtkCell *GetEdge (int);
00099   vtkCell *GetFace (int);
00101 
00102   int CellBoundary (int subId, double pcoords[3], vtkIdList * pts);
00103   void Contour (double value, vtkDataArray * cellScalars,
00104     vtkIncrementalPointLocator * locator, vtkCellArray * verts,
00105     vtkCellArray * lines, vtkCellArray * polys,
00106     vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
00107     vtkIdType cellId, vtkCellData * outCd);
00108   int EvaluatePosition (double x[3], double *closestPoint,
00109     int &subId, double pcoords[3], double &dist2, double *weights);
00110   void EvaluateLocation (int &subId, double pcoords[3], double x[3], double *weights);
00111   int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
00112   void Derivatives (int subId, double pcoords[3], double *values, int dim, double *derivs);
00113   virtual double *GetParametricCoords ();
00114 
00116 
00119   void Clip (double value, vtkDataArray * cellScalars,
00120        vtkIncrementalPointLocator * locator, vtkCellArray * tetras,
00121        vtkPointData * inPd, vtkPointData * outPd,
00122        vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd, int insideOut);
00124 
00126 
00128   int IntersectWithLine (double p1[3], double p2[3], double tol, double &t,
00129     double x[3], double pcoords[3], int &subId);
00131 
00134   static void InterpolationFunctions (double pcoords[3], double weights[27]);
00137   static void InterpolationDerivs (double pcoords[3], double derivs[81]);
00139 
00141   virtual void InterpolateFunctions (double pcoords[3], double weights[27])
00142     {
00143     vtkTriQuadraticHexahedron::InterpolationFunctions(pcoords,weights);
00144     }
00145   virtual void InterpolateDerivs (double pcoords[3], double derivs[81])
00146     {
00147     vtkTriQuadraticHexahedron::InterpolationDerivs(pcoords,derivs);
00148     }
00150 
00151 
00153   static int *GetEdgeArray(int edgeId);
00154   static int *GetFaceArray(int faceId);
00156 
00160   void JacobianInverse (double pcoords[3], double **inverse, double derivs[81]);
00161 
00162 protected:
00163   vtkTriQuadraticHexahedron ();
00164   ~vtkTriQuadraticHexahedron ();
00165 
00166   vtkQuadraticEdge *Edge;
00167   vtkBiQuadraticQuad *Face;
00168   vtkHexahedron *Hex;
00169   vtkDoubleArray *Scalars;
00170 
00171 private:
00172   vtkTriQuadraticHexahedron (const vtkTriQuadraticHexahedron &);  // Not implemented.
00173   void operator = (const vtkTriQuadraticHexahedron &);  // Not implemented.
00174 };
00175 
00176 #endif