VTK
dox/Filtering/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 "vtkNonLinearCell.h"
00037 
00038 class vtkLine;
00039 class vtkDoubleArray;
00040 
00041 class VTK_FILTERING_EXPORT vtkQuadraticEdge : public vtkNonLinearCell
00042 {
00043 public:
00044   static vtkQuadraticEdge *New();
00045   vtkTypeMacro(vtkQuadraticEdge,vtkNonLinearCell);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00051   int GetCellType() {return VTK_QUADRATIC_EDGE;};
00052   int GetCellDimension() {return 1;}
00053   int GetNumberOfEdges() {return 0;}
00054   int GetNumberOfFaces() {return 0;}
00055   vtkCell *GetEdge(int) {return 0;}
00056   vtkCell *GetFace(int) {return 0;}
00058 
00059   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00060   void Contour(double value, vtkDataArray *cellScalars,
00061                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00062                vtkCellArray *lines, vtkCellArray *polys,
00063                vtkPointData *inPd, vtkPointData *outPd,
00064                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00065   int EvaluatePosition(double x[3], double* closestPoint,
00066                        int& subId, double pcoords[3],
00067                        double& dist2, double *weights);
00068   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00069                         double *weights);
00070   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00071   void Derivatives(int subId, double pcoords[3], double *values,
00072                    int dim, double *derivs);
00073   virtual double *GetParametricCoords();
00074 
00076 
00078   void Clip(double value, vtkDataArray *cellScalars,
00079             vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00080             vtkPointData *inPd, vtkPointData *outPd,
00081             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00082             int insideOut);
00084 
00086 
00088   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00089                         double x[3], double pcoords[3], int& subId);
00091 
00093   int GetParametricCenter(double pcoords[3]);
00094 
00097   static void InterpolationFunctions(double pcoords[3], double weights[3]);
00100   static void InterpolationDerivs(double pcoords[3], double derivs[3]);
00102 
00104   virtual void InterpolateFunctions(double pcoords[3], double weights[3])
00105     {
00106     vtkQuadraticEdge::InterpolationFunctions(pcoords,weights);
00107     }
00108   virtual void InterpolateDerivs(double pcoords[3], double derivs[3])
00109     {
00110     vtkQuadraticEdge::InterpolationDerivs(pcoords,derivs);
00111     }
00113 
00114 protected:
00115   vtkQuadraticEdge();
00116   ~vtkQuadraticEdge();
00117 
00118   vtkLine *Line;
00119   vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
00120 
00121 private:
00122   vtkQuadraticEdge(const vtkQuadraticEdge&);  // Not implemented.
00123   void operator=(const vtkQuadraticEdge&);  // Not implemented.
00124 };
00125 //----------------------------------------------------------------------------
00126 inline int vtkQuadraticEdge::GetParametricCenter(double pcoords[3])
00127 {
00128   pcoords[0] = 0.5;
00129   pcoords[1] = pcoords[2] = 0.;
00130   return 0;
00131 }
00132 
00133 #endif
00134 
00135