Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 =========================================================================*/
00049 #ifndef __vtkQuadraticTriangle_h
00050 #define __vtkQuadraticTriangle_h
00051 
00052 #include "vtkNonLinearCell.h"
00053 
00054 class vtkPolyData;
00055 class vtkQuadraticEdge;
00056 class vtkTriangle;
00057 
00058 class VTK_COMMON_EXPORT vtkQuadraticTriangle : public vtkNonLinearCell
00059 {
00060 public:
00061   static vtkQuadraticTriangle *New();
00062   vtkTypeRevisionMacro(vtkQuadraticTriangle,vtkNonLinearCell);
00063 
00065 
00067   int GetCellType() {return VTK_QUADRATIC_TRIANGLE;};
00068   int GetCellDimension() {return 2;}
00069   int GetNumberOfEdges() {return 3;}
00070   int GetNumberOfFaces() {return 0;}
00071   vtkCell *GetEdge(int edgeId);
00072   vtkCell *GetFace(int) {return 0;}
00074 
00075   int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
00076   void Contour(float value, vtkDataArray *cellScalars, 
00077                vtkPointLocator *locator, vtkCellArray *verts, 
00078                vtkCellArray *lines, vtkCellArray *polys, 
00079                vtkPointData *inPd, vtkPointData *outPd,
00080                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00081   int EvaluatePosition(float x[3], float* closestPoint,
00082                        int& subId, float pcoords[3], 
00083                        float& dist2, float *weights);
00084   void EvaluateLocation(int& subId, float pcoords[3], float x[3],
00085                         float *weights);
00086   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00087   void Derivatives(int subId, float pcoords[3], float *values, 
00088                    int dim, float *derivs);
00089 
00091 
00094   void Clip(float value, vtkDataArray *cellScalars, 
00095             vtkPointLocator *locator, vtkCellArray *polys,
00096             vtkPointData *inPd, vtkPointData *outPd,
00097             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00098             int insideOut);
00100 
00102 
00104   int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00105                         float x[3], float pcoords[3], int& subId);
00107 
00108   
00111   int GetParametricCenter(float pcoords[3]);
00112 
00114 
00115   static void InterpolationFunctions(float pcoords[3], float weights[3]);
00116   static void InterpolationDerivs(float pcoords[3], float derivs[3]);
00118 
00119 protected:
00120   vtkQuadraticTriangle();
00121   ~vtkQuadraticTriangle();
00122 
00123   vtkQuadraticEdge *Edge;
00124   vtkTriangle      *Face;
00125   vtkFloatArray    *Scalars; //used to avoid New/Delete in contouring/clipping
00126 
00127 private:
00128   vtkQuadraticTriangle(const vtkQuadraticTriangle&);  // Not implemented.
00129   void operator=(const vtkQuadraticTriangle&);  // Not implemented.
00130 };
00131 
00132 #endif
00133 
00134