Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Common/vtkQuadraticTriangle.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkQuadraticTriangle.h,v $
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 __vtkQuadraticTriangle_h
00036 #define __vtkQuadraticTriangle_h
00037 
00038 #include "vtkNonLinearCell.h"
00039 
00040 class vtkPolyData;
00041 class vtkQuadraticEdge;
00042 class vtkTriangle;
00043 class vtkDoubleArray;
00044 
00045 class VTK_COMMON_EXPORT vtkQuadraticTriangle : public vtkNonLinearCell
00046 {
00047 public:
00048   static vtkQuadraticTriangle *New();
00049   vtkTypeRevisionMacro(vtkQuadraticTriangle,vtkNonLinearCell);
00050 
00052 
00054   int GetCellType() {return VTK_QUADRATIC_TRIANGLE;};
00055   int GetCellDimension() {return 2;}
00056   int GetNumberOfEdges() {return 3;}
00057   int GetNumberOfFaces() {return 0;}
00058   vtkCell *GetEdge(int edgeId);
00059   vtkCell *GetFace(int) {return 0;}
00061 
00062   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00063   void Contour(double value, vtkDataArray *cellScalars, 
00064                vtkPointLocator *locator, vtkCellArray *verts, 
00065                vtkCellArray *lines, vtkCellArray *polys, 
00066                vtkPointData *inPd, vtkPointData *outPd,
00067                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00068   int EvaluatePosition(double x[3], double* closestPoint,
00069                        int& subId, double pcoords[3], 
00070                        double& dist2, double *weights);
00071   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00072                         double *weights);
00073   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00074   void Derivatives(int subId, double pcoords[3], double *values, 
00075                    int dim, double *derivs);
00076   virtual double *GetParametricCoords();
00077 
00079 
00082   void Clip(double value, vtkDataArray *cellScalars, 
00083             vtkPointLocator *locator, vtkCellArray *polys,
00084             vtkPointData *inPd, vtkPointData *outPd,
00085             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00086             int insideOut);
00088 
00090 
00092   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00093                         double x[3], double pcoords[3], int& subId);
00095 
00096   
00099   int GetParametricCenter(double pcoords[3]);
00100 
00103   double GetParametricDistance(double pcoords[3]);
00104 
00106 
00107   static void InterpolationFunctions(double pcoords[3], double weights[6]);
00108   static void InterpolationDerivs(double pcoords[3], double derivs[12]);
00110 
00111 protected:
00112   vtkQuadraticTriangle();
00113   ~vtkQuadraticTriangle();
00114 
00115   vtkQuadraticEdge *Edge;
00116   vtkTriangle      *Face;
00117   vtkDoubleArray    *Scalars; //used to avoid New/Delete in contouring/clipping
00118 
00119 private:
00120   vtkQuadraticTriangle(const vtkQuadraticTriangle&);  // Not implemented.
00121   void operator=(const vtkQuadraticTriangle&);  // Not implemented.
00122 };
00123 
00124 #endif
00125 
00126