VTK
dox/Common/DataModel/vtkQuadraticTetra.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadraticTetra.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 =========================================================================*/
00035 #ifndef __vtkQuadraticTetra_h
00036 #define __vtkQuadraticTetra_h
00037 
00038 #include "vtkCommonDataModelModule.h" // For export macro
00039 #include "vtkNonLinearCell.h"
00040 
00041 class vtkQuadraticEdge;
00042 class vtkQuadraticTriangle;
00043 class vtkTetra;
00044 class vtkDoubleArray;
00045 
00046 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticTetra : public vtkNonLinearCell
00047 {
00048 public:
00049   static vtkQuadraticTetra *New();
00050   vtkTypeMacro(vtkQuadraticTetra,vtkNonLinearCell);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054 
00056   int GetCellType() {return VTK_QUADRATIC_TETRA;}
00057   int GetCellDimension() {return 3;}
00058   int GetNumberOfEdges() {return 6;}
00059   int GetNumberOfFaces() {return 4;}
00060   vtkCell *GetEdge(int);
00061   vtkCell *GetFace(int);
00063 
00064   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00065   void Contour(double value, vtkDataArray *cellScalars,
00066                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00067                vtkCellArray *lines, vtkCellArray *polys,
00068                vtkPointData *inPd, vtkPointData *outPd,
00069                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00070   int EvaluatePosition(double x[3], double* closestPoint,
00071                        int& subId, double pcoords[3],
00072                        double& dist2, double *weights);
00073   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00074                         double *weights);
00075   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00076   void Derivatives(int subId, double pcoords[3], double *values,
00077                    int dim, double *derivs);
00078   virtual double *GetParametricCoords();
00079 
00081 
00083   void Clip(double value, vtkDataArray *cellScalars,
00084             vtkIncrementalPointLocator *locator, vtkCellArray *tetras,
00085             vtkPointData *inPd, vtkPointData *outPd,
00086             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00087             int insideOut);
00089 
00091 
00093   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00094                         double x[3], double pcoords[3], int& subId);
00096 
00097 
00099   int GetParametricCenter(double pcoords[3]);
00100 
00103   double GetParametricDistance(double pcoords[3]);
00104 
00107   static void InterpolationFunctions(double pcoords[3], double weights[10]);
00110   static void InterpolationDerivs(double pcoords[3], double derivs[30]);
00112 
00114   virtual void InterpolateFunctions(double pcoords[3], double weights[10])
00115     {
00116     vtkQuadraticTetra::InterpolationFunctions(pcoords,weights);
00117     }
00118   virtual void InterpolateDerivs(double pcoords[3], double derivs[30])
00119     {
00120     vtkQuadraticTetra::InterpolationDerivs(pcoords,derivs);
00121     }
00123 
00124 
00126   static int *GetEdgeArray(int edgeId);
00127   static int *GetFaceArray(int faceId);
00129 
00133   void JacobianInverse(double pcoords[3], double **inverse, double derivs[30]);
00134 
00135 protected:
00136   vtkQuadraticTetra();
00137   ~vtkQuadraticTetra();
00138 
00139   vtkQuadraticEdge *Edge;
00140   vtkQuadraticTriangle *Face;
00141   vtkTetra *Tetra;
00142   vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
00143 
00144 private:
00145   vtkQuadraticTetra(const vtkQuadraticTetra&);  // Not implemented.
00146   void operator=(const vtkQuadraticTetra&);  // Not implemented.
00147 };
00148 
00149 #endif
00150 
00151