VTK
dox/Common/DataModel/vtkQuadraticEdge.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadraticEdge.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 =========================================================================*/
00033 #ifndef __vtkQuadraticEdge_h
00034 #define __vtkQuadraticEdge_h
00035 
00036 #include "vtkCommonDataModelModule.h" // For export macro
00037 #include "vtkNonLinearCell.h"
00038 
00039 class vtkLine;
00040 class vtkDoubleArray;
00041 
00042 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticEdge : public vtkNonLinearCell
00043 {
00044 public:
00045   static vtkQuadraticEdge *New();
00046   vtkTypeMacro(vtkQuadraticEdge,vtkNonLinearCell);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048 
00050 
00052   int GetCellType() {return VTK_QUADRATIC_EDGE;};
00053   int GetCellDimension() {return 1;}
00054   int GetNumberOfEdges() {return 0;}
00055   int GetNumberOfFaces() {return 0;}
00056   vtkCell *GetEdge(int) {return 0;}
00057   vtkCell *GetFace(int) {return 0;}
00059 
00060   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00061   void Contour(double value, vtkDataArray *cellScalars,
00062                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00063                vtkCellArray *lines, vtkCellArray *polys,
00064                vtkPointData *inPd, vtkPointData *outPd,
00065                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00066   int EvaluatePosition(double x[3], double* closestPoint,
00067                        int& subId, double pcoords[3],
00068                        double& dist2, double *weights);
00069   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00070                         double *weights);
00071   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00072   void Derivatives(int subId, double pcoords[3], double *values,
00073                    int dim, double *derivs);
00074   virtual double *GetParametricCoords();
00075 
00077 
00079   void Clip(double value, vtkDataArray *cellScalars,
00080             vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00081             vtkPointData *inPd, vtkPointData *outPd,
00082             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00083             int insideOut);
00085 
00087 
00089   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00090                         double x[3], double pcoords[3], int& subId);
00092 
00094   int GetParametricCenter(double pcoords[3]);
00095 
00098   static void InterpolationFunctions(double pcoords[3], double weights[3]);
00101   static void InterpolationDerivs(double pcoords[3], double derivs[3]);
00103 
00105   virtual void InterpolateFunctions(double pcoords[3], double weights[3])
00106     {
00107     vtkQuadraticEdge::InterpolationFunctions(pcoords,weights);
00108     }
00109   virtual void InterpolateDerivs(double pcoords[3], double derivs[3])
00110     {
00111     vtkQuadraticEdge::InterpolationDerivs(pcoords,derivs);
00112     }
00114 
00115 protected:
00116   vtkQuadraticEdge();
00117   ~vtkQuadraticEdge();
00118 
00119   vtkLine *Line;
00120   vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
00121 
00122 private:
00123   vtkQuadraticEdge(const vtkQuadraticEdge&);  // Not implemented.
00124   void operator=(const vtkQuadraticEdge&);  // Not implemented.
00125 };
00126 //----------------------------------------------------------------------------
00127 inline int vtkQuadraticEdge::GetParametricCenter(double pcoords[3])
00128 {
00129   pcoords[0] = 0.5;
00130   pcoords[1] = pcoords[2] = 0.;
00131   return 0;
00132 }
00133 
00134 #endif
00135 
00136