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   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00050 #ifndef __vtkQuadraticTriangle_h
00051 #define __vtkQuadraticTriangle_h
00052 
00053 #include "vtkNonLinearCell.h"
00054 
00055 class vtkPolyData;
00056 class vtkQuadraticEdge;
00057 class vtkTriangle;
00058 
00059 class VTK_COMMON_EXPORT vtkQuadraticTriangle : public vtkNonLinearCell
00060 {
00061 public:
00062   static vtkQuadraticTriangle *New();
00063   vtkTypeRevisionMacro(vtkQuadraticTriangle,vtkNonLinearCell);
00064 
00066 
00068   int GetCellType() {return VTK_QUADRATIC_TRIANGLE;};
00069   int GetCellDimension() {return 2;}
00070   int GetNumberOfEdges() {return 3;}
00071   int GetNumberOfFaces() {return 0;}
00072   vtkCell *GetEdge(int edgeId);
00073   vtkCell *GetFace(int) {return 0;}
00075 
00076   int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
00077   void Contour(float value, vtkDataArray *cellScalars, 
00078                vtkPointLocator *locator, vtkCellArray *verts, 
00079                vtkCellArray *lines, vtkCellArray *polys, 
00080                vtkPointData *inPd, vtkPointData *outPd,
00081                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00082   int EvaluatePosition(float x[3], float* closestPoint,
00083                        int& subId, float pcoords[3], 
00084                        float& dist2, float *weights);
00085   void EvaluateLocation(int& subId, float pcoords[3], float x[3],
00086                         float *weights);
00087   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00088   void Derivatives(int subId, float pcoords[3], float *values, 
00089                    int dim, float *derivs);
00090 
00092 
00095   void Clip(float value, vtkDataArray *cellScalars, 
00096             vtkPointLocator *locator, vtkCellArray *polys,
00097             vtkPointData *inPd, vtkPointData *outPd,
00098             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00099             int insideOut);
00101 
00103 
00105   int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00106                         float x[3], float pcoords[3], int& subId);
00108 
00109   
00112   int GetParametricCenter(float pcoords[3]);
00113 
00115 
00116   static void InterpolationFunctions(float pcoords[3], float weights[3]);
00117   static void InterpolationDerivs(float pcoords[3], float derivs[3]);
00119 
00120 protected:
00121   vtkQuadraticTriangle();
00122   ~vtkQuadraticTriangle();
00123 
00124   vtkQuadraticEdge *Edge;
00125   vtkTriangle      *Face;
00126   vtkFloatArray    *Scalars; //used to avoid New/Delete in contouring/clipping
00127 
00128 private:
00129   vtkQuadraticTriangle(const vtkQuadraticTriangle&);  // Not implemented.
00130   void operator=(const vtkQuadraticTriangle&);  // Not implemented.
00131 };
00132 
00133 #endif
00134 
00135