VTK
dox/Common/DataModel/vtkQuadraticHexahedron.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadraticHexahedron.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 =========================================================================*/
00036 #ifndef __vtkQuadraticHexahedron_h
00037 #define __vtkQuadraticHexahedron_h
00038 
00039 #include "vtkCommonDataModelModule.h" // For export macro
00040 #include "vtkNonLinearCell.h"
00041 
00042 class vtkQuadraticEdge;
00043 class vtkQuadraticQuad;
00044 class vtkHexahedron;
00045 class vtkDoubleArray;
00046 
00047 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticHexahedron : public vtkNonLinearCell
00048 {
00049 public:
00050   static vtkQuadraticHexahedron *New();
00051   vtkTypeMacro(vtkQuadraticHexahedron,vtkNonLinearCell);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055 
00057   int GetCellType() {return VTK_QUADRATIC_HEXAHEDRON;}
00058   int GetCellDimension() {return 3;}
00059   int GetNumberOfEdges() {return 12;}
00060   int GetNumberOfFaces() {return 6;}
00061   vtkCell *GetEdge(int);
00062   vtkCell *GetFace(int);
00064 
00065   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00066   void Contour(double value, vtkDataArray *cellScalars,
00067                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00068                vtkCellArray *lines, vtkCellArray *polys,
00069                vtkPointData *inPd, vtkPointData *outPd,
00070                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
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 
00082 
00085   void Clip(double value, vtkDataArray *cellScalars,
00086             vtkIncrementalPointLocator *locator, vtkCellArray *tetras,
00087             vtkPointData *inPd, vtkPointData *outPd,
00088             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00089             int insideOut);
00091 
00093 
00095   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00096                         double x[3], double pcoords[3], int& subId);
00098 
00099 
00102   static void InterpolationFunctions(double pcoords[3], double weights[20]);
00105   static void InterpolationDerivs(double pcoords[3], double derivs[60]);
00107 
00109   virtual void InterpolateFunctions(double pcoords[3], double weights[20])
00110     {
00111     vtkQuadraticHexahedron::InterpolationFunctions(pcoords,weights);
00112     }
00113   virtual void InterpolateDerivs(double pcoords[3], double derivs[60])
00114     {
00115     vtkQuadraticHexahedron::InterpolationDerivs(pcoords,derivs);
00116     }
00118 
00119 
00121   static int *GetEdgeArray(int edgeId);
00122   static int *GetFaceArray(int faceId);
00124 
00128   void JacobianInverse(double pcoords[3], double **inverse, double derivs[60]);
00129 
00130 protected:
00131   vtkQuadraticHexahedron();
00132   ~vtkQuadraticHexahedron();
00133 
00134   vtkQuadraticEdge *Edge;
00135   vtkQuadraticQuad *Face;
00136   vtkHexahedron    *Hex;
00137   vtkPointData     *PointData;
00138   vtkCellData      *CellData;
00139   vtkDoubleArray   *CellScalars;
00140   vtkDoubleArray   *Scalars;
00141 
00142   void Subdivide(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId,
00143     vtkDataArray *cellScalars);
00144 
00145 private:
00146   vtkQuadraticHexahedron(const vtkQuadraticHexahedron&);  // Not implemented.
00147   void operator=(const vtkQuadraticHexahedron&);  // Not implemented.
00148 };
00149 
00150 #endif
00151 
00152