VTK
dox/Filtering/vtkCubicLine.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCubicLine.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 =========================================================================*/
00035 #ifndef __vtkCubicLine_h
00036 #define __vtkCubicLine_h
00037 
00038 #include "vtkNonLinearCell.h"
00039 
00040 class vtkLine;
00041 class vtkDoubleArray;
00042 
00043 class VTK_FILTERING_EXPORT vtkCubicLine : public vtkNonLinearCell
00044 {
00045 public:
00046   static vtkCubicLine *New();
00047   vtkTypeMacro(vtkCubicLine,vtkNonLinearCell);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00051 
00052   int GetCellType() {return VTK_CUBIC_LINE;};
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;};
00058   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00059   void Contour(double value, vtkDataArray *cellScalars,
00060                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00061                vtkCellArray *lines, vtkCellArray *polys,
00062                vtkPointData *inPd, vtkPointData *outPd,
00063                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00064   int EvaluatePosition(double x[3], double* closestPoint,
00065                        int& subId, double pcoords[3],
00066                        double& dist2, double *weights);
00067   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00068                         double *weights);
00069   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00070   void Derivatives(int subId, double pcoords[3], double *values,
00071                    int dim, double *derivs);
00072   virtual double *GetParametricCoords();
00074   
00077   double GetParametricDistance(double pcoords[3]);
00078 
00080 
00082   void Clip(double value, vtkDataArray *cellScalars,
00083             vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00084             vtkPointData *inPd, vtkPointData *outPd,
00085             vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00086             int insideOut);
00088 
00090   int GetParametricCenter(double pcoords[3]);
00091 
00093 
00095   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00096                         double x[3], double pcoords[3], int& subId);
00098 
00099 
00100   
00102 
00104   static void InterpolationFunctions(double pcoords[3], double weights[4]);
00105   // Description:
00106   // @deprecated Replaced by vtkCubicLine::InterpolateDerivs as of VTK 5.2
00107   static void InterpolationDerivs(double pcoords[3], double derivs[4]);
00108   // Description:
00109   // Compute the interpolation functions/derivatives
00110   // (aka shape functions/derivatives)
00111   virtual void InterpolateFunctions(double pcoords[3], double weights[4])
00112     {
00113     vtkCubicLine::InterpolationFunctions(pcoords,weights);
00114     }
00115   virtual void InterpolateDerivs(double pcoords[3], double derivs[4])
00116     {
00117     vtkCubicLine::InterpolationDerivs(pcoords,derivs);
00118     }
00120 
00121 protected:
00122   vtkCubicLine();
00123   ~vtkCubicLine();
00124   
00125   vtkLine *Line;
00126   vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
00127 
00128 private:
00129   vtkCubicLine(const vtkCubicLine&);  // Not implemented.
00130   void operator=(const vtkCubicLine&);  // Not implemented.
00131 };
00132 
00133 //----------------------------------------------------------------------------
00134 inline int vtkCubicLine::GetParametricCenter(double pcoords[3])
00135 {
00136 
00137   pcoords[0]=pcoords[1] = pcoords[2] = 0.0;
00138   return 0;
00139 }
00140 
00141 #endif
00142 
00143 
00144